Open apoussartFW opened 2 years ago
Have you seen how e.g. the NXP Kinetis series handles this? It needs a specific variable for configuration to be stored at a fixed address in flash: https://github.com/zephyrproject-rtos/zephyr/blob/main/soc/arm/nxp_kinetis/flash_configuration.c
Is your feature request related to a problem? Please describe. Impossibility right now to have two variables placed at the beginning (fixed address) and the end of the zephyr app code.
Describe the solution you'd like The idea would be that a variable in the beginning of the program and another at the end would be used to verify its integrity when being sent to a device through an unreliable channel. If the first variable points towards an address that correctly contains a fixed magic word that is located at the very end of the image, then the app was sent in its entirety.
I would like to be able to place C variables at given addresses in the Linker at compile time so that the generated .hex already has those addresses with the correct values.
More specifically, I'd like to be able to do something like this in my C code:
APP_END and APP_START would be defined in a linker or using a specific structure as follows:
where APP_START would be forced at 0x08000300 (example fixed address at the beginning of the app) and APP_END would naturally go at the end of the app.
Describe alternatives you've considered I tried to use the Code Relocation (https://docs.zephyrproject.org/latest/kernel/code-relocation.html) feature but with no success for a single 32-bits word of data to be put at the very beginning of the program space.