2023-03-28 04:36 AM
Why, when transmitting at 115200 baud, after transmitting the Tx stop bit, the callback occurs after 8.5us? Does HAL add more delay? When using GPIO I measure the time on the scope from stop bit to stop bit I get 100us instead of 87us. Configuration half duplex 8bit, 1 start, 1 stop bit with ISR.
2023-03-28 05:15 AM
Which STM32, what clocks?
Cube/HAL is written in a very inefficient way, in the name of flexibility.
Try switching on compiler optimizations.
JW
2023-03-28 06:00 AM
I'm using STM32G0B1 and UART works as 1-wire , 64MHz clock. I'm rising GPIO before Tx enable and clear this GPIO in TX callback, but after the last byte was transmitted. In scope check the GPIO I get ~8.5us between stop bit transmitted and Tx callback occure.
This despite the fact that the frame is accepted by another MSU.
The problem is that another MSU sends a response after 250us. At the same time ST MCU still is in Tx callback.
Please see below :
Green channel is a signal ( Stop bit from ST MCU)
Yellow channel start of transmitting of another device
Blue End of transmitting of ST MCU from Tx callback ( HAL)