Can't get UART Rx interrupt to work
I cannot get the RS232 Rx interrupt to work.
I am working with the stm3210c-eval board. I know it is no longer available; but it has a version of the processor that I wish to use and Ethernet support.
I am initiating the receive via:
HAL_UART_Receive_IT( &USART_TDP_Handle, &(USART_TDP_RxBuffer[0]), 1);The call back function HAL_UART_RxCpltCallback(HAL_UART_RxCpltCallback) is simple:
USART_TDP_ring_Buffer[USART_TDP_ring_Rx_in++] = USART_TDP_RxBuffer[0];
HAL_UART_Receive_IT( &USART_TDP_Handle, &(USART_TDP_RxBuffer[0]), 1 );
BSP_LED_On(LED3);So, if nothing else the LED should turn on when a byte is received. It does not. I have verified the LED works.
This is my initialization (not that STcubeMX did not initialize the UART Rx pin correctly):
__HAL_RCC_USART2_CLK_ENABLE();
USART_TDP_RX_GPIO_CLK_ENABLE();
USART_TDP_TX_GPIO_CLK_ENABLE();
__HAL_RCC_GPIOD_CLK_ENABLE();
/**USART2 GPIO Configuration
PD5 ------> USART2_TX
PD6 ------> USART2_RX
*/
GPIO_InitStruct.Pin = USART2_TX_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_PULLUP;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
GPIO_InitStruct.Pin = USART2_RX_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
//GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
__HAL_AFIO_REMAP_USART2_ENABLE();
/* NVIC for USART */
HAL_NVIC_SetPriority(USART2_IRQn, 0, 1);
HAL_NVIC_EnableIRQ(USART2_IRQn);
Have I missed something? I have verified that the TTL Rx signal makes to the processor's UART2 Rx pin.
