-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Ota commands in flash #6538
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
Open
davisonja
wants to merge
28
commits into
esp8266:master
Choose a base branch
from
davisonja:ota_commands_in_flash
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Ota commands in flash #6538
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
91c95a5
WIP: Flash-stored OTA commands
davisonja e97e1e7
Basic merge and update of `boards.txt.py`, untested!!
davisonja 9d598f2
Missed some brackets and forgot to finish a line!
davisonja 9733d42
Tweak values and move OTA commands to the end of sketch space (which …
davisonja c850515
Result of running `python3 tools/boards.txt.py --allgen`
davisonja f3d01a2
Cleaned up some things that had leaked in from testing
davisonja 8f1a74c
Added constant `APP_START_OFFSET` which was missed out of the transfer
davisonja 32f1539
Add includes
davisonja 923b2d7
CI Cleanup
davisonja 8205f17
CI Cleanups
davisonja 16127c2
CI Cleanups
davisonja ce6a824
Merge remote-tracking branch 'upstream/master' into ota_commands_in_f…
davisonja a931150
Regenerated the files
davisonja 1339018
switched out the cast
davisonja 68245ac
Adjusted values to be addresses not offsets and fixed up references
davisonja fa00e1e
Tweak tests
davisonja abe0f39
Merge remote-tracking branch 'upstream/master' into ota_commands_in_f…
davisonja 44ce1f7
Added some conditions around the debug output of eboot, which are def…
davisonja 217a9c5
Merge branch 'master' into ota_commands_in_flash
davisonja 9377af5
Merge branch 'master' into ota_commands_in_flash
davisonja 38b267f
Merge branch 'master' into ota_commands_in_flash
davisonja e67ebc5
Merge branch 'master' into ota_commands_in_flash
davisonja 9e78b6d
Merge remote-tracking branch 'upstream/master' into ota_commands_in_f…
davisonja 0692c61
:facepalm: moment as the previous merge of master was faulty.
davisonja 3ebeb26
Merge branch 'master' into ota_commands_in_flash
davisonja d616d90
Merge branch 'master' into ota_commands_in_flash
davisonja 4d64292
Merge branch 'master' into ota_commands_in_flash
davisonja 7762f5d
Merge remote-tracking branch 'upstream/master' into ota_commands_in_f…
davisonja File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
eboot Bootloader | ||
================ | ||
|
||
|
||
A simple bootloader which can copy an OTA update to main application address in flash and load the application code to IRAM. | ||
|
||
# Contents | ||
- [Startup sequence](#startup-sequence) | ||
|
||
|
||
### Startup sequence ### | ||
|
||
On startup the ESP ROM will [load and start the firmware image](#load-and-start) from flash location 0x0 - eboot. | ||
|
||
##### eboot will ##### | ||
1. print a version string from the current firmware image | ||
2. [attempt to read a command](#read-eboot-command) | ||
1. execute command (if found) | ||
2. on completion of the command, mark it complete | ||
3. [load and start the application](#load-and-start) | ||
|
||
|
||
|
||
### Read eboot command ### | ||
|
||
Historically eboot commands were stored in RTC RAM. In an effort to survive a power-outage mid-update (which will claer the RTC RAM) there is now provision for storing the commands in Flash. If no valid command is found in the flash storage (or flash storage is disabled) eboot will try RTC RAM. | ||
|
||
Commands are considered valid if the checksum is correct. | ||
|
||
```C | ||
typedef struct eboot_command { | ||
uint32_t magic; | ||
enum action_t action; | ||
uint32_t args[29]; | ||
uint32_t crc32; | ||
} eboot_command_t; | ||
``` | ||
|
||
|
||
### Load and start ### | ||
|
||
The firmware images are expected to have ELF headers indicating what location each section should be loaded into - which is relevant for the RAM locations. | ||
|
||
Both the ESP bootloader and eboot will work through the image sections copying the contents of the appropriate ones into their address. | ||
|
||
Finally execution jumps to the entry-point specified in the image header. | ||
|
This file contains hidden or 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe move the ifdef before the variables (otherwise this may generate a warning if DEBUG is off)