#rom #rp2040 #raspberry-pi #no-std

no-std rp2040-rom

Access to Raspberry Pi RP2040 ROM functions from Rust

4 releases

new 0.1.3 Mar 16, 2025
0.1.2 Mar 16, 2025
0.1.1 Feb 25, 2025
0.1.0 Feb 25, 2025

#679 in Embedded development

Download history 115/week @ 2025-02-19 136/week @ 2025-02-26 2/week @ 2025-03-05 223/week @ 2025-03-12

476 downloads per month

MIT license

7KB

rp2040-rom

A lightweight Rust crate providing safe access to Raspberry Pi RP2040 ROM functions.

Features

  • Access to RP2040 ROM functions from Rust
  • Currently implemented:
    • reset_usb_boot: Reset the chip and enter USB bootloader (DFU) mode

Usage

Add this to your Cargo.toml:

[dependencies]
rp2040-rom = "0.1.0"

Example

use rp2040_rom::ROM;

// Reset into USB bootloader (DFU) mode
unsafe {
    ROM::reset_usb_boot(0, 0);
}

Safety

All ROM functions are marked as unsafe because:

  1. They involve direct hardware manipulation
  2. They can reset the device
  3. They require specific hardware (RP2040)

Documentation

For more details on the RP2040 ROM functions, see the RP2040 Datasheet.

License

Licensed under MIT License.


lib.rs:

This module provides the ability to call Raspberry Pi ROM functions.

The RP2040 ROM contains several useful functions that can be called directly from user code, including functions to reset the device and enter the USB bootloader.

Safety

All functions in this crate are marked as unsafe because they involve direct hardware manipulation and can reset the device.

Example

use rp2040_rom::ROM;

// Reset into USB bootloader mode
unsafe {
    ROM::reset_usb_boot(0, 0);
}

No runtime deps