embassy-rp

Crates

git

Versions

rp235xa

Flavors

embassy_rp::rom_data

Function flash_op

Source
pub unsafe extern "C" fn flash_op(
    flags: u32,
    addr: u32,
    size_bytes: u32,
    buffer: *mut u8,
) -> i32
Expand description

Perform a flash read, erase, or program operation.

Erase operations must be sector-aligned (4096 bytes) and sector- multiple-sized, and program operations must be page-aligned (256 bytes) and page-multiple-sized; misaligned erase and program operations will return BOOTROM_ERROR_BAD_ALIGNMENT. The operation — erase, read, program — is selected by the CFLASH_OP_BITS bitfield of the flags argument.

See datasheet section 5.5.8.2 for more details.

Supported architectures: ARM-S, RISC-V

§Safety

This is a low-level C function. It may be difficult to call safely from Rust. If in doubt, check the rp235x datasheet for details and do your own safety evaluation.