@@ -5219,26 +5219,41 @@ uint8_t SFE_UBLOX_GNSS::sendCfgValset8(uint32_t key, uint8_t value, uint16_t max
5219
5219
// Layer number can be 0 (RAM) or layer 7 (Default)
5220
5220
void SFE_UBLOX_GNSS::downloadDeviceConfig (Stream &downloadPort, uint8_t layerNumber, uint16_t maxWait)
5221
5221
{
5222
- for (int x = 0 ; x < 18 ; x++)
5222
+ for (int x = 0 ; x < 18 ; x++)
5223
5223
{
5224
- getVal (0x0FFF0000 , layerNumber, x * 64 , maxWait); // Advance by 64 keys each time
5224
+ // KeyID of 0x0FFF0000 is magic config read key. Found using u-center and downloading Receiver Configuration from Tools menu.
5225
+ // Advance by 64 keys each time
5226
+ if (getVal (0x0FFF0000 , layerNumber, x * 64 , maxWait) != SFE_UBLOX_STATUS_SUCCESS)
5227
+ {
5228
+ // Try again
5229
+ if (getVal (0x0FFF0000 , layerNumber, x * 64 , maxWait) != SFE_UBLOX_STATUS_SUCCESS)
5230
+ {
5231
+ if (_printDebug == true )
5232
+ {
5233
+ _debugSerial->println (F (" downloadDeviceConfig: Failed to obtain config data." ));
5234
+ }
5235
+ }
5236
+ }
5225
5237
5226
5238
// All lines start with a VALGET
5227
5239
downloadPort.print (F (" CFG-VALGET - 06 8B " ));
5228
5240
5229
5241
// Pretty print the response length
5230
5242
uint16_t responseLength = packetCfg.len ;
5231
- if ((responseLength & 0xFF ) < 0x10 ) downloadPort.print (F (" 0" ));
5243
+ if ((responseLength & 0xFF ) < 0x10 )
5244
+ downloadPort.print (F (" 0" ));
5232
5245
downloadPort.print (responseLength & 0xFF , HEX);
5233
5246
downloadPort.print (F (" " ));
5234
- if ((responseLength >> 8 ) < 0x10 ) downloadPort.print (F (" 0" ));
5247
+ if ((responseLength >> 8 ) < 0x10 )
5248
+ downloadPort.print (F (" 0" ));
5235
5249
downloadPort.print (responseLength >> 8 , HEX);
5236
5250
5237
5251
// Pretty print the payload
5238
- for (int x = 0 ; x < 32 ; x++)
5252
+ for (int x = 0 ; x < 32 ; x++)
5239
5253
{
5240
5254
downloadPort.print (F (" " ));
5241
- if (payloadCfg[x] < 0x10 ) downloadPort.print (F (" 0" ));
5255
+ if (payloadCfg[x] < 0x10 )
5256
+ downloadPort.print (F (" 0" ));
5242
5257
downloadPort.print (payloadCfg[x], HEX);
5243
5258
}
5244
5259
downloadPort.println ();
0 commit comments