Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix esp8266 bootloader building and add diagnostic tools #2734

Merged
merged 5 commits into from
Mar 18, 2024

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Mar 15, 2024

This PR focuses on an issue discovered in #2727 when attempting to update the esp8266 boot partition from code during a firmware update.
It was discovered that doing this renders the device unbootable because the boot sector header information is incorrect.

This is because the required SPI_SIZE, SPI_MODE and SPI_FREQ values were never passed to the rboot makefile when building.
When flashing the boot partition normally, these parameters get passed to esptool, which modifies the provided boot image.
I wasn't aware until now that it did this!

Build rboot as variant

The solution to the main problem is to build rboot as a variant - see https://sming.readthedocs.io/en/latest/_inc/Sming/building.html#library-variants.

The location of the bootloader firmware (in out/Esp8266/debug/firmware/rboot.bin) is unchanged,
but is overwritten by the appropriate variant after every build.

This should ensure consistency with selected settings.

Remove RBOOT_INTEGRATION

As we've forked rboot some time ago this isn't necessary, so we can simplify the code a bit.

Update esptool to v4.6.2 (from v4.4)

Version 4.7 has issues with earlier python versions and breaks with IDF 4.4/4.3.

Add bootinfo build target

Adds make bootinfo for esp architectures which shows details of the boot partition,
including header fields so we can check it's correct.

Add esptool build target

Makes for easier access to esptool.

Remove from supported SOC list for this version until fix implemented
@mikee47 mikee47 changed the title Improve esp8266 bootloader building and add diagnostic tools Fix esp8266 bootloader building and add diagnostic tools Mar 15, 2024
@mikee47 mikee47 force-pushed the feature/boot-info branch 2 times, most recently from b3530f6 to edf0808 Compare March 16, 2024 12:45
@mikee47 mikee47 changed the title Fix esp8266 bootloader building and add diagnostic tools [WIP] Fix esp8266 bootloader building and add diagnostic tools Mar 16, 2024
@mikee47 mikee47 force-pushed the feature/boot-info branch 2 times, most recently from 0670573 to 700c81b Compare March 16, 2024 20:37
@SmingHub SmingHub deleted a comment from what-the-diff bot Mar 16, 2024
@mikee47 mikee47 force-pushed the feature/boot-info branch from 700c81b to 0bf5773 Compare March 17, 2024 07:37
@mikee47 mikee47 changed the title [WIP] Fix esp8266 bootloader building and add diagnostic tools Fix esp8266 bootloader building and add diagnostic tools Mar 17, 2024
mikee47 added 4 commits March 17, 2024 08:38
Ensures consistency with selected settings
Remove RBOOT_INTEGRATION (simplify)
Version 4.7 has issues with earlier python versions and breaks with IDF 4.4/4.3.
@mikee47 mikee47 force-pushed the feature/boot-info branch from 0bf5773 to 485ea4e Compare March 17, 2024 08:38
@slaff slaff added this to the 5.2.0 milestone Mar 18, 2024
@slaff slaff merged commit b9029a2 into SmingHub:develop Mar 18, 2024
46 checks passed
@mikee47 mikee47 deleted the feature/boot-info branch March 18, 2024 10:19
@mikee47 mikee47 mentioned this pull request Mar 21, 2024
@slaff slaff mentioned this pull request May 8, 2024
5 tasks
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.

2 participants