Question
STM32 LPUART INTERRUPT IS NOT WORKING
Hi,
I am developing on stm32l011 board and I am facing issue about UART interrupt.
static uint8_t rxBuffer[32] = { 0 };
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
/* Check if it is start command. */
if(NULL != strstr((char*) rxBuffer, KEYPAD_START_COMMAND))
{
/* Increase received data count. */
g_ReceivedDataCount++;
/* Turn flag on. */
g_devicePlugged = true;
}
/* Check if it is stop command. */
else if(NULL != strstr((char*) rxBuffer, KEYPAD_STOP_COMMAND))
{
/* Turn flag off. */
g_devicePlugged = false;
}
if(0 != rxBuffer[sizeof(rxBuffer) - 1])
{
memset(rxBuffer, 0, sizeof(rxBuffer));
}
/* Start UART RX again. */
if (HAL_UART_Receive_IT(&hlpuart1, rxBuffer, sizeof(rxBuffer)) != HAL_OK)
{
/* Handle error if the UART receive does not start properly */
Error_Handler();
}
}
When I send data less than 32 byte, interrupt works sccesfully but after I send greater than 32 byte data, interrupt firing and never work again. I tried to abort rx data but it didn't work. I tried to use DMA but I have still same problem. How can I fix that?
Have a nice day.
