Fix esp8266 bootloader building and add diagnostic tools #2734
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
andSPI_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 targetAdds
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 targetMakes for easier access to esptool.