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

fix: UART0 boot pin setup #9373

Merged
merged 1 commit into from
Mar 18, 2024
Merged

fix: UART0 boot pin setup #9373

merged 1 commit into from
Mar 18, 2024

Conversation

SuGlider
Copy link
Collaborator

@SuGlider SuGlider commented Mar 14, 2024

Description of Change

UART0 pins are set by ROM Boot to default values.
This must be reflected into Arduino HardwareSerial in order to allow it to correctly detach it and then attach it to something else.

Summary:
UART0 constructor sets default RX/TX pins as done in boot time.

Tests scenarios

Tested with DevKits ESP32, ESP32-S3, ESP32-S2.

// necessary to crossconnect 
// TX0(4) <--> Original TX pin, in order to see the output in the Serial Monitor - testing TX0 pin
// RX0(2) <--> TX1(17) for testing RX0 pin
void setup() {
  Serial.begin(115200, SERIAL_8N1, 2, 4); // rx0, tx0
  Serial1.begin(115200, SERIAL_8N1, 16, 17); // rx1, tx1
}

void loop() {
  Serial.println("Loop from UART0...");
  delay(1000);
  Serial1.println("Loop from UART1...");
  delay(1000);
  while(Serial.available()) Serial.write(Serial.read());
  delay(1000);
}

Related links

Fixes #9363

UART0 pins are set by ROM Boot to default values. This must be reflected into Arduino HardwareSerial in order to allow it to correctly detach it and then attach it to something else.

Summary:
UART0 constructor sets default RX/TX pins as done in boot time.
@SuGlider SuGlider self-assigned this Mar 14, 2024
@SuGlider SuGlider added this to the 2.0.15 milestone Mar 14, 2024
@SuGlider SuGlider linked an issue Mar 14, 2024 that may be closed by this pull request
1 task
@me-no-dev me-no-dev merged commit 5e89e50 into release/v2.x Mar 18, 2024
52 checks passed
@me-no-dev me-no-dev deleted the SuGlider-patch-1 branch March 18, 2024 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

ESP32S2 could not reassign Serial pins
3 participants