UART Receive issue
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-10-30 3:37 AM
Hello,
I'm struggling with a really strange issue. I'm trying to make UART RX working on a STM32G4 custom board.
I've followed the UART Interrupt tutorial. (https://wiki.st.com/stm32mcu/wiki/Getting_started_with_UART)
I've tested it with Nucleo-G431RB and it works fine.
Now I'm running the exact same code on my custom board and I have nothing, when using the debugger I can see that the interrupt is never fired. I've check hardware connections and everything seems OK.
I've also tried to implement UART_Receive by polling mode => I can see in the debugger that characters are received, so Hardware is OK.
Can someone help me with this issue ?
Thanks
Solved! Go to Solution.
- Labels:
-
STM32G4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-10-30 8:22 AM
How do I check parity / framing ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-10-30 8:24 AM
No failures are returns from HAL_UART_xxx() functions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-10-30 8:35 AM
Would suggest inspecting LPUART1->ISR
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
2023-10-30 8:48 AM
What should I have in this register ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-10-30 8:55 AM
So ISR register goes from 0x6000d0 to 0x6000f8 after sending on RX and debbug stop.
Then after rerun and stop debbug I get 0x6000d8.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-10-30 7:44 PM - edited 2023-10-30 7:47 PM
Here's the Reference Manual, explains the bit flags. The 8 (bit 3) is the Overrun Error
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
2023-10-31 1:34 AM - edited 2023-10-31 1:34 AM
Ok but what can be the root cause ? I seems to be a software, as I uderstand it. (SO it does not explain why it is working on the nucleo board)
When I send only one char the ORE is not set but interrupt is still not triggered.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-10-31 1:58 AM
> Ok but what can be the root cause ?
ORE is set when two or more bytes arrive to the receiver without the program reading them out from Rx data register.
There may be noise, e.g. if you connect connectors, or there may be bad ground connection... Oscilloscope is your friend.
> When I send only one char the ORE is not set but interrupt is still not triggered.
If you observe the UART Rx data register in debugger, the RXNE flag gets cleared... debugging is intrusive.
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-10-31 2:20 AM - edited 2023-10-31 2:28 AM
> There may be noise, e.g. if you connect connectors, or there may be bad ground connection... Oscilloscope is your friend.
Here's a picture of the signal received on RX pin.
Signal seems OK.
> If you observe the UART Rx data register in debugger, the RXNE flag gets cleared...
I don't get into the interrupt handler with only one char and without debugger
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-10-31 3:47 AM - edited 2023-10-31 3:50 AM
So I've changed from LPUART1 to USART3 and now I don't get the ORE error when sending a char. But still no interrupt fired...
EDIT : ORE error with multiple chars as with LPUART1
