.elf or .bin file to be download as application code in ARM cortex M4
My bootloader is working fine.
I have used .bin file for downloading in flash.
to convert .elf to .bin file use the post building options for GNU gcc compiler as follow :
arm-none-eabi-objcopy -O binary My_project.elf My_project.bin

It converts My_project.elf file to My_project.bin file.