Attempting to test QWIIC u-blox SAM-M8Q GPS board with Redboard Turbo

I got a bright new shiny QWIIC GPS for Christmas that I’m trying to get working with my Redboard Turbo. Bringing up the example code from the Sparkfun ublox Library called Example15_GetDateTime.ino I immediately see that it uses ‘Serial’ all over the place. Usually this can be fixed for my Redboard Turbo by either doing a global search-and-replace to make ‘Serial’ become ‘SerialUSB’ in the sketch, or just add in the define:

#define Serial SerialUSB

Up at the top of the source. However, with the Sparkfun u-blox GPS library, I end up getting this error message regardless:

Arduino: 1.8.9 (Windows 10), Board: “SparkFun RedBoard Turbo”

Build options changed, rebuilding all

libraries\SparkFun_Ublox_Arduino_Library\SparkFun_Ublox_Arduino_Library.cpp.o: In function `SFE_UBLOX_GPS::processUBX(unsigned char, ubxPacket*)':

C:\Users\xxxx\Documents\Arduino\libraries\SparkFun_Ublox_Arduino_Library\src/SparkFun_Ublox_Arduino_Library.cpp:652: undefined reference to `Serial’

collect2.exe: error: ld returned 1 exit status

exit status 1

Error compiling for board SparkFun RedBoard Turbo.


Does this mean I have to manually go in and muck with the Library C++ source itself to fix all references to ‘Serial’ that might exist there? I’m hoping there is an easier answer for Redboard Turbo users.

Re-examining this, it looks like I only needed to comment out the one offending line in the GPS library file. After that, it compiles fine for my Redboard Turbo.

It is line 650 in the file SparkFun_Ublox_Arduino_Library.cpp:

//Serial.println(F(“processUBX: counter hit MAX_PAYLOAD_SIZE”));

What’s strange is that I have another very large sketch that compiled fine while referencing this library for the GPS module, with this line still present, but it ended up having some strange behaviors not even related to GPS.