forked from espressif/esp-idf
esp_system: fix garbled UART output on startup on esp32s2
Closes https://github.com/espressif/esp-idf/issues/9168
This commit is contained in:
@@ -82,6 +82,12 @@ void esp_clk_init(void)
|
|||||||
RESET_REASON rst_reas;
|
RESET_REASON rst_reas;
|
||||||
rst_reas = rtc_get_reset_reason(0);
|
rst_reas = rtc_get_reset_reason(0);
|
||||||
if (rst_reas == POWERON_RESET) {
|
if (rst_reas == POWERON_RESET) {
|
||||||
|
/* Ocode calibration will switch to XTAL frequency, need to wait for UART FIFO
|
||||||
|
* to be empty, to avoid garbled output.
|
||||||
|
*/
|
||||||
|
if (CONFIG_ESP_CONSOLE_UART_NUM >= 0) {
|
||||||
|
uart_tx_wait_idle(CONFIG_ESP_CONSOLE_UART_NUM);
|
||||||
|
}
|
||||||
cfg.cali_ocode = 1;
|
cfg.cali_ocode = 1;
|
||||||
}
|
}
|
||||||
rtc_init(cfg);
|
rtc_init(cfg);
|
||||||
|
Reference in New Issue
Block a user