Unverified Commit 2a971751 authored by Rodrigo Garcia's avatar Rodrigo Garcia Committed by GitHub

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.
parent 49a3c10c
...@@ -508,8 +508,8 @@ uart_t *uartBegin( ...@@ -508,8 +508,8 @@ uart_t *uartBegin(
#if SOC_UART_SUPPORT_XTAL_CLK #if SOC_UART_SUPPORT_XTAL_CLK
uart_config.source_clk = UART_SCLK_XTAL; // valid for C2, S3, C3, C6, H2 and P4 uart_config.source_clk = UART_SCLK_XTAL; // valid for C2, S3, C3, C6, H2 and P4
#elif SOC_UART_SUPPORT_REF_TICK #elif SOC_UART_SUPPORT_REF_TICK
if (baudrate <= 1000000) { if (baudrate <= 250000) {
uart_config.source_clk = UART_SCLK_REF_TICK; // valid for ESP32, S2 - MAX supported baud rate is 1MHz uart_config.source_clk = UART_SCLK_REF_TICK; // valid for ESP32, S2 - MAX supported baud rate is 250 Kbps
} else { } else {
uart_config.source_clk = UART_SCLK_APB; // baudrate may change with the APB Frequency! uart_config.source_clk = UART_SCLK_APB; // baudrate may change with the APB Frequency!
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment