You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am unsure why the sentinel value is subtracted from the flash app load address in kernel.c. It doesn't seem to be re-added anywhere so does this mean that the flash image is loaded at a different address to the one specified or is this just to compensate for a fixed offset encoded into the relocations? Might be worth a comment explaining what is happening:
The app linker script was adapted from the Tock project. It sets SRAM to address 0x0 and Flash to 0x80000000. The MSBit is used to distinguish between SRAM and Flash. You can relocate the app to another address but it must retain the MSB set. The function program_flash_with_elf has a flash_offset parameter. From the point of view of the ELF loading, it's just a regular offset that is applied to the existing value (i.e. address) of the ELF symbols. To convert between the absolute base address you want to relocate the Flash to (e.g. 0x80005000) and the offset you are applying (0x5000) you subtract 0x80000000, i.e. the SENTINEL. I'll make this clearer in the documentation and/or code comments. Thanks!
I am unsure why the sentinel value is subtracted from the flash app load address in kernel.c. It doesn't seem to be re-added anywhere so does this mean that the flash image is loaded at a different address to the one specified or is this just to compensate for a fixed offset encoded into the relocations? Might be worth a comment explaining what is happening:
epic-c-example/kernel.c
Line 26 in 535d1a5
The text was updated successfully, but these errors were encountered: