UART reconnection issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-09 1:40 PM
Hello!
I'm receving data in UART rx, using DMA and ring buffer with idle detection, but when I disconnect and reconnect the cable in Rx the communication stops and my buffer fills up with '\0'. So, I need to resume the UART communication, how can I do this?
I tried to execute the UART init fuctions, but it didn't work. Now I wonder if the cause of this is the no pull-up resistors in Rx. What do you think? I would try this, but CubeMx doesn't let me configure this.
Solved! Go to Solution.
- Labels:
-
DMA
-
STM32CubeMX
-
UART-USART
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-09 11:14 PM
By writing data to a register?
#define GPIO_PUPDR_PU 1u
GPIOA->PUPDR |= GPIO_PUPDR_PU << (2 * 10);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-09 1:58 PM
In my case UART Rx needs a pull up resistor.
But CubeMx doesn't allow me to change this, how can I do it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-09 11:14 PM
By writing data to a register?
#define GPIO_PUPDR_PU 1u
GPIOA->PUPDR |= GPIO_PUPDR_PU << (2 * 10);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-10 8:42 AM
I wasn't sure if I could do that, but I tried and it works. Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-10 10:38 AM
I may be a bit late to the game here, but you SHOULD be able to change this in CubeMX. From the image you posted, click on the RX pin line and there should be a configuration window down below. Unfortunately, that is often displayed below the viewable part of the window, so scroll down. You should see lines to change "GPIO mode", "GPIO Pull-up/Pull-down", "Maximum output speed" and "User Label".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-06-10 10:46 AM
You are right! Just checked and after going down a wide blank space, the GPIO configurations appears. Thank you!
