1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
#![warn(missing_docs)] //! 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: //! //! ```no_run //! use probe_rs::{Session, flashing}; //! //! let mut session = Session::auto_attach("nrf51822")?; //! //! flashing::download_file(&mut session, "binary.hex", flashing::Format::Hex)?; //! //! # Ok::<(), anyhow::Error>(()) //! ``` //! //! ### Adding data manually //! //! ```no_run //! 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())?; //! //! # Ok::<(), anyhow::Error>(()) //! ``` //! //! mod builder; mod download; mod erase; mod error; mod flash_algorithm; mod flasher; mod loader; mod progress; mod visualizer; use builder::*; use flasher::*; pub use download::*; pub use erase::*; pub use error::*; pub use flash_algorithm::*; pub use loader::*; pub use progress::*; pub use visualizer::*;