2021-10-28 09:47 PM
I have a customized bootloader app which needs to update itself.
I think if linking all the code to RAM and run code in RAM, then it should able to update itself as it does not require accessing flash.
my thought is changing all section with flash (>FLASH) to RAM (>RAM AT> FLASH), ideally it should work.
But it does not, system even not run at all, and cannot set break point.
may I know if this strategy works and may I know how to put entire program into ram and run?
if there is an example, then that will be great.
thanks
2021-10-29 12:40 AM
Update 2022: after recent HAL update also must uncomment
#define USER_VECT_TAB_ADDRESS
in Core/Src/system_stm32xxx.c
see Run code from RAM on STM32H7 (thundertronics.com) for details.
I have developed a custom bootloader that works both from FLASH and RAM of STM32H7. What you need is:
Make sure you arrange memory regions right if you use DMA. Google on VECT_TAB_SRAM to get more related information.
2021-10-29 11:04 AM
Even if your app runs from RAM you need to put it on the flash.
The bootloader (running off the flash) will copy it into RAM and jump to it.
Then the app can rewrite its copy in the flash.