diff --git a/CHANGELOG.md b/CHANGELOG.md index d9d5f449..b49c40c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Corrected eFuse BLOCK0 definitions for ESP32-C2, ESP32-C3, and ESP32-S3 (#961) - Fixed Secure Download Mode detection on ESP32-P4 (#972) - Several fixes in `read_efuse` (#969) +- Fixed a problem in detecting the app-descriptor for a project if `strip = true` is used (#975) ### Removed diff --git a/espflash/src/image_format/idf.rs b/espflash/src/image_format/idf.rs index 7223b260..7fbb9455 100644 --- a/espflash/src/image_format/idf.rs +++ b/espflash/src/image_format/idf.rs @@ -809,10 +809,17 @@ where pub fn check_idf_bootloader(elf_data: &Vec) -> Result<()> { let object = File::parse(elf_data.as_slice()).into_diagnostic()?; - let has_app_desc = object.symbols().any(|sym| sym.name() == Ok("esp_app_desc")); - let is_esp_hal = object.section_by_name(".espressif.metadata").is_some(); + // A project with `strip = true` will discard the + // symbol we are looking for but the section is kept + let has_app_desc = object.symbols().any(|sym| sym.name() == Ok("esp_app_desc")) + || object.section_by_name(".flash.appdesc").is_some() + || object.section_by_name(".rodata_desc").is_some(); if !has_app_desc { + // when using `strip = true` we will (maybe wrongly) assume ESP-IDF + // but at least it should still guide the user into the right direction + let is_esp_hal = object.section_by_name(".espressif.metadata").is_some(); + if is_esp_hal { return Err(Error::AppDescriptorNotPresent( "ESP-IDF App Descriptor (https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/system/app_image_format.html#application-description) missing in your`esp-hal` application.\n