2025-06-11 10:21 AM
I use the STM32CubeIDE platform and I need to insert into my project a routine that was able to update my firmware.
What I need to understand is:
I write the routine then I place it into the ITCMRAM and I run it; does it work ?
Have I only to load into the flash (starting from the sector 0) the ELF file of the new firmware ?
Thank you, Carlo
Solved! Go to Solution.
2025-06-12 12:04 AM
Ok, I've found a solution ---> CATS
Thank you
2025-06-11 10:55 AM
Yes, if you put your update firmware function into ITCMRAM and it doesn't use FLASH at all, you are free to then erase flash and update it. After you reset, the new flash will run. However, if you lose power, you will have to recover through some method.
2025-06-11 11:26 AM
I'm not exactly sure what you're asking here.
The .ELF as a binary image is NOT directly executable, it's an object file containing many sections, including symbols, debug information, and sections which load into memory at specific addresses.
For a binary image that lives in FLASH you'd need to use a "elf2bin" type extraction, perhaps via objcopy
A .HEX also doesn't directly go into memory, but is an ASCII representation of the bytes, with each line of the file describing bytes going into a specific address, and having a checksum for that line of data. The file is generally digested in a linear form, with the parser recovering the length, address and content, and then writing that payload into the FLASH at the prescribed address.
Could you run the update from ITCMRAM, yes, but typically one would use the front portion of the FLASH to be a LOADER, which can copy itself to RAM for speed, but then write content deeper into FLASH where you want you APPLICATION to dwell.
Over what interface do you plan of sending the update?
2025-06-11 12:29 PM
Thanks TDK,
great news....but is the ELF file what I have to load ?
Carlo
2025-06-11 12:31 PM
Thanks Tesla, I use the UART1...the ST programmer load the .elf file.
Carlo
2025-06-11 2:30 PM
Ok, so you're using the System Loader in ROM, per AN2606 / AN3155 ?
Not clear on the ITCMRAM involvement here, perhaps you can cite the reference for that?
2025-06-11 3:35 PM
Yes, but it may be easier to load a raw binary file. The ELF has the same data (plus other stuff).
2025-06-11 11:49 PM
The STM32Cube generates an ELF file, does it generate also a raw binary file ?
Carlo
2025-06-12 12:04 AM
Ok, I've found a solution ---> CATS
Thank you