Module probe_rs::flashing

source ·
Expand description

Flash programming operations.

This modules provides a means to do flash unlocking, erasing and programming.

It provides a convenient highlevel interface that can flash an ELF, IHEX or BIN file as well as a lower level block based interface.

Examples

Flashing a binary

The easiest way to flash a binary is using the download_file function, and looks like this:

use probe_rs::{Session, flashing, Permissions};

let mut session = Session::auto_attach("nrf51822", Permissions::default())?;

flashing::download_file(&mut session, "binary.hex", flashing::Format::Hex)?;

Adding data manually

use probe_rs::{Session, flashing::{FlashLoader, DownloadOptions}, Permissions};


let mut session = Session::auto_attach("nrf51822", Permissions::default())?;

let mut loader = session.target().flash_loader();

loader.add_data(0x1000_0000, &[0x1, 0x2, 0x3])?;

// Finally, the data can be programmed:
loader.commit(&mut session, DownloadOptions::default())?;

Structs

Extended options for flashing a binary file.
Options for downloading a file onto a target chip.
A flash algorithm, which has been assembled for a specific chip.
FlashLoader is a struct which manages the flashing of any chunks of data onto any sections of flash.
A structure to manage the flashing procedure progress reporting.
A structure which can be used to visualize the built contents of a flash.

Enums

A finite list of all the errors that can occur when flashing a given file.
Describes any error that happened during the or in preparation for the flashing procedure.
A finite list of all the available binary formats probe-rs understands.
Possible events during the flashing process.

Functions

Downloads a file of given format at path to the flash of the target given in session.
Downloads a file of given format at path to the flash of the target given in session.
Mass-erase all nonvolatile memory.
Erases sectors sectors starting from start_sector from flash.