Low power fixups#2941
Conversation
Doesn't need to be in crt0, and that is less maintainable anyway
Clang sometimes tries to place persistent_data in a differet region Fix is to add `> XXX` to the end, to explicitly put it in RAM/XIP_RAM
kilograham
left a comment
There was a problem hiding this comment.
looks good - quick question - does the linker complain if you initialize variables in __persistent_data (since it is NOLOAD)?
I thought it would complain, but it seems the linker only complains on RP2040, where the persistent data is placed in It looks like the fix is to change the |
I don't think this is possible for the following reasons:
A way to raise a different error if you try to initialise |
|
Actually that doesn't work either, it breaks char __persistent_data(large_thing)[0x1000] |
Fixups to low power, for better compatibility and maintainability
Move persistent data reset into C runtime init code, as it doesn't need to be in crt0 - this will make it easier to maintain. Also adds resetting persistent data on all non-powman boots, rather than resetting just based off the contents of
scratch[6], as that could be leftover when loading with a debugger.Fix low power compilation issue with clang
, the fix is to add
> XXXto the end, to explicitly put it in RAM/XIP_RAM. I noticed this as part of pico-psram (where Clang would try to put it in PSRAM at the address in SRAM, and therefore it wouldn't fit), but this could also occur when usingsection_extra_post_data.incl. This requires addingmemory_xip_ram.inclto the linker scripts by default, which was coming anyway as part of the xip_ram PR.