From 89d87f3ae425e4cf4fc6ce435ecade30aa11565c Mon Sep 17 00:00:00 2001 From: Djordje Nedic Date: Tue, 15 Oct 2024 16:55:30 +0200 Subject: [PATCH] fix: Fix the ESP32-S2 security info response size (#73) 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 https://github.com/esp-rs/esp-flasher-stub/issues/65 --- src/targets.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/targets.rs b/src/targets.rs index 7c4f3d3..b26d416 100644 --- a/src/targets.rs +++ b/src/targets.rs @@ -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;