Closed AndronikosKostas closed 1 month ago
GNSS Troubleshooting
Date: 10 Μαΐ 2024
Check the STM Cube MX config details
Check which pins you need to enable to turn the GNSS on. HAL_GPIO_WritePin(P5V_RF_EN_GPIO_Port, P5V_RF_EN_Pin, GPIO_PIN_SET);
check if you have 3.3V at TP511. : 3.3V
Check the RST pin of the GNSS : 3.3V
It must be HIGH to have a normal operation. So:
HAL_GPIO_WritePin(GNSS_RSTN_GPIO_Port, GNSS_RSTN_Pin, GPIO_PIN_SET);
Check the PIN_20 of the GNSS module ( TX ). In what state is it? When idle, this pin is HIGH. : 3.3V , 2.84V ( με πολύμετρο )
To GNSS στέλνει κομπλε απλώς λάθος δεδομένα
Connect the antenna
Disconnect the antenna
From GP ( GPS ) we go to GN with the connection of the antenna. GN stands for GLONASS satellites.
Flash the code that has only the GNSS task on.
We don’t get any useful information Check the serial communication by sending a simple command. Try the system reset.
Does not return the ACK...
Output :
0xA0 | 160 | Start of frame bytes ( 2 bytes ) |
0xA1 | 161 | |
0 | payload length | |
3 | payload length | |
2 | payload bytes ( message ID ) | |
2 | payload bytes | |
0 | payload bytes | |
2 | CS | |
0x0D | 13 | End of frame bytes ( 2 bytes ) |
0x0A | 10 |
it seems to be correct
Nothing happens
**
Status: We saw that with a simple function that sends a message that requests the software version of the GNSS does not return an ACK back to us. We tried to receive the ACK with the Interrupt mode. The logic we had was to send each second the message and try to catch the response of the GNSS in the UART callback. Also, we tried the same code but with different baud rates.
Screenshots of Code :
STMCUBEMX CONFIGURATIONS :
Try sending the same message but perform reception with DMA ( idle ) and see if you catch any ACK.
Doc: https://github.com/PeakSat/comms-software/issues/10
Results :
There is an issue with printing…
Here we will only print if we receive size = 9 …
As you can see we got a NACK which is not good…maybe we sent wrong message…
0xA0 | 160 | Start of frame bytes ( 2 bytes ) |
0xA1 | 161 | |
0 | payload length | |
2 | payload length | |
132 | NACK | |
2 | ID of requested message | |
134 | CS | |
0x0D | 13 | |
0x0A | 10 | End of frame bytes ( 2 bytes ) |
We corrected the message without using the classes and it succeeded
Now we got a message with size = 30
It seems to be working because we got ACK (131) in the first frame and in the second frame we got the software version….SIUUUUUU
160 | START OF FRAME |
161 | START OF FRAME |
0 | PL |
14 | PL ( 14 BYTES) |
128 | MESSAGE ID |
0 | SOFTWARE TYPE = RESERVED |
0 | KERNEL VERSION |
3 | KERNEL VERSION |
0 | KERNEL VERSION |
1 | KERNEL VERSION |
0 | ODM VERSION |
1 | ODM VERSION |
7 | ODM VERSION |
32 | ODM VERSION |
0 | REVISION |
23 | REVISION |
1 | REVISION |
19 | REVISION |
161 | CS |
13 | END OF FRAME |
10 | END OF FRAME |
The above looks nice if you take a look at the below image which is what we should get as an answer
Measure the voltage at RF_IN : 3.3V
Check the UART messages if you connect the antenna
The only thing that changes is the size of the incoming message ( 321 bytes ) but again zeros …
Code: commit 621255d2e44729ee7dd2e8dcc73f626dcbfe0870
commit on GitHub: 1 parent 1ea421b commit 621255d ( Commit Name: successful control of the GNSS via UART5 )
Try to send messages to the GNSS by using the classes. Use the GNSS.cpp , hpp files.
The code is working nominally without the line taskHandle = xTaskGetCurrentTaskHandle();
The above response corresponds to commit : commit f4d2460b700fee5400274ee767730fe8024185c5
“ send messages to the tx periodically to check if it is alive and print the response ”**
Status :
Yesterday I was playing around with task notifications and ISR and was trying to find out why I cannot print (LOG_DEBUG) the messages that are coming from GNSS.
Try to add also a mutex
Doc : https://www.freertos.org/RTOS_Task_Notification_As_Binary_Semaphore.html
Doc : https://www.freertos.org/Embedded-RTOS-Binary-Semaphores.html
The above did not work…Also, neither a simple variable that would work like semaphore worked.
The code :
Commit Number: ca59879321de423b7ddaebbc1ead3e356b5249a3
The encouraging fact till now was that after sending the message “get the GPS ephemeris” I got the following message
Notice that one sentence starts with GPGSV, where GP is the abbreviation for the GPS satellites. Check the following image.
36 in ASCII is the char $. As you can see, the GNSS automatically generates 9 messages, which contain 460 bytes in total ( this test is without the active antenna ):
1 : 0 - 78 : 79 bytes
2 : 119 - 79 + 1 = 41 bytes
3 : 160 - 120 + 1 = 41 bytes
4 : 201 - 161 + 1 = 41 bytes
5 : 242 - 202 + 1 = 41 bytes
6: 298 - 243 + 1 = 56 bytes
7 : 377 - 299 + 1 = 79 bytes
8: 417 - 378 + 1 = 40 bytes
9 : 459 - 418 + 1 = 42 bytes
Test with active antenna
Here we have six messages which contain 320 bytes ( less bytes )
1 : 76 bytes
2 : 128 - 76 + 1 = 53 ...
Examine the information contained within these bytes ( six messages )
Configure NMEA talker ID
mode changed to GP but still, we have zeros …
Just send this :
uint8_t config_nmea_id[10] = {0xA0,0xA1, 0x00, 0x03, 0x4B, 0x00, 0x01, 0x4A, 0x0D, 0x0A};