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.
This commit is contained in:
parent
49a3c10ce0
commit
2a971751a7
1 changed files with 2 additions and 2 deletions
|
|
@ -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!
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue