-
Notifications
You must be signed in to change notification settings - Fork 7.6k
feat(uart): fixes loopback function after IDF changes #11492
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
IDF 5.4.1 has added a new function called uart_release_pin() that is called whenever new pins are set or when uart driver is deleted. This has a side effect that causes RX pin to never work again with the loopback function. Other changes also have removed some GPIO setup that was necessary for the GPIO loopback mode work. The PR forces a full RX Pin setup in order to make it work in GPIO Matrix with Loopback TX Signal
👋 Hello SuGlider, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
Test Results 76 files 76 suites 12m 40s ⏱️ Results for commit 4df11ef. ♻️ This comment has been updated with latest results. |
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 restores UART loopback functionality by reconfiguring the RX pin after IDF 5.4.1’s uart_release_pin() behavior.
- Swapped out
soc/uart_periph.h
forsoc/uart_pins.h
and addedesp_private/gpio.h
- Removed legacy TX/RX signal macros and updated loopback comments
- Rewrote
uart_internal_loopback
to explicitly reinitialize the RX pin via GPIO matrix before connecting signals
Comments suppressed due to low confidence (2)
cores/esp32/esp32-hal-uart.c:1401
- [nitpick] The comment could be clearer and grammatically improved—for example, describe how
uart_release_pin()
altered default pin routing in IDF 5.4.1 and why these GPIO calls restore loopback.
// forces rxPin to use GPIO Matrix and setup the pin to receive UART TX Signal - IDF 5.4.1 Change with uart_release_pin()
cores/esp32/esp32-hal-uart.c:1402
- Since the loopback relies on these new GPIO calls, add a CI or unit test to verify
uart_internal_loopback
works correctly after IDF 5.4.1 changes.
gpio_func_sel((gpio_num_t) rxPin, PIN_FUNC_GPIO);
Co-authored-by: Copilot <[email protected]>
@me-no-dev : This PR shall fix #11416 after the IDF Change done by the commit espressif/esp-idf@60f5828 |
Memory usage test (comparing PR against master branch)The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.
Click to expand the detailed deltas report [usage change in BYTES]
|
The PR does not fix the issue @SuGlider @me-no-dev |
Description of Change
IDF 5.4.1 has added a new function called uart_release_pin() that is called whenever new pins are set or when uart driver is deleted.
This has a side effect that causes RX pin to never work again with the loopback function. Other changes also have removed some GPIO setup that was necessary for the GPIO loopback mode work.
This PR forces a full RX Pin setup in order to make it work in GPIO Matrix with Loopback TX Signal
Tests scenarios
CI Only
Related links
CI error