2015-11-10 03:50 PM
I'm trying to understand which file I should write to flash using the STM32L bootloader. For instance, if I write the whole *.hex file to flash at the correct start memory address will the application load? Why not? Or do I have to program a certain portion of a *.hex file to flash? Would it be better to use another file type like *.elf, *.axf, *.bin?
The bootloader documentation is linked below:http://www.st.com/web/en/resource/technical/document/application_note/DM00081379.pdf
Thank you! #stm32l-bootloader-program2015-11-10 04:39 PM
The System Loader expects you to provide the executable code as it is presented in memory.
The .HEX and .BIN would be simplest, and should be manageable if you have basic grasp file and memory representations. Object file formats like .ELF/AXF are well described in available documentation, you'll have to judge if they are too complicated.https://en.wikipedia.org/wiki/Intel_HEX
The .HEX written without decoding will crash the processor, because the ASCII lines are not executable opcodes. You must extract the address and data from the line records, and then write that to memory. It will help significantly if you understand the micro-processor architecture you have chosen.2015-11-10 08:15 PM
Thanks for your input. I am interested in the *.axf format. Sounds like I need to find out exactly how the *.axf file is constructed, pull out the program, parse it and program the flash. Hmmm...... Where to start? It seems like there should be applications out there to do this kind of thing. I must not be the only person trying to do this? Any idea about a utility to do this?
2015-11-15 01:54 PM
It turns out that this task was quite simple. I ended up writing a linux application to read an Intel Hex file and write it to flash in C. I found all the needed information in the Intel hex specification linked below.