Hardware Serial returning gibberish.
Posted: Tue Mar 26, 2024 10:02 pm
I have a GPS connected to my STM32F401CC.
The hardware Serial is returning nonsense into the program.
I know the GPS is working at 57600 Baud as I have a USB-Serial adapter and it is producing the NEMA strings as expected. However, when I read the serial using the STM32, I get nothing but gibberish forwarded to the PC.
Code for Reference:
Any help is much appreciated!
The hardware Serial is returning nonsense into the program.
I know the GPS is working at 57600 Baud as I have a USB-Serial adapter and it is producing the NEMA strings as expected. However, when I read the serial using the STM32, I get nothing but gibberish forwarded to the PC.
Code for Reference:
Code: Select all
void position_task(void* args)
{
HardwareSerial gpsSerial(UART2_RX, UART2_TX);
gpsSerial.begin(57600);
for(;;)
{
while(gpsSerial.available() > 0){
Serial.print(gpsSerial.read());
}
}
}