Good Evening,
Many libraries that implement UART comunication in the PyBoard relies on the use of machine.UART.wait_tx_done(ms) to do delays in half or full duplex communications. https://docs.pycom.io/firmwareapi/pycom ... /uart.html
But micropython image for ESP32 (as far as I was able to seach) do not have this method implemented. I also couldn't find the Pycom wait_tx_done(ms) implementation... It seems that it is some sort of C function of the machine lib of their repo.
Am I missing something? How do you guys replaced the wait_tx_done? My application uses RTU modbus, and these delays are killing me
thanks for the help!
A replacement for _uart.wait_tx_done in esp32
Re: A replacement for _uart.wait_tx_done in esp32
I have the same issue with uModbus lib.
Did you find a solution?
Did you find a solution?
-
- Posts: 363
- Joined: Sun Apr 17, 2016 1:55 pm
Re: A replacement for _uart.wait_tx_done in esp32
You may use pin irq when there is no tx/rx irq function.
Re: A replacement for _uart.wait_tx_done in esp32
Hello world
I am using UART on ESP32 with MP 1.18. I am getting errors like:
First bunch of data is going out with no error, on another send such errors occur and UART does not send anything anymore
Update: Okay, so I cannot cal UART.deinit() just do "turn off UART" because it seems to destroy object. Will report as bug.
[1] https://docs.micropython.org/en/latest/ ... ART.deinit
I am using UART on ESP32 with MP 1.18. I am getting errors like:
Code: Select all
E (747225) uart: uart_wait_tx_done(995): uart driver error
E (747235) uart: uart_write_bytes(1119): uart driver error
E (747245) uart: uart_write_bytes(1119): uart driver error
E (747255) uart: uart_write_bytes(1119): uart driver error
E (747265) uart: uart_read_bytes(1154): uart driver error
Update: Okay, so I cannot cal UART.deinit() just do "turn off UART" because it seems to destroy object. Will report as bug.
[1] https://docs.micropython.org/en/latest/ ... ART.deinit
--
CeDeROM, SQ7MHZ, https://www.tomek.cedro.info
CeDeROM, SQ7MHZ, https://www.tomek.cedro.info
Re: A replacement for _uart.wait_tx_done in esp32
uart.init() runs a call to uart_wait_tx_done() when it starts. Unfortunately, not all arguments have a default value that cause a setting to be ignored. So if you changed timeout, timeout_char, invert or flow, you have to repeat the settings in an init() call.
Re: A replacement for _uart.wait_tx_done in esp32
Thank you All clear now, UART.deinit() destroys the object, it needs to be re-created again before UART.init(), but UART.init() can be called multiple times to change settings
Here is the GH issue: https://github.com/micropython/micropython/issues/8362
Documentation needs an update with clarification
Have a good day!
Here is the GH issue: https://github.com/micropython/micropython/issues/8362
Documentation needs an update with clarification
Have a good day!
--
CeDeROM, SQ7MHZ, https://www.tomek.cedro.info
CeDeROM, SQ7MHZ, https://www.tomek.cedro.info