This repository has been archived by the owner on Jul 20, 2022. It is now read-only.
forked from adafruit/Adafruit_WebSerial_ESPTool
-
Notifications
You must be signed in to change notification settings - Fork 16
Flash Autodetect and Bootloader patching #23
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Added commands to autodetect flash size mimicking what esptool.py does. It is called automatically after the stub is run. - Added bootloader patching on the fly of the flash parameters in the header bytes of the bootloader. In this iteration Flash Mode is always set to DIO and Flash Frequency to 40m. Flash Size is set to the autodetected value, if any, otherwise 4MB. The code checks for a magic bytes that indicate the image being flashed is a bootloader.
Replaced chip detection with reading form CHIP_DETECT_MAGIC_REG_ADDR register which is the way esptool.py does it currently.
balloob
reviewed
Jun 22, 2021
balloob
reviewed
Jun 22, 2021
balloob
reviewed
Jun 22, 2021
balloob
reviewed
Jun 22, 2021
Closed
balloob
reviewed
Jun 22, 2021
balloob
reviewed
Jun 22, 2021
balloob
reviewed
Jun 22, 2021
Co-authored-by: Paulus Schoutsen <[email protected]>
balloob
approved these changes
Jun 22, 2021
Co-authored-by: Paulus Schoutsen <[email protected]>
Co-authored-by: Paulus Schoutsen <[email protected]>
Closed
Co-authored-by: Paulus Schoutsen <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Added commands to autodetect flash size mimicking what esptool.py does. It is called automatically after the stub is run.
Added bootloader patching on the fly of the flash parameters in the header bytes of the bootloader. In this iteration Flash Mode is always set to DIO and Flash Frequency to 40m. Flash Size is set to the autodetected value, if any, otherwise 4MB. The code checks for a magic bytes that indicate the image being flashed is a bootloader.
Replaced chip detection with reading form CHIP_DETECT_MAGIC_REG_ADDR register which is the way esptool.py does it currently.
To be added in the future:
Being able to pass FlashMode and FlashFrequency to flashData so that defaults DIO and 40m can be overridden. ESP-Web-tools would have to be able to pass these in some sort advanced mode? Otherwise there might be boards that cannot be flashed because those settings must be in the bootloader.
Esptool.py does one additional check to make sure the image being flashed is in fact a boot loader, just in case by chance a normal user image starts with the "magic header". This is pretty complex code and according to their comments it is a rare occurrence anyway, only more frequent when flashing encrypted images which eep-web-flasher does not support (yet, maybe ever).