sparkfun/SparkFun_Ublox_Arduino_Library

Different layer defaults when using newCfgValSet instead of setVal

markuckermann opened this issue · 4 comments

Subject of the issue

Just a heads up really, I'v been caught out by the defaults for newCfgValset...() being different to setVal(). It's just VAL_LAYER_BBR instead of VAL_LAYER_ALL so the settings don't take effect.

The defaults were recently changed in #134 and are set here:

uint8_t newCfgValset8(uint32_t keyID, uint8_t value, uint8_t layer = VAL_LAYER_BBR); //Define a new UBX-CFG-VALSET with the given KeyID and 8-bit value
uint8_t newCfgValset16(uint32_t keyID, uint16_t value, uint8_t layer = VAL_LAYER_BBR); //Define a new UBX-CFG-VALSET with the given KeyID and 16-bit value
uint8_t newCfgValset32(uint32_t keyID, uint32_t value, uint8_t layer = VAL_LAYER_BBR); //Define a new UBX-CFG-VALSET with the given KeyID and 32-bit value

Is this on purpose? I'd suggest having the same defaults across the board.

Your workbench

  • Teensy 3.6 and SFE GPS-RTK2 but it shouldn't matter.

Steps to reproduce

myGPS.newCfgValset8(CFG_MSGOUT_RTCM_3X_TYPE1005_I2C, 1); 
myGPS.addCfgValset8(CFG_MSGOUT_RTCM_3X_TYPE1097_I2C, 1);
myGPS.sendCfgValset8(CFG_MSGOUT_RTCM_3X_TYPE1230_I2C, 10); 

Expected behavior

Changes saved to RAM + other layers

Actual behavior

Changes saved to BBR only

Hi Mark (@markuckermann ),

Thanks for spotting this! I'll change it...
I'll leave this issue open until the fix is in...

Meanwhile, you can work around this by using:
myGPS.newCfgValset8(CFG_MSGOUT_RTCM_3X_TYPE1005_I2C, 1, VAL_LAYER_ALL);
etc.

Best wishes,

Paul

The fix is in... On the release_candidate branch. I'll leave this open until it gets merged into master.
0ef7394

Just realised it's explained in the example, but not very well.

//setValueSuccess &= myGPS.newCfgValset8(CFG_MSGOUT_RTCM_3X_TYPE1005_I2C, 1, 7); //Set this and the following settings into Flash/RAM/BBR instead of BBR

The comment suggests that you need to change the layer to have it updated in RAM.

So as part of this fix, the example ought to be slightly updated too. @PaulZC