For a project (using Renesas R7FA2L1AB2DFL), a bootloader which can update our firmware is needed. We have decided to copy this bootloader in RAM, and execute it from there since otherwise code flash memory cannot be programmed. We plan to access this bootloader by setting a certain random KEY in no init RAM (setting this is triggered by an external command) and then triggering a reset. Upon reset and before jumping into our application, we check for this KEY and whether it is set or not. If it is set, we can copy our bootloader from code flash to RAM, and proceed to flash the memory.
For me, it is still unclear what a good way would be to realize this process. There are a couple of points in particular
- Where do I actually copy the bootloader from FLASH to RAM, can I do this best in the FSP system.c file?
- How do I take preinitialized variables into account?
- How do I manage that the linker takes into account that the bootloader is executed from SRAM (absolute vs relative addresses)?
The FSP flash driver will run from RAM if code flash programming is enabled in the configuration of the driver, for the parts of the flash driver driver that actually do the programming or erasing.
The FSP flash driver will run from RAM if code flash programming is enabled in the configuration of the driver, for the parts of the flash driver driver that actually do the programming or erasing.
See less