Module probe_rs::flashing [−][src]
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}; let mut session = Session::auto_attach("nrf51822")?; flashing::download_file(&mut session, "binary.hex", flashing::Format::Hex)?;
Adding data manually
use probe_rs::{Session, flashing::{FlashLoader, DownloadOptions}}; let mut session = Session::auto_attach("nrf51822")?; 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
BinOptions | Extended options for flashing a binary file. |
DownloadOptions | Options for downloading a file onto a target chip. |
FlashAlgorithm | A flash algorithm, which has been assembled for a specific chip. |
FlashLoader |
|
FlashProgress | A structure to manage the flashing procedure progress reporting. |
FlashVisualizer | A structure which can be used to visualize the built contents of a flash. |
Enums
FileDownloadError | A finite list of all the errors that can occur when flashing a given file. |
FlashError | Describes any error that happened during the or in preparation for the flashing procedure. |
Format | A finite list of all the available binary formats probe-rs understands. |
ProgressEvent | Possible events during the flashing process. |
Functions
download_file | Downloads a file of given |
download_file_with_options | Downloads a file of given |
erase_all | Mass-erase all nonvolatile memory. |