Improve missing app-desc errors (#921)

* feat: Improve missing app-desc errors

* feat: Use old error
This commit is contained in:
Sergio Gasquez Arcos 2025-07-04 14:38:58 +02:00 committed by GitHub
parent c8913842a4
commit 63c3ad4e37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

View File

@ -341,7 +341,7 @@ pub enum Error {
)]
PartitionTableDoesNotFit(FlashSize),
/// App descriptor not present in binary
/// App descriptor not present in the binary
#[error("{0}")]
#[diagnostic(code(espflash::app_desc::app_descriptor_not_present))]
AppDescriptorNotPresent(String),

View File

@ -815,15 +815,14 @@ pub fn check_idf_bootloader(elf_data: &Vec<u8>) -> Result<()> {
if !has_app_desc {
if is_esp_hal {
return Err(Error::AppDescriptorNotPresent(
"The app descriptor is not present in the `esp-hal` based project.\n\
You need to add the https://crates.io/crates/esp-bootloader-esp-idf \
to your project."
"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
You may need to add the `esp_bootloader_esp_idf::esp_app_desc!()` macro to your application, see https://docs.espressif.com/projects/rust/esp-bootloader-esp-idf/latest for more information."
.to_string(),
))
.into_diagnostic();
} else {
return Err(Error::AppDescriptorNotPresent(
"The app descriptor is not present in the `esp-idf` based project.".to_string(),
"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-idf` application.".to_string(),
))
.into_diagnostic();
}