AnsweredAssumed Answered

HAL_UART_Receive_IT did not trigger IRQ

Question asked by Dilbert K on Apr 25, 2017
Latest reply on Apr 25, 2017 by Dilbert K

I am using the example to create a UART receive 

STM32Cube_FW_F4_V1.15.0\Projects\STM32F411RE-Nucleo\Examples\UART\UART_Printf\SW4STM32

When I used the "HAL_UART_Receive", then it is fine.

 

I have made following changes to example code, but did not get any IRQ nor the callback.

 

Below are the code I added

 

Serial_Open(void)  --> this is called in Main after SystemClock_Config()

{

   UartHandle.Instance = USART2;

 

   status=HAL_UART_Init(&UartHandle); 
   status=HAL_UART_Receive_IT(&UartHandle,uartRxBuf,1); 

}

 

void USART2_IRQHandler(void)
{
    HAL_UART_IRQHandler(&UartHandle);
}
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
    uartRdLen++;
    HAL_UART_Receive_IT(&UartHandle, uartRxBuf, 1);
}

I checked startup_stm32f411xe.s, the vector function name is correct

g_pfnVectors:

.word USART2_IRQHandler  /* USART2 */

 

What else I am missing ??

Outcomes