cancel
Showing results for 
Search instead for 
Did you mean: 

UART/USART Not working with gps module.

Isoclem
Associate II

Hello everyone !

(I don't speak english very well so sorry if i do some mistakes 🙂  )

So, I'm trying to connect the u-block neo6m to my STM32F446RE. The thing is when i'm trying to see datas with PuTTY, i get nothing. I'm new to this kind of things so I'm for sure forgetting something. So here are all the informations :

 

NEO6M ----- STM32F446RE

GRND on GRND

VCC on 5V

TX on D2 (PA10)

RX on D8(PA9)

 

These connections seems to be the right connections following user manuals and dashboard and all... : Sans titre 7.jpgSans titre 1.jpgSans titre 5.jpg

 

To achive all of this, i've been looking at some tutorials on ytb. Also, i attached my main and the programs+library i used to get datas out of the neo6m.

 

I checked the port of STLINK, in my case it's COM5. When connecting on Putty, the terminal is blank.

aaa.jpg

Baud rate 9600 is default rate of neo6m and i'm aware that i have to change the value on putty.

The neo6m led is blinking so i'm assuming it's transmitting datas.

I have updated ST-link firmware several times, and reinstalled drivers, because i thought the problem was from ST-LINK unable to communicate properly. As for the debugging i have no errors.

 

Thanks for you help in advance !

1 ACCEPTED SOLUTION

Accepted Solutions
Isoclem
Associate II

Hello,

So this morning I corrected all of the points everyone here pointed out and take into account all of your advices :

 

- UART2 was indeed not set up.

- UART1 was disabled at some point I don't know why  (though it was but I corrected it).

- Made a simple test in main.


And it worked fine !

I'm going to attach what I did to get everything working, so it could help someone in the future :

 

So after setting up UART2 and enabling UART1,

This was added in USER CODE 2 :

1.jpg

 

And in this in the infinite loop :

 

2.jpg

 

Thanks everyone for helping !

View solution in original post

6 REPLIES 6
SofLit
ST Employee

Hello,

Not sure your environment is clear here.

You are using PuTTY and you are connecting neo6m via UART to the F446. So here you need to UARTs for this.

Could you please clarify?

Try to share a sketch of what you are trying to do. 

 

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

The simplest initial test might be forwarding data from the GPS UART to the ST-LINK UART, so you can see the data as it arrives.

You should probably migrate to moving data received into a buffer on a continuous basis, and then periodically process / recover in the loop.

Currently using HAL_UART_Receive() which is a blocking function, and then clearing interrupts.

You can't use string functions on reception buffers directly, there needs to be NUL termination. ie buffer[700] = 0;

It's perhaps preferable to process NMEA sentences a line at a time, using the '$' to resynchronize the buffer, and recognize <CR> and/or <LF> to terminate the line.

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

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..

Hi !

 

I understand much better now that i read your answer, i just totally missed what i was supposed to do.

 

 

I want to collect GPS DATA in different variables that's my final goal. But first I wanted to see if I was able to correctly get datas from the neo6m. Thus, leading to the use of PuTTY to receive with a "HAL_Transmit(..)" the datas I have collected and "classified". But since I had no UARTs that let the transmission, i had nothing appearing on PuTTY.

So, I corrected this first problem.

Now I need to correct my code so i can display the datas on putty to see if everything works fine. 

 

 

I'm going to keep you updated, so that if people encounter the same problem they can easily solve it...

 

Thanks for the fast reply ! 🙂

Hi,

Thanks for your precious help. I'm going to try that and correct what i've done, i'll keep you updated.

 

 

Karl Yamashita
Lead II

So the NEO6M is using UART1 for Receiving/Transmitting. Then you want to use Putty to see what the NEO6M is sending?

I assume you want to use the VCP which is on UART2 to show data from the NEO6M using Putty? But you haven't set up UART2 because your screenshot shows PA2 and PA3 are not enabled.

 

In your code I see that you receive from UART1, but I don't see anywhere in your code that you try to transmit on any port?

Isoclem
Associate II

Hello,

So this morning I corrected all of the points everyone here pointed out and take into account all of your advices :

 

- UART2 was indeed not set up.

- UART1 was disabled at some point I don't know why  (though it was but I corrected it).

- Made a simple test in main.


And it worked fine !

I'm going to attach what I did to get everything working, so it could help someone in the future :

 

So after setting up UART2 and enabling UART1,

This was added in USER CODE 2 :

1.jpg

 

And in this in the infinite loop :

 

2.jpg

 

Thanks everyone for helping !