Hey Jane,
Sorry, I must have made a mistake - no freezing without the GPS. Recent testing seems to show the following info - the device will run indefinitely even when GPS is connected BUT not long after the GPS connects to satelites and starts data - the connection fails.
Result from your suggested test: IMU and SD logging at ~185 Hz with the SAM-M10Q physically connected and holding a satellite fix throughout, but with all GPS initialisation and reading calls removed and the library not included.
Ran 1,901 seconds (32 minutes), 351,852 rows, no stall. Stopped it myself.
With GPS calls enabled it stalls within 17–200 seconds of acquiring a fix, depending on navigation rate. It never stalls before a fix is acquired, and never stalls with the GPS physically unplugged.
So it is not the extra hardware on the power or I2C bus. It is something during GPS communication.
One lead from the SAM-M10Q datasheet, section 5.2: the module uses I2C clock stretching, holding SCL low for up to 20 ms. Does the nRF52840 TWI peripheral handle that reliably? It would fit a hang mid-transaction makes everything on the bus unreachable, including the IMU, so the sketch blocks and the LED stops.
I have tested at 100 kHz and 300 kHz with no improvement. The datasheet specifies Fast-mode only, 320 kHz maximum, Standard-mode unsupported.
Reproduced with SparkFun’s own unmodified example.
Ran Example1_PositionVelocityTime from the SparkFun u-blox GNSS v3 library. Only changes: added the Adafruit TinyUSB include (required for Serial on this board), set the navigation rate to 10 Hz, and added satellite count and uptime to the printed output. No SD card, no IMU, no other libraries.
It stalled at 47 seconds with 18 satellites. Serial output stops dead, no error.
Summary of all testing:
- SparkFun’s own example, 10 Hz: stalls at 47 s after fix
- My logging sketch, 10 Hz: 17–200 s after fix
- My logging sketch, 1 Hz: 680 s after fix - still cutting out
- IMU and SD logging, GPS physically connected and holding a fix but never addressed in code: 1,901 seconds, no stall
- GPS physically unplugged: no stall
- Never stalls before a fix is acquired
- Same result at 100 kHz and 300 kHz I2C, two different Qwiic cables, both USB and battery power
The fault is reproducible with SparkFun’s own library and example on SparkFun hardware. It appears to be in the GPS communication path.