-
Notifications
You must be signed in to change notification settings - Fork 0
Feat/add uart support #25
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
base: master
Are you sure you want to change the base?
Conversation
👋 Hello Dzarda7, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
c082f6b to
e6fdc45
Compare
|
@dobairoland @radimkarnis @jedi7 This is working implementation for UART. I do not expect many changes in the API on esp-stub-lib side, but it waits for merging as some things needs to be decided. But this can be used for testing. Also review can be done I believe. |
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.
Pull Request Overview
This PR implements UART reception and SLIP protocol command processing for ESP stub firmware, enabling the stub to receive and decode commands from the host. Key changes include implementing the SLIP decoder state machine with buffer management, adding UART interrupt handling, and fixing BSS initialization and checksum handling issues.
Key changes:
- Implements complete SLIP frame reception with state machine, error handling, and buffer management
- Adds UART interrupt handler to receive bytes and process them through SLIP decoder
- Fixes command handler to account for checksum field in SLIP header and replaces inline register functions with macros
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/slip.h | Adds function declarations for frame reception status checking and data retrieval |
| src/slip.c | Implements SLIP decoder state machine with buffering, error detection, and frame completion tracking |
| src/main.c | Adds BSS initialization, UART setup with interrupt handler, and main loop for processing received frames |
| src/command_handler.c | Replaces inline register access functions with macros and accounts for checksum in SLIP header parsing |
| src/CMakeLists.txt | Adds command_handler.c to build sources |
| esp-stub-lib | Updates submodule to version with UART support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
LGTM in general. Thanks! |
radimkarnis
left a comment
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.
Nice job, this LGTM, thank you!
1ef9839 to
aea8a71
Compare
This commit also starts using read and write reg macros from esp-stub-lib
aea8a71 to
79019f4
Compare
79019f4 to
ae5f342
Compare
|
@dobairoland @radimkarnis @jedi7 I believe this should be ready, incorporates all the new changes from esp-stub-lib. I addressed all the suggestions. If you agree, I will merge this. |
dobairoland
left a comment
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.
LGTM
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.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
This PR adds support for UART reception and processing of SLIP command. It was tested and works on the following targets:
esp32 v3.1
esp32c2 v2.0 (v1.0 does not work!)
esp32c3 v1.0
esp32c6 v0.1
esp32h2 v0.1
esp32s3 v0.2
esp32s2 v1.0
esp32c5 v1.0 and v1.1
esp32p4 v1.2 (need new target for >=v3.0)
Along the way, other stuff was fixed and resolved to enable this like not linking standard libraries which caused build with warnings for newer targets. Erase of bss section and account for checksum in SLIP header.
Related
Related esp-stub-lib PR, not merged yet, needs some modifications: espressif/esp-stub-lib#30
Testing
Tested on mentioned targets using
esptool flash-idcommand. Works, some targets fail because flash chip is not attached, but stub responds correctly.Checklist
Before submitting a Pull Request, please ensure the following: