Skip to content

Conversation

Gadgetoid
Copy link
Contributor

Fix pico_bootsel_via_double_reset for RP2350.

Was borrowing this code for a USB MSC user boot toggle. Found it didn't work, delved into the bootloader and found:

https://github.com/raspberrypi/pico-bootrom-rp2350/blob/fd6104450fa8f55c11c0c9b54dbc69a27537130f/src/main/arm/varm_boot_path.c#L774

@kilograham kilograham added this to the 2.1.2 milestone Jun 18, 2025
kilograham
kilograham previously approved these changes Jun 18, 2025
Copy link
Contributor

@kilograham kilograham left a comment

Choose a reason for hiding this comment

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

I'm assuming this is correct (can't see any docs which say which regs need the password ;-) )

@Gadgetoid
Copy link
Contributor Author

Gadgetoid commented Jun 18, 2025

Section 6.4 from the good book for posterity:

All registers with address offsets up to and including 0x000000ac are password protected. Therefore, the following writeable registers are unprotected and have 32-bit write access:

• POWMAN_SCRATCH0 → POWMAN_SCRATCH7
• POWMAN_SCRATCH0 → POWMAN_SCRATCH7
• POWMAN_BOOT0 → POWMAN_BOOT3
• POWMAN_BOOT0 → POWMAN_BOOT3
• POWMAN_INTR
• POWMAN_INTE
• POWMAN_INTF

Doesn’t help that this section lands on a page boundary and it looks like a formatting error leading into another list of registers right below...

edit: of course I can’t judge ‘cos I looked at the bootrom code and only skimmed the docs until just now 🤣

@lurch
Copy link
Contributor

lurch commented Jun 18, 2025

Maybe it'd be better to use powman_set_bits ? 🤔

@Gadgetoid
Copy link
Contributor Author

Gadgetoid commented Jun 19, 2025

Maybe it'd be better to use powman_set_bits ? 🤔

Agreed! And updated.

Edit: I flew too close to the sun 😭

@lurch
Copy link
Contributor

lurch commented Jun 19, 2025

CI is failing with e.g.

/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: cannot find -lhardware_powman_headers: No such file or directory
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: cannot find -lhardware_powman: No such file or directory
collect2: error: ld returned 1 exit status
gmake[2]: *** [test/kitchen_sink/CMakeFiles/kitchen_sink_printf_compiler_no_shortcircuit.dir/build.make:1256: test/kitchen_sink/kitchen_sink_printf_compiler_no_shortcircuit.elf] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:2710: test/kitchen_sink/CMakeFiles/kitchen_sink_printf_compiler_no_shortcircuit.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....

@kilograham
Copy link
Contributor

yeah lets revert that last change, as it obviously breaks RP2040, and i don't know if it is worth having to do a platform test in the CMake and bazel

@lurch
Copy link
Contributor

lurch commented Jun 19, 2025

yeah lets revert that last change, as it obviously breaks RP2040, and i don't know if it is worth having to do a platform test in the CMake and bazel

Sorry @Gadgetoid for my duff suggestion 🤦‍♂️

Fix pico_bootsel_via_double_reset for RP2350.

Signed-off-by: Phil Howard <[email protected]>
@Gadgetoid Gadgetoid force-pushed the patch-powman-double-reset branch from cbb0eb3 to fb1f7be Compare June 19, 2025 14:40
@Gadgetoid
Copy link
Contributor Author

Sorry @Gadgetoid for my duff suggestion 🤦‍♂️

It was a good and reasonable suggestions, but SDK says no 😆

Reverted and push'd!

@kilograham
Copy link
Contributor

yeah it was a good suggestion, and probably hit back in the day too!

@kilograham kilograham merged commit 7b4b2b7 into raspberrypi:develop Jun 19, 2025
5 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.

3 participants