cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the HAL_UART_HalfCpltCallback function

GShen.1
Associate II

MCU:STM32F0Discovery board

Tools:STM32CubeMX+Keil5.30

Test condition: PC_SerialComm tools & FT232 chip board

After trying the HAL_UART_RxHalfCpltCallback Function, I find that this function couldn`t be used in the normal transmit in UART_Comm.

And would you tell me which condition I can use this function, just in single wire mode or the others?

5 REPLIES 5
TDK
Guru

"We couldn’t find any code matching 'HAL_UART_HalfCpltCallback' in STMicroelectronics/STM32CubeF0"

Doesn't seem like that's a function.

HAL_UART_TxHalfCpltCallback, however, is called when using DMA and the transfer is halfway complete. It's not called in blocking or IT mode.

If you feel a post has answered your question, please click "Accept as Solution".
GShen.1
Associate II

After trying the HAL_UART_RxHalfCpltCallback Function, I find that this function couldn`t be used in the normal transmit in UART_Comm.

And would you tell me which condition I can use this function, just in single wire mode or the others?

TDK
Guru

Well, the answer is the same:

HAL_UART_RxHalfCpltCallback is called when using DMA and the transfer is halfway complete. It's not called in blocking or IT mode. So in HAL_UART_Receive_DMA.

If you feel a post has answered your question, please click "Accept as Solution".

The UART should work in full-duplex mode

You can not use blocking code within the callbacks, and you can't nest functionality, ie try to have multiple concurrent transmit operations working.

Show some code, it might help to understand what you're doing, as your description of the problem and method are poor.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Cross posted on Keil https://community.arm.com/developer/tools-software/tools/f/keil-forum/46896/what-about-the-difference-between-rxhalfcplt-and-rxcplt-in-uart

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..