I have been chasing an issue where when I deleted an UART and then re-installed it, the data that was send was wrong.
It all boiled down to the face that in uart_driver_delete, the TXFIFO of the uart is not emptied prior to disabling the module.
Adding this codel before the the call to uart_module_disable solved the issue completly:
Code: Select all
uint32_t len;
do {
len = uart_hal_get_txfifo_len(&(uart_context[uart_num].hal));
} while (len < SOC_UART_FIFO_LEN);
I am using IDF 4.4
/Mikkel