Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

(UART): ESP32 - Cannot change baud rate from 230400 to 460800 with Serial.updateBaudRate() #10641

Copy link
Copy link
Closed
@deltecent

Description

@deltecent
Issue body actions

Board

ESP-WROOM-32

Device Description

I have an ESP-WROOM-32 DEV KIT 1 with RX2 and TX2 (Serial2) connected to a MAX3380 RS232 Transceiver.

Hardware Configuration

Nothing else attached to the board.

Version

v3.0.7

IDE Name

Arduino IDE 2.3.3

Operating System

macOS 13.7.1

Flash frequency

80Mhz

PSRAM enabled

yes

Upload speed

921600

Description

#10172 corrects a problem with baud rates above 250K by setting the proper clock source. This functionality only works in Serial.begin() and does not work in Serial.updateBaudRate().

If Serial.begin() is invoked with a baud rate under 250K, the source clock is set to UART_SCLK_REF_TICK, otherwise the source clock is set to UART_SCLK_APB.

If the source clock is set to UART_SCLK_REF_TICK during Serial.begin(), updating the baud rate with Serial.updateBaudRate() to one that requires UART_SCLK_APB will not work because the source clock isn't change.

Sketch

Serial2.begin(230400);
Serial.printf("%d\n", Serial2.baudRate());
// Clock is now UART_SCLK_REF_TICK

Serial2.updateBaudRate(460800);
Serial.printf("%d\n", Serial2.baudRate());
// Clock is still UART_SCLK_REF_TICK

Serial2.end();
Serial2.begin(460800);
Serial.printf("%d\n", Serial2.baudRate());
// Clock is now UART_SCLK_APB

Debug Message

I do not have any debug output as I do not know how to access the current UART source clock setting from the Serial API. I just know Serial2.baudRate() returns baud rates based on the initial `Serial2.begin()` source clock setting.

Other Steps to Reproduce

No response

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done
Show more project fields

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.