USART DMA stops when disconnect Rx, how do I recover and restart RX?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-14 2:29 PM
Hello!
I'm using USART with DMA and when I disconnect the Rx cable, sometimes the communication resumes and sometimes not. How can I always recover USART Rx?
I tries reseting it with RCC using the line:
RCC->APB2RSTR ^= RCC_APB2RSTR_USART1RST; // USART1
But I couldn't even receive data by USART, I'm not sure how to use it.
- Labels:
-
DMA
-
RCC
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-14 3:06 PM
You might have to check and clear any noise, framing, or other error statuses from the Rx side of the USART
You'd have to transition the reset bit twice to get a reset pulse to the peripheral.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-14 4:26 PM
Thank you! So, I have to clear the flags and reset, thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-14 9:19 PM
Hi, depending on HW, you may also verify that UART RX pin is correctly pulled-up. You can activate the internal pull-up of the stm32 uart.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-14 9:46 PM
Yes! Well, that was the previous problem I solved, I activated the pull-up resistor in the UART Rx. Is that enough?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-15 12:01 AM
You can disable UART error interrupts right after init:
CLEAR_BIT(huartPtr->Instance->CR3, USART_CR3_EIE);
CLEAR_BIT(huartPtr->Instance->CR1, USART_CR1_PEIE);
but also I use software CRC32 and auto-retry for data transfers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-09-25 6:31 AM
