Can't communicate properly with X-NUCLEO-GNSS1A1
Hi, as the title said, I am having the hard time communicating with X-NUCLEO-GNSS1A1
The GNSS module is communicate via USART (can't communicate via I2C, but this is the other problem)
the code is written as follow:
void usart_setup(void)
{
// some setup .....
}
volatile char gnss[180];
void gnss(void* args __attribute__((unused)))
{
for(;;)
{
int i = 0;
for (char a = usart_recv_blocking(USART1); a != '\r' || i < 180; a = usart_recv_blocking(USART1), ++i)
{
gnss[i] = a;
}
}
}
void usart_status_updater(TimerHandle_t xTimer)
{
printf("%s\n\r", gnss);
}
int main(void)
{
usart_send_stat_timer = xTimerCreate("USART_TIM", STATUS_UPDATE_PRD, pdTRUE, (void *) 0, usart_status_updater);
xTaskCreate(gnss, "gnss", 1024, NULL, configMAX_PRIORITIES - 1, NULL);
xTimerStart(usart_send_stat_timer, 0);
vTaskStartScheduler();
}For some reason, I cannot use HAL/LL library, and I'm using opencm3, but I think this is not the reason, also, there is some freeRTOS stuff inside, but it also should not be the reason, the result is shown in the picture

As one can see, the command of the message doesn't show properly, e.g. "$SA" instead of $GPGSA "", having a larger buffer does not solve the problem. What should I do to fix the problem?
I have read the src code in CubeMS, and it is really hard to understand it, also there is a little example online, so I am literally in the dark, the software manual is not that clear IMO, even though I know those command, but I simply can't produce expected result.
This is only one of the problems, any advice or idea will be appreciated, thank you
