Skip to content

Conversation

@JurajSadel
Copy link
Contributor

This checks, if the bootloader has an app desc present, if not, returns an error.
Also added an option for users to disable the check.

closes #866

let section = object.section_by_name(".rodata_desc").is_some();
let symbol = object.symbols().any(|sym| sym.name() == Ok("esp_app_desc"));

if !section || !symbol {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably could check more things like the size of the app-desc, the magic word at the start and the placement (i.e. address) but if the check fails on these we screwed up and we have hil-tests for that

@JurajSadel
Copy link
Contributor Author

I'm not sure if we need to check this on other places as well or flash() is enough 🤔

@JurajSadel JurajSadel requested a review from MabezDev June 11, 2025 08:40
Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nearly there! I think we should move the check code out lib.rs though, I suggested a new place.

Copy link
Member

@MabezDev MabezDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with suggestion applied, thanks!

@JurajSadel JurajSadel enabled auto-merge June 11, 2025 10:21
@JurajSadel JurajSadel added this pull request to the merge queue Jun 11, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 11, 2025
@MabezDev MabezDev added this pull request to the merge queue Jun 11, 2025
Merged via the queue into esp-rs:main with commit 18a4e38 Jun 11, 2025
25 checks passed
MabezDev added a commit that referenced this pull request Jun 12, 2025
* Check if bootloader has app descriptor

* changelog

* refactor

* another refactor

* Update espflash/src/image_format/esp_idf.rs

Co-authored-by: Scott Mabin <[email protected]>

---------

Co-authored-by: Scott Mabin <[email protected]>
@JurajSadel JurajSadel deleted the bt branch June 12, 2025 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Detect applications where app desc is required, but not supplied

4 participants