AnsweredAssumed Answered

UART IRQ ECHO program using the STM32 Discovery using HAL libraries

Question asked by patil.rakesh on Oct 10, 2014
Latest reply on Dec 12, 2016 by Kale.Sumit
I'm upgrading to the new HAL libraries and got struck with UART interrupt when trying to implement ECHO,
I generated code using STMcubeMX for UART3
added in the msp init of the uart
HAL_NVIC_SetPriority(USART3_IRQn, 0, 1);
HAL_NVIC_EnableIRQ(USART3_IRQn);
Added in the stm32xx_it.c
void USART3_IRQHandler(void)
{
     HAL_UART_IRQHandler(&huart3);
}
Created callbacks in the main.c

void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
HAL_GPIO_TogglePin(GPIOD, GPIO_PIN_13);
if (huart->Instance == USART3);
 {
   buffsize = huart->RxXferSize;
   HAL_UART_Receive_IT(huart, Datarx, buffsize);
   for (int i = 0; i<buffsize;i++)
   {
   Datatx[i] = Datarx[i];
   }
   HAL_UART_Transmit_IT(huart, Datatx, buffsize);
 }
}
And adding the below in the USART init

__HAL_UART_ENABLE_IT(&huart3,UART_IT_RXNE);

after running there is nothing on the UART. can anyone guide me in this please?

Outcomes