Skip to content

Commit

Permalink
fix: Fix the ESP32-S2 security info response size (#73)
Browse files Browse the repository at this point in the history
The ESP32-S2 ROM GET_SECURITY_INFO
response does not contain chip_id and api_version fields.
Currently, the flasher stub just returns 0 and 0 for these, however
chip_id 0 is reserved for the ESP32.
This makes the stub behavior in line with the ROM.

Closes #65
  • Loading branch information
DNedic authored Oct 15, 2024
1 parent 299b8d9 commit 89d87f3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/targets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ extern "C" {
fn spi_read_status_high(status: *const u32) -> u32;
}

#[cfg(not(feature = "esp32s2"))]
const SECURITY_INFO_BYTES: usize = 20;
#[cfg(feature = "esp32s2")]
const SECURITY_INFO_BYTES: usize = 12;

pub const FLASH_SECTOR_SIZE: u32 = 4096;
pub const FLASH_BLOCK_SIZE: u32 = 65536;
Expand Down

0 comments on commit 89d87f3

Please sign in to comment.