Skip to content

Commit 6dcdcd9

Browse files
committed
Improve app-descriptor detection
1 parent b01bb71 commit 6dcdcd9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717

1818
- Corrected eFuse BLOCK0 definitions for ESP32-C2, ESP32-C3, and ESP32-S3 (#961)
1919
- Fixed Secure Download Mode detection on ESP32-P4 (#972)
20+
- Fixed a problem in detecting the app-descriptor for a Rust-std project if `strip = true` is used
2021

2122
### Removed
2223

espflash/src/image_format/idf.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,10 @@ where
809809
pub fn check_idf_bootloader(elf_data: &Vec<u8>) -> Result<()> {
810810
let object = File::parse(elf_data.as_slice()).into_diagnostic()?;
811811

812-
let has_app_desc = object.symbols().any(|sym| sym.name() == Ok("esp_app_desc"));
812+
// for unknown reasons a Rust-std project with `strip = true` will discard the
813+
// symbol we are looking for but the section is kept
814+
let has_app_desc = object.symbols().any(|sym| sym.name() == Ok("esp_app_desc"))
815+
|| object.section_by_name(".flash.appdesc").is_some();
813816
let is_esp_hal = object.section_by_name(".espressif.metadata").is_some();
814817

815818
if !has_app_desc {

0 commit comments

Comments
 (0)