I have written a simple application that takes characters from one UART and relays them to another. main is empty. Only two callbacks of HAL Rx and Tx are used.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-03-28 4: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.
- Labels:
-
GPIO-EXTI
-
STM32G0 Series
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-03-28 5: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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-03-28 6: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)
