Long delay after UART transmit
Posted: Mon Oct 28, 2019 9:31 pm
Hey all,
I'm writing code for an ESP32 to talk to two devices over the same UART line using an RS485 multiplexing setup. Because my setup is not standard, I have been hesitant to use the IDF's built-in RS485 mode and instead have opted to manually control the TX/RX select line in my communications architecture.
The basic communication flow is as follows: call. I also tried raising the priority of my comms task above all others and the problem still remains. Any ideas?
I'm writing code for an ESP32 to talk to two devices over the same UART line using an RS485 multiplexing setup. Because my setup is not standard, I have been hesitant to use the IDF's built-in RS485 mode and instead have opted to manually control the TX/RX select line in my communications architecture.
The basic communication flow is as follows:
- Set Select line to Write (TX) level
- Write message ()
Code: Select all
uart_write_bytes
- Wait for TX to finish ()
Code: Select all
uart_wait_tx_done
- Set Select line to Read (RX) level
- Read message, decode, process
Code: Select all
uart_wait_tx_done