Hardware reset corrupts __uninitialized_ram() variable on Pico2 but not Pico #2203
Labels
No labels
bazel
bluetooth
board settings
boot_stage2
bug
build
c++
can't reproduce
clang
clib-interface
cmsis
code cleanliness
code size
compiler version issues
cyw43_driver
debug
discussion
documentation
duplicate
dynamic_clock
elf2uf2
enhancement
errata
filesystem
flash layout
floating point
FreeRTOS
hardware_adc
hardware_claim
hardware_clocks
hardware_dma
hardware_exception
hardware_flash
hardware_gpio
hardware_i2c
hardware_irq
hardware_pio
hardware_pwm
hardware_rcp
hardware_rtc
hardware_spi
hardware_sync
hardware_uart
hardware_vreg
hardware_watchdog
hardware_xosc
help wanted
host
IAR
installation
invalid
linker scripts
lto
lwip
mbedtls
missing API
needs reporter detail
networking
newlib
newlib-multicore
non-c
non-cmake
non-gcc
openocd
orphan PR
OS integration
pico_async_context
pico_base
pico_binary_info
pico_flash
picolibc
pico_lwip
pico_malloc
pico_multicore
pico_printf
pico_runtime
pico_stdio
pico_stdio_usb
pico_sync
pico_time
pico_util
pioasm
port
question
review
review2
rtos interop
runtime init
static library
svd
test
tinyusb
vscode
wifi integration
wontfix
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-raspberrypi/pico-sdk#2203
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
See the comments in this issue: https://github.com/raspberrypi/pico-sdk/issues/2043
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
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".
I think that is a design mistake - certainly haven't seen it in other processors I've used STM32, PIC32 etc.