Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardware reset corrupts __uninitialized_ram() variable on Pico2 but not Pico #2203

Open
UKTailwind opened this issue Jan 21, 2025 · 4 comments

Comments

@UKTailwind
Copy link

UKTailwind commented Jan 21, 2025

I save information in a variable defined as follows:
uint64_t __uninitialized_ram(_persistent);

On the RP2040 Pico this survives both a H/W reset (switch) and a watchdog reset
On the RP2350 it is corrupted by a H/W reset but works as expected with a watchdog reset

sdk 2.1.0, GCC 13.3.1, VSCode on W11

@lurch
Copy link
Contributor

lurch commented Jan 22, 2025

See the comments in this issue: #2043

@UKTailwind
Copy link
Author

UKTailwind commented Jan 22, 2025

Sorry, but that didn't mean anything to me unless it simply confirms that the RP2350 overwrites RAM whereas the RP2040 doesn't.
On all the STM32 I've used this technique works without issue like the RP2040

@lurch
Copy link
Contributor

lurch commented Jan 22, 2025

Sorry, but that didn't mean anything to me unless it simply confirms that the RP2350 overwrites RAM whereas the RP2040 doesn't.

Yes, exactly. "Ah, the problem is more fundamental than that: asserting the RUN pin powers down the memories, and they power back up when it's released." and "(The whole point of RUN is to be a global reset, and RAM being retained on RP2040 was just due to the lack of power gating on the RAMs.)".
So it's not so much "RP2350 overwrites RAM" but "RP2350 forgets the value of the RAM contents when you do a hardware reset".

@UKTailwind
Copy link
Author

asserting the RUN pin powers down the memories

I think that is a design mistake - certainly haven't seen it in other processors I've used STM32, PIC32 etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants