I am building a firmware updater for an STM32 MCU. I have so far programmed bootloader software on the device, separate from the main application in FLASH.
What I need to do is generate a binary file which will be the replacement code for the main application in FLASH. This means I can transfer the file over UART and overwrite the main application. How do I go about producing such a file?
The code was programmed using the stm32CubeIDE which generates an .elf file after building. I will add a header to this binary code before transmitting over UART.
Thank you very much in advance for your help,
Harry
How do I go about producing such a file?
- the same way you would go producing any other firmware. Write source files, compile and link.have so far programmed bootloader software
- what/which software?arm-none-eabi-objcopy -o ihex input.elf output.elf
, ie. how to convert elf to hex. Usually bootloaders are plain simple, they expose an api to program and erase memory regions. So you need a program on your PC that will understand ex. hex file format and communicate with your bootloader. STill, you didn't say what "bootloader software" you used.