Skip to content

Commit 2a97175

Browse files
authored
fix(uart): clock source (#10172)
Problem detected with ESP32 and ESP32-S2 when the baudrate goes to 460600 bps. REF_TICK (2MHz) seem not to work properly. Limiting the use of REF_TICK for up to 205 Kbps.
1 parent 49a3c10 commit 2a97175

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cores/esp32/esp32-hal-uart.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -508,8 +508,8 @@ uart_t *uartBegin(
508508
#if SOC_UART_SUPPORT_XTAL_CLK
509509
uart_config.source_clk = UART_SCLK_XTAL; // valid for C2, S3, C3, C6, H2 and P4
510510
#elif SOC_UART_SUPPORT_REF_TICK
511-
if (baudrate <= 1000000) {
512-
uart_config.source_clk = UART_SCLK_REF_TICK; // valid for ESP32, S2 - MAX supported baud rate is 1MHz
511+
if (baudrate <= 250000) {
512+
uart_config.source_clk = UART_SCLK_REF_TICK; // valid for ESP32, S2 - MAX supported baud rate is 250 Kbps
513513
} else {
514514
uart_config.source_clk = UART_SCLK_APB; // baudrate may change with the APB Frequency!
515515
}

0 commit comments

Comments
 (0)