That is strange indeed, rp2350/memmap_default.ld does appear to place the stack in the scratch X and Y banks (I'm using both cores), same as for RP2040.Except the Scratch RAM areas are also powered down and isn't that where the stack is by default so I'd have thought that would cause major problems if you haven't moved the stack into SRAM0 first.
Could it be the API knows you'll trash the stack from the SP register value if it powers-down SRAM1 so won't let you ?
If it doesn't I'd have thought it should.
I haven't done anything to affect the stack location, and the source code of powman_set_power_state() just writes bits to the POWMAN registers, without considering where the stack is.
So yeah, it would seem that it actually shouldn't work. And yet I've been testing for a while, with powman_set_power_state() returning PICO_OK after turning off SRAM1, and nothing unusual has happened. Maybe the idiom shown above for doing that is incorrect after all, and I haven't turned off SRAM1? That would be another explanation for why a difference in current consumption couldn't be measured.
Statistics: Posted by slimhazard — Sun Aug 25, 2024 8:37 pm