2018-07-09 07:57 AM
Hello,
I have a problem with UART RX interrupt on a STM32F777.
I'm using cube mx, I've well enable interrupt in NVIC for my UART7.
In my code, I do :
HAL_UART_Receive_IT(&huart7, &UART_Data, 1);
So when a character is received, the code enters in
static HAL_StatusTypeDef UART_Receive_IT(UART_HandleTypeDef *huart)
function.
But here :
/* Check that a Rx process is ongoing */
if(huart->RxState == HAL_UART_STATE_BUSY_RX)My RxState equals HAL_UART_STATE_READY and not HAL_UART_STATE_BUSY_RX.
So my RX Callback is never called.
Do you have any idea ?
Many thanks and best regards
#uart-callback2018-07-09 05:33 PM
its much easier to use the DMA in circular mode.
Do you use the Cube ?
2018-07-10 12:23 AM
Yes, I'm using CubeMX.
This is my UART configuration :
2018-07-10 06:13 AM
What is the return value from HAL_UART_Receive_IT()?
I execute the following sequence before the initial call to HAL_UART_Receive_IT():
__HAL_UART_CLEAR_OREFLAG(huart);
__HAL_UART_CLEAR_NEFLAG(huart); __HAL_UART_CLEAR_FEFLAG(huart); __HAL_UART_DISABLE_IT(huart, UART_IT_ERR);In the RxCpltCallback function only HAL_UART_Receive_IT() is called for the next character.