try to implement esp32s2 boot2 stage update #138
Draft
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.
Draft PR to allow boot2 stage update for esp32s2. I have tried to update the boot2 binary with update-uf2, there is a couple of issue
Digging to esptool.py https://github.com/espressif/esptool/blob/master/esptool.py#L3488, look like it does some modification to bootlaoder image to add image size, flash mode, flash freq etc to the very frist 4 bytes (header). At this point, I don't think it is the worth effort to update it, since it seem rather unsafe. It is rather easy to flash boot2 update via rom bootloader. Boot2 won't change much anyway.
Originally posted by @hathach in #134 (comment)
PS: after giving a bit more thought, I think it is still worth updating, since ROM loader is there to unbrick. However, I don't quite feel comfortable following the esptool code, maybe if someone know where is the specs for the layout. We could get this done. I push my interim work to the branch here https://github.com/adafruit/tinyuf2/tree/esp32s2-update-boot2 . If anyone could help with meta data part, that would nail it.