zephyr/modules/hal_rpi_pico
Scott Shawcroft bd05a26a67 modules: hal_rpi_pico: fix sdk uninitialized data
The pico-sdk rand module places rng_state in a .uninitialized_data
section that must not be initialized at boot. The linker fragment was
added via zephyr_linker_sources(DATA_SECTIONS ...), which placed a
(NOLOAD) section in the middle of the initialized data region. This
caused a VMA/LMA mismatch during the boot-time flash-to-RAM copy:
the NOLOAD section consumed VMA but no LMA, shifting all subsequent
section data to the wrong RAM addresses.

On RP2350 boards with USB enabled, this corrupted the USBD context
struct (placed in an iterable section after the NOLOAD gap), causing
USB initialization to fail with "Failed to initialize language
descriptor (-1)" followed by a bus fault.

Fix by using NOINIT instead of DATA_SECTIONS, which places the
uninitialized data in the noinit section where NOLOAD content
belongs. Update the linker fragment to only contribute the section
glob, since the noinit section wrapper is provided by
common-noinit.ld.

Signed-off-by: Scott Shawcroft <scott@tannewt.org>
2026-06-02 20:16:23 -04:00
..
bootloader modules: hal_rpi_pico: do not build with --specs=nosys.specs 2026-04-07 15:40:11 -04:00
pico modules: hal_rpi_pico: Make PICO_NO_BINARY_INFO configurable 2026-01-06 16:07:16 +00:00
CMakeLists.txt modules: hal_rpi_pico: fix sdk uninitialized data 2026-06-02 20:16:23 -04:00
Kconfig entropy: rpi_pico: implement entropy driver for RP2350 2026-01-06 10:39:38 +01:00
timecritical.ld drivers: hwinfo: Added unique ID support for RPi Pico 2022-03-16 10:24:32 +01:00
uninit_data.ld modules: hal_rpi_pico: fix sdk uninitialized data 2026-06-02 20:16:23 -04:00