2020-02-13 04:17 PM
I can’t seem to get the FIFO to work on the RX side. TX works fine.
Seems as if the FIFO isn't used. If I interrupt on the "RX not empty" event and read the data, it works fine. But as soon as I want to interrupt on any FIFO event, I never get the interrupt.
When I manually read the receive side of the UART, there really is just one byte in there. Almost as if there is no FIFO on the RX side.
huart8.Instance = UART8;
huart8.Init.BaudRate = 115200;
huart8.Init.WordLength = UART_WORDLENGTH_8B;
huart8.Init.StopBits = UART_STOPBITS_1;
huart8.Init.Parity = UART_PARITY_NONE;
huart8.Init.Mode = UART_MODE_TX_RX;
huart8.Init.HwFlowCtl = UART_HWCONTROL_NONE;
huart8.Init.OverSampling = UART_OVERSAMPLING_16;
huart8.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
huart8.Init.ClockPrescaler = UART_PRESCALER_DIV1;
huart8.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
HAL_UART_Init(&huart8);
HAL_UARTEx_EnableFifoMode(&huart8);
SET_BIT(huart8.Instance->CR1, USART_CR1_RXFFIE);
...
void UART8_IRQHandler(void)
{
uint32_t isrflags = READ_REG(huart8.Instance->ISR);
if (isrflags & USART_ISR_RXFF)
{
....
}
2020-02-13 09:10 PM
Which devices are you talking about? In most STM32s, there are no UART FIFOs. DMA is used instead.