cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 UART/USART not working with GPS module (MAX-M10M )

amirshn
Associate II

Hi,

I have connected a MAX-M10M  module to an STM32H7  MCU ( it's custom board) by UART port. I am able to send data to GPS module and also receive config data of it but not able to receive NMEA packets. I only receive the first byte and then the HAL_STATUS of my HAL_UART_RECEIVE function switches to TIMEOUT.( I am using MX CUBE for pin initialization). I have tried blocking mode, IT and DMA, no luck.

Any help would be highly appreciated.

 

 

4 REPLIES 4
Pavel A.
Evangelist III

Which H7?

What UART? What PINS?

What timeout are you setting? You can get noise, or overrun errors. You can lose data if inattentive as it keeps flowing.

Would be best to use the IT function, filling a buffer, or parsing lines of NMEA data

Here I used HAL to initialize, and then went more register level for interrupts and data handling

https://github.com/cturvey/RandomNinjaChef/blob/main/f746g_disco_gps.c

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

Let's check the GPS module to be sure it's sending NMEA packets.

Have you checked with oscilloscope to see if you are getting full NMEA packets?

Or try connecting a USB<>UART adapter to view what the GPS is sending.

 

If it is sending full packets, then start showing your code.

Don't worry, I won't byte.
TimerCallback tutorial! | UART and DMA Idle tutorial!

If you find my solution useful, please click the Accept as Solution so others see the solution.

Forwarding the data stream can help for quick diagnostics as to what's happening.

https://github.com/cturvey/RandomNinjaChef/blob/main/f746g_disco_fwd.c

https://github.com/cturvey/RandomNinjaChef/blob/main/f411_usart_fwd.c

As I recollect the MAX-M10M outputs at 9600 8N1, other M10 devices are 38400 8N1

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