Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Corrected eFuse BLOCK0 definitions for ESP32-C2, ESP32-C3, and ESP32-S3 (#961)

### Removed

## [4.2.0] - 2025-10-13
Expand Down
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions espflash/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ log = "0.4"
md-5 = "0.10"
miette = "7.6"
object = "0.37"
reed-solomon = "0.2.1"
regex = { version = "1.11", optional = true }
serde = { version = "1.0", features = ["derive"] }
serialport = { version = "4.7", default-features = false, optional = true }
Expand Down
9 changes: 9 additions & 0 deletions espflash/src/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -683,6 +683,15 @@ impl Connection {
Ok(())
}

/// Updates a register by applying the new value to the masked out portion of the old value.
pub fn update_reg(&mut self, addr: u32, mask:u32, new_value: u32) -> Result<(), Error> {
let masked_new_value = new_value.unbounded_shl(mask.trailing_zeros()) & mask;

let masked_old_value = self.read_reg(addr)? & !mask;

self.write_reg(addr, masked_old_value | masked_new_value, None)
}

/// Reads a register command with a timeout.
pub(crate) fn read(&mut self, len: usize) -> Result<Option<Vec<u8>>, Error> {
let mut tmp = Vec::with_capacity(1024);
Expand Down
4 changes: 4 additions & 0 deletions espflash/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,10 @@ pub enum Error {
/// Key is not in the expected section
#[error("Misplaced key, check your configuration file. Key: {0}")]
MisplacedKey(String),

/// Failed to write eFuse
#[error("Failed to write eFuse: {0}")]
WritingEfuseFailed(String),
}

#[cfg(feature = "serialport")]
Expand Down
Loading
Loading