Skip to content

Sets correct code for UART baud rate detection #7838

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

Merged
merged 1 commit into from
Feb 14, 2023
Merged

Conversation

SuGlider
Copy link
Collaborator

Description of Change

Excludes ESP32S3 and ESP32C3 in the UART HAL code that detects baud rate.
This feature only works for ESP32 and ESP32S2

Tests scenarios

ESP32, ESP32S2 and ESP32S3.

// This sketch works correctly with ESP32 and ESP32S2 only, so far.
// ESP32C3 and ESP32S3 seems to fail with baud rate detection
void setup() {
  Serial.begin(115200);
  Serial.println("\nTesting baud rate detection\n");
}

void loop() {
  Serial.println("Started detection for next 20 seconds.");
  Serial.println("Use the Serial Monitor. Change the baud rate in the botton of the window.");
  Serial.println("Send characters using the Serial Monitor and get the detected baud rate.");
  Serial.flush();

  Serial.begin(0);
  unsigned long detectedBaudRate = Serial.baudRate();

  if (detectedBaudRate) {
    Serial.printf("\nDetected baudrate is %lu\n\n", detectedBaudRate);
  } else {
    // this may not display correctly in the Serial Monitor, given that it failed.
    Serial.println("\nNo baudrate detected, Serial will not work!\n\n");
  }
}

Related links

Closes #7882
Closes #7718

@SuGlider SuGlider added this to the 2.0.7 milestone Feb 12, 2023
@SuGlider SuGlider self-assigned this Feb 12, 2023
@VojtechBartoska
Copy link
Contributor

Status update:

  • works for ESP32 & ESP32-S2

One issue tagged in description doesn't exist.

@me-no-dev me-no-dev merged commit 8873adb into master Feb 14, 2023
@me-no-dev me-no-dev deleted the SuGlider-patch-2 branch February 14, 2023 15:08
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.

Esp32-S3 Baud Rate Detection missing
3 participants