2017-07-28 01:16 PM
Hi everyone,
This is not a very serious issue for my application, however, I would like to understand this behavior.
In my application, when the STM receives a packet, it sends out a packet with a confirmation. The content of the packets is not important. What matters is that sometimes the transmission of the packet, in this case, 6 bytes, is paused. As you can see in the images, it transmits 5 bytes, then pauses for about 22ms and then transmits the last byte.
This shouldn't happen as I called the function HAL_UART_Transmit_IT() passing the array with the 6 bytes to be written at once. They should be all transmitted together.
Does any one know what could cause this delay?
I'm using an STM32F030R8 and, according to the header in my code, it should be HAL lib version 1.4.
#usart-tx-issue #uart-tx #hal_uart_transmit_it2017-07-28 01:21 PM
>>
Does any one know what could cause this delay?
Mindless spin loops? It's HAL it is jammed full of nonsense..
2017-07-28 03:29 PM
Hahah, isn't that right?! Unfortunately, I think your answer sums it up.
2017-07-28 04:00 PM
One of my key problems with the design is the constant use of blocking loops, and no demarcation of which routines are interrupt safe/suitable and those which aren't. I have a HAL example here, shipped from the source, which uses a USART, a radio, and a ticker, and the interrupts on these cause such awful inter-play that there is data loss on ALL interfaces.
I see opportunity for dead-locks, and more frequently priority inversion.
Check carefully the preemption levels on interrupts in use, and where it might be in a spin loop waiting for some event to occur.