Skip to content
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
merged 29 commits into from
Nov 29, 2021
Merged
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1e8db32
Add UART2 DMA buffer size define
gemenerik Nov 23, 2021
edbf3fd
Initial commit protocol for SLIP packet handling
gemenerik Nov 23, 2021
9505aa0
Set maximum transmission unit
gemenerik Nov 23, 2021
c85e65e
Define ESP32 ROM bootloader commands
gemenerik Nov 23, 2021
6025da7
Define overhead length of SLIP packets for ESP32
gemenerik Nov 23, 2021
9909534
Define send and receive packet types.
gemenerik Nov 23, 2021
c890a39
Implement simple bitwise XOR checksum
gemenerik Nov 23, 2021
7d1a1d8
Assemble buffer to send from sender packet struct.
gemenerik Nov 23, 2021
71eedfd
Typedef UART comms functions.
gemenerik Nov 23, 2021
317fdb5
Implement function to send SLIP packets over comms
gemenerik Nov 23, 2021
5f2731d
Implement function to clear buffer.
gemenerik Nov 23, 2021
de1e5b1
Status of decoding state machine
gemenerik Nov 23, 2021
f9fcd40
Implement SLIP packet decoding state machine
gemenerik Nov 23, 2021
11b0ebb
Implement packet receiving function.
gemenerik Nov 23, 2021
d1d8815
Implement exchange function.
gemenerik Nov 23, 2021
572e1f1
Pass tx buffer size from function call
gemenerik Nov 24, 2021
3cbdebe
Define SLIP start/stop byte constant
gemenerik Nov 24, 2021
0d900e6
Remove references to UART, DMA
gemenerik Nov 24, 2021
f7592b1
Rename functions to match firmware style
gemenerik Nov 24, 2021
569445e
Define tx buffer size
gemenerik Nov 24, 2021
494f194
Add blank lines for legibility
gemenerik Nov 24, 2021
f155460
Remove initialization with 0 of static variables
gemenerik Nov 25, 2021
639aa8e
Add comments for clarification
gemenerik Nov 25, 2021
28459c1
Replace ternary with if statement
gemenerik Nov 25, 2021
448e3a1
Line breaks for legibility
gemenerik Nov 25, 2021
efbb8e5
Do while loop to appease the coding gods and avoid loop priming
gemenerik Nov 25, 2021
236dc52
Remove obsolete comment
gemenerik Nov 25, 2021
6106b99
Rename tx buffer size define
gemenerik Nov 29, 2021
c193faf
Implement esp_slip unit tests
gemenerik Nov 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/drivers/esp32/src/esp_slip.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,12 @@

#define ESP_OVERHEAD_LEN 8

static uint8_t generateChecksum(uint8_t *sendBuffer, esp_slip_send_packet *senderPacket)
{
uint8_t checksum = 0xEF; // seed
for (int i = 0; i < senderPacket->dataSize - 16; i++)
{
checksum ^= sendBuffer[9 + 16 + i];
gemenerik marked this conversation as resolved.
Show resolved Hide resolved
}
return checksum;
}