-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Low-level ESP32 bootloader SLIP communication protocol #887
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
gemenerik
force-pushed
the
rik/esp-slip
branch
4 times, most recently
from
November 23, 2021 15:54
18bdb2f
to
b8f5c67
Compare
gemenerik
requested review from
ataffanel,
jonasdn,
krichardsson and
tobbeanton
November 23, 2021 15:56
gemenerik
force-pushed
the
rik/esp-slip
branch
2 times, most recently
from
November 24, 2021 07:44
bcd540b
to
c00ae70
Compare
Supports intuitive assembling/interpretation without buffer fiddling.
Buffer to send will be sent to ESP32 over UART2.
*coms_sendbuffer_t Function takes buffer to write to ESP32 over UART. *coms_getDataWithTimeout_t *c is a pointer to to be written char timeoutTicks is the number of ticks before returning timeout (false) Allows for mocking UART comms in test environment.
Includes escape sequence for 0xC0 and 0xDB in data. Fed data size excludes escape sequence bytes.
This function allows clearing the buffer before sending a new package. The ESP32 sends no unsollicited SLIP packages (READ_FLASH is exception). ESP32 sends confirmation package several times upon synchronization. This can overflow incoming buffer. Clearing buffer avoids putting packet receiving FSM in the wrong state.
Builds receiving packet struct using SLIP decoding state machine.
1. Clears incoming buffer 2. Assembles buffer to send 3. Sends buffer 4. Receives response from ESP32
gemenerik
force-pushed
the
rik/esp-slip
branch
from
November 24, 2021 07:45
c00ae70
to
d1d8815
Compare
Code is generic and should contain no reference to underlying communication.
Allows for static sendBuffer. Can be compared to actual transmission buffer size on a higher level. Designed such that buffer can be sent over UART2 DMA which has a limited buffer size.
gemenerik
force-pushed
the
rik/esp-slip
branch
from
November 24, 2021 14:36
c00a392
to
494f194
Compare
jonasdn
suggested changes
Nov 25, 2021
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.
In general really really nice and clean code! Well done @gemenerik !
Static variables are 0 by default
gemenerik
force-pushed
the
rik/esp-slip
branch
from
November 29, 2021 10:21
a436dbb
to
84a3867
Compare
gemenerik
force-pushed
the
rik/esp-slip
branch
from
November 29, 2021 10:24
84a3867
to
c193faf
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Low-level implementation of ESP32 ROM bootloader communication protocol. First stepping stone to wireless flashing of ESP32 from zip.
The ESP32 bootloader sends no unsolicited messages. The exchange function can be called from a higher level with a variation of instructions and data (to write). The exchange executes the following tasks: