5:30 Oh my god!!! This is exactly what I needed. I never knew why this callback function exists and when it is triggered. Great tutorial, way better than GPT 4o.......
Thanks for sharing. Always very practical topics. I am impressed of the HAL function knowledge. Is there somewhere a total overview of all the HAL functions (not only the UART)?
In my case I have an MCU that automatically sends data to the TX port, when I connect another MCU to get this data, the data does not fall into the same position in the buffer compared to what is being sent due to the receiver connecting in the middle of the transfer, like control this transmission to match the transmitter and receiver buffer positions? I do not know what to do 😔
There’s something I don’t understand. If I put the Hal_receive_IT outside the while loop as in your video, it doesn’t work. If I put it inside the while it works.. any idea?
That's not how it works. The interrupt shouldn't be put in the while loop, it defies the entire purpose of interrupt. When you call the interrupt receive (not in while loop of course), the function will wait in the background for the given number of bytes to arrive. Once the required number of data bytes has been received, an interrupt will trigger an RX Complete callback is called by default. When this callback is called, the receive IT interrupt gets disabled. This is how the HAL works. After you process the received data, call the function HAL receive IT again inside the callback itself. This will enable the interrupt again.
5:30 Oh my god!!!
This is exactly what I needed. I never knew why this callback function exists and when it is triggered.
Great tutorial, way better than GPT 4o.......
Thank you so much, been trying for hours but finally solved it after watching your video
Thanks for the educational series. Is there a resource you would recommend to learn more ?
Thanks for sharing. Always very practical topics. I am impressed of the HAL function knowledge. Is there somewhere a total overview of all the HAL
functions (not only the UART)?
Yes they are available for every series. You can google something like "stm32f1 hal documentation".
Thanks! @@ControllersTech
Thank you for your video!
thank you very much!
In my case I have an MCU that automatically sends data to the TX port, when I connect another MCU to get this data, the data does not fall into the same position in the buffer compared to what is being sent due to the receiver connecting in the middle of the transfer, like control this transmission to match the transmitter and receiver buffer positions? I do not know what to do 😔
Asynchronous transfers can't do that. That is why there are SPI and I2C communications, where you use the clock to synchronize the data.
@@ControllersTech
The idea would be when you connect the MCU and it sends a command to the other to start the transfer process? In case of UART
There’s something I don’t understand. If I put the Hal_receive_IT outside the while loop as in your video, it doesn’t work. If I put it inside the while it works.. any idea?
That's not how it works. The interrupt shouldn't be put in the while loop, it defies the entire purpose of interrupt.
When you call the interrupt receive (not in while loop of course), the function will wait in the background for the given number of bytes to arrive.
Once the required number of data bytes has been received, an interrupt will trigger an RX Complete callback is called by default.
When this callback is called, the receive IT interrupt gets disabled. This is how the HAL works. After you process the received data, call the function HAL receive IT again inside the callback itself. This will enable the interrupt again.
Very interesting.
Thanks you sir
whats the name of the serial terminal program you use to send "Hello" ? and where can i download it ?
WCHSerialPort. It is available on appstore
@@ControllersTech Can i=this work on Window11? is it free ?
@@ControllersTech can i use Realterm to send the "hello" ?
Yes you can use realterm
5:00