embassy-rp

Crates

git

Versions

rp235xb

Flavors

Function embassy_rp::rom_data::flash_exit_xip

source ·
pub unsafe extern "C" fn flash_exit_xip()
Expand description

Initialise the QMI for serial operations (direct mode)

Also initialise a basic XIP mode, where the QMI will perform 03h serial read commands at low speed (CLKDIV=12) in response to XIP reads.

Then, issue a sequence to the QSPI device on chip select 0, designed to return it from continuous read mode (“XIP mode”) and/or QPI mode to a state where it will accept serial commands. This is necessary after system reset to restore the QSPI device to a known state, because resetting RP2350 does not reset attached QSPI devices. It is also necessary when user code, having already performed some continuous-read-mode or QPI-mode accesses, wishes to return the QSPI device to a state where it will accept the serial erase and programming commands issued by the bootrom’s flash access functions.

If a GPIO for the secondary chip select is configured via FLASH_DEVINFO, then the XIP exit sequence is also issued to chip select 1.

The QSPI device should be accessible for XIP reads after calling this function; the name flash_exit_xip refers to returning the QSPI device from its XIP state to a serial command state.

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.