cancel
Showing results for 
Search instead for 
Did you mean: 

UARTS

yang hong
Associate II

Hello,

I am using NUCLEO F49ZI. I am trying USART for Modbus Master. So after I send command to slave device, I would like UART to be listening mode or receiving mode. however, I confuse USART2_IRQHandler() and HAL_UART_Receive_IT(&huart2, pdata, 255). I can't make it work, anybody know how to do it using HAL? I find some examples in LL, do I use LL library?

Thanks

1 REPLY 1
Pavel A.
Evangelist III

The HAL does not provide a function for the Modbus receive timeout. For receive, I"d use the LL API and a timer. Sending can be done using the HAL function.

If you use CubeMx to generate the UART setup, it will create the interrupt handler for the UART. The RX part of it needs change for using LL functions. Or, you can specify in the Cube settings that you want only LL for this UART, write the interrupt handler yourself and avoid confusion.

-- pa