#panic-handler #panic-impl #no-std

no-std rp2040-panic-usb-boot

On panic, boot to USB mode implemented in ROM

6 releases (3 breaking)

0.5.0 Mar 28, 2023
0.3.0 Aug 26, 2022
0.2.0 Jun 5, 2022
0.1.2 Feb 15, 2021
0.1.0 Jan 27, 2021

#950 in Embedded development

Download history 1/week @ 2024-07-28 4/week @ 2024-08-11 1/week @ 2024-08-18 4/week @ 2024-09-08 5/week @ 2024-09-15 1/week @ 2024-09-22 31/week @ 2024-09-29 17/week @ 2024-10-06 99/week @ 2024-10-13 38/week @ 2024-10-20 3/week @ 2024-10-27

143 downloads per month

MIT/Apache

11KB
65 lines

Reboot to USB mode on panic

On panic, the USB boot mode implemented in ROM will be called, providing access for UF2 uploads and picotool.

Usage

Just add this to your main.rs:

use rp2040_panic_usb_boot as _;

Panic messages

Before rebooting, XIP caching is disabled and panic messages are written to the XIP RAM.

That way, the panic message can be read using picotool, eg.:

picotool save -r 0x15000000 0x15004000 message.bin
strings message.bin | head

RAM contents can be read the same way, by reading from address 0x20000000.

License

The contents of this repository are dual-licensed under the MIT OR Apache 2.0 License. That means you can choose either the MIT license or the Apache-2.0 license when you re-use this code. See MIT or APACHE2.0 for more information on each specific license.

Any submissions to this project (e.g. as Pull Requests) must be made available under these terms.

Dependencies

~7MB
~146K SLoC