Electrical – .elf or .bin file to be download as application code in ARM cortex M4

armbootloadercortex-m4

I am using a MCU with ARM Cortex M4 processor.
I Have written a bootloader on it.
Using USB CDC ACM class, i am writting the application code in memory address 0x002000.
I have generated both .elf and .bin files of the application code which i want to run through this bootloader.
Which file is required to be write in memory from bootloader?.elf or .bin?
I have generated both .elf and .bin.

Best Answer

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.