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

Implements UART SerialHardware Refactoring on top of IDF #5549

Merged
merged 6 commits into from
Aug 23, 2021
Merged

Implements UART SerialHardware Refactoring on top of IDF #5549

merged 6 commits into from
Aug 23, 2021

Conversation

SuGlider
Copy link
Collaborator

@SuGlider SuGlider commented Aug 16, 2021

Summary

This PR is a complete reffactoring of UART Serial Hardware and respective HAL in order to use IDF instead of current Register manipulation approach.

It implements Arduino SerialEvent functionality.

Fix #5287
Fix #5273
Fix #5519
Fix #5247
Fix #5403
Fix #5429
Fix #5047
Fix #5463
Fix #5362
Fix #5112
Fix #5443

Impact

It solves many reported issues related to UART.
It was tested and works fine for ESP32, ESP-S2 and ESP32-C3.

@SuGlider SuGlider requested review from me-no-dev, igrr and PilnyTomas and removed request for igrr August 16, 2021 14:54
@SuGlider SuGlider changed the title UART SerialHArdware Refactoring based on IDF UART SerialHardware Refactoring on top of IDF Aug 16, 2021
@SuGlider SuGlider changed the title UART SerialHardware Refactoring on top of IDF Implements UART SerialHardware Refactoring on top of IDF Aug 16, 2021
@me-no-dev me-no-dev merged commit b1d072d into espressif:master Aug 23, 2021
@SuGlider SuGlider deleted the uart_refactoring branch August 23, 2021 14:32
@SuGlider SuGlider self-assigned this Aug 23, 2021
@SuGlider SuGlider restored the uart_refactoring branch August 23, 2021 17:46
@mannarsai
Copy link

Hi,
I am trying a simple UART pass through example using Arduino IDE. Using Serial1(UART1) on ESP32-C3 DEVKITM1. But it does not seem to be working.
I am using 2.0.2 board library. Have tried, the default pins (18,19), reconfigured pins to (2,3) using Serial1.begin(). But still does not work.
I also tried looping back on Serial1 even that does not seem to work. Could you kindly help in resolving the issue.

Code Snapshot

#define BPM_UART Serial1
#define BPM_RX_UC_TX 3
#define BPM_TX_UC_RX 2

void setup() {
Serial.begin(9600);
BPM_UART.begin(9600);

Serial.println("Test");

//BPM_UART.begin(9600, SERIAL_8N1, BPM_TX_UC_RX, BPM_RX_UC_TX);
}

void loop() {

// if (Serial.available()) { // If anything comes in Serial (USB),
// BPM_UART.write(Serial.read()); // read it and send it out Serial1 (pins 0 & 1)
// }

//Shorted Pins 18,19
BPM_UART.print("a");
if (BPM_UART.available()) { // If anything comes in Serial1 (pins 0 & 1)
Serial.write(BPM_UART.read()); // read it and send it out Serial (USB)
}

}

@SuGlider
Copy link
Collaborator Author

@mannarsai
I confirmed the issue.
Indeed, something is broken in V2.0.2 regarding UART Loopback.
I'll investigate it and fix.

@SuGlider
Copy link
Collaborator Author

@mannarsai
The issue has been reviewed and fixed by #6133

@mannarsai
Copy link

Thank you

@SuGlider
Copy link
Collaborator Author

@mannarsai
Thank you for reporting this issue!

@AzezurRehman
Copy link

i am facing these error ""E (348) uart: uart_set_pin(646): tx_io_num error"" on example program under uart example uart_async_rxtxtasks please help me how to figer out these even i have configered tx and rx pin correctly

@SuGlider
Copy link
Collaborator Author

@Takashi426 - please open a new issue with a small sketch that can be used to reproduce the problem you have found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment