cancel
Showing results for 
Search instead for 
Did you mean: 

UART Receive issue

EtienneLJ
Associate III

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

31 REPLIES 31

Why ST couldn't have used a symbol for the vector table basis into SCB->VTOR is honestly beyond me...

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Karl Yamashita
Lead III

Your code you've posted is working on my Nucleo-G431B just fine.

docklightcapture.png

With the exception is that you should use strlen instead of guessing the length of the string. I was getting some null characters when i sent SONAR. 

usestrlen.png

Also remove the flag as i was getting double "msg_available"

removeflag.png

Now you're probably wondering why I was able to get your code to work? I saw the link to the tutorial and nowhere did it mention to enable the NVIC interrupt. How ST left that vital information out is beyond me?

 

enableinterrup.png

 

Tips and Tricks with TimerCallback https://www.youtube.com/@eebykarl
If you find my solution useful, please click the Accept as Solution so others see the solution.