Skip to content

Zephyr port: three fixes for Raspberry Pi boards - #11573

Merged
dhalbert merged 3 commits into
adafruit:mainfrom
mikeysklar:zephyr-cp-rp2-fixes
Oct 13, 2026
Merged

dhalbert merged 3 commits into
adafruit:mainfrom
mikeysklar:zephyr-cp-rp2-fixes

Conversation

@mikeysklar

@mikeysklar mikeysklar commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

What

Raspberry Pi boards on the Zephyr port now match the regular CircuitPython build.

Why

Each of these behaved differently there, which confuses tools and users.

Test main, Pico W Pico W (RP2040) Pico 2 W (RP2350)
Banner and USB name Raspberry Pi Pico Raspberry Pi Pico W 6/6 Raspberry Pi Pico 2 W
cpu.uid length 32 bytes, 24 of them zero 8 bytes, same as regular build 8 bytes
microcontroller.reset(): host sees the board reset 0/5 13/13 5/5
With #11570: 1200 baud touch, then UF2 copy 6/6 5/5
With #11570: on_next_reset(BOOTLOADER) / UF2, then reset 3/3, 2/2 3/3, 2/2
With #11570: power off, cold boot stays in CircuitPython not run 5/5

The web workflow UID drops from 64 to 16 hex digits.

Pico, Pico 2 and Feather RP2040 are build-tested only.

Written with Claude; tested on hardware by me.

🤖 Generated with Claude Code

mikeysklar and others added 3 commits October 12, 2026 06:15
Zephyr names these boards after the base Pico and Pico 2, because the W
is a board variant and its board.yml full_name has no variant. The
banner, USB product string and board_info then lose the W. Set NAME in
circuitpython.toml, as the Adafruit zephyr boards do, to match the
names the raspberrypi port uses.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
On RP2040, microcontroller.reset() restarted the CPU but the board never
left the USB bus: the host kept the same device number and only issued
a bus reset to recover. sys_reboot() ends in the Arm SYSRESETREQ, which
on RP2 does not reset the USB controller.

Reset the chip through the watchdog with every power-on state machine
domain but the oscillators selected. This matches pico-sdk's
watchdog_reboot(0, 0, 0), which the raspberrypi port's reset_cpu()
uses, except that it leaves the debug-pause bits alone; those only
pause a counting watchdog, not an immediate trigger. scratch[4] is
cleared so the boot ROM takes the normal flash boot.

The guard covers RP2350 too, using the same registers; only RP2040 was
tested on hardware.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The RP2 hwinfo driver returns an 8-byte ID: the flash unique ID, or the
chip ID on RP2350 with CONFIG_HWINFO_RPI_PICO_CHIP_ID. Every SoC but
nRF got the 32-byte placeholder length, so cpu.uid on a Pico W was the
ID followed by 24 zero bytes. Use 8 bytes, matching the raspberrypi
port's cpu.uid on the same boards.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@dhalbert dhalbert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dhalbert
dhalbert merged commit 5db0ff8 into adafruit:main Oct 13, 2026
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants