We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
In function Usart_Receive RXNE Interrupt is disabled before receiver busy check.
I think you have to turn around.
Imagine a call of this function while receiving data. Receiver remains busy with disabled Interrupt.
// code extract from USART_STM32F4xx.c Revision V2.3 static int32_t USART_Receive ( void *data, uint32_t num, const USART_RESOURCES *usart) { int32_t stat; #ifdef __USART_DMA_RX uint32_t cr1; uint32_t dest_inc = DMA_MINC_ENABLE; #endif if ((data == NULL) || (num == 0U)) { // Invalid parameters return ARM_DRIVER_ERROR_PARAMETER; } if ((usart->info->flags & USART_FLAG_CONFIGURED) == 0U) { // USART is not configured (mode not selected) return ARM_DRIVER_ERROR; } // Disable RXNE Interrupt usart->reg->CR1 &= ~USART_CR1_RXNEIE; // Check if receiver is busy if (usart->info->status.rx_busy == 1U) { return ARM_DRIVER_ERROR_BUSY; }
Thanks for the quick reply, I honor it.