Repository navigation
gnss: auto-detect L5 receiver with separate config arrays - #153
Conversation
97fb191 to
5aea3d2
Compare
|
@nbourdau please take a look |
nbourdau
left a comment
There was a problem hiding this comment.
Could you split up this commit into smaller and more atomic commits?
Being a big one merging several changes make it hard to review properly and quickly. Having the changes split gives the occasion in the commit message of each to explain at least why each one is needed and make clear by looking at each one what code change is relevant for which semantic change.
A natural split is hinted in your current commit message (the "also adds" list + auto-detect L5), but another split could be chosen.
5aea3d2 to
c05cd90
Compare
|
@nbourdau done, split in 5 different commits, but kept 1 pull request |
nbourdau
left a comment
There was a problem hiding this comment.
Please ensure that all commits compile
| @@ -90,18 +120,24 @@ UBLOXCFG_KEYVAL_t *get_default_value_from_config(int *nKv, int major, int minor) | |||
| char current_line[128] = {}; | |||
|
|
|||
| { | |||
| size_t config_length = default_configuration_size; | |||
|
|
|||
| // If version >= to 2.20 apply 2.20 ubx config | |||
| if ((major == 2 && minor >= 20) || (major >= 3)) | |||
| /* Select config array based on firmware version and band mask */ | |||
| const char (*cfg_array)[128]; | |||
| size_t config_length; | |||
|
|
|||
| if (bands & GNSS_BAND_L5) { | |||
| cfg_array = default_configuration_f9t_10b; | |||
| config_length = default_configuration_f9t_10b_size; | |||
| } else if ((major == 2 && minor >= 20) || (major >= 3)) { | |||
| cfg_array = default_configuration_v220; | |||
| config_length = default_configuration_v220_size; | |||
| } else { | |||
| cfg_array = default_configuration; | |||
| config_length = default_configuration_size; | |||
| } | |||
|
|
|||
| for (size_t i = 0; i < config_length; i++) | |||
| { | |||
| if ((major == 2 && minor >= 20) || (major >= 3)) | |||
| strncpy(current_line, default_configuration_v220[i], 127); | |||
| else | |||
| strncpy(current_line, default_configuration[i], 127); | |||
| strncpy(current_line, cfg_array[i], 127); | |||
| IO_LINE_t line = { .line = current_line }; | |||
There was a problem hiding this comment.
This makes the commit not to compile, this part must be introduced later (with "gnss-config: add band mask parameter to config selection" commit)
| if (bands & GNSS_BAND_L5) { | ||
| cfg_array = default_configuration_f9t_10b; | ||
| config_length = default_configuration_f9t_10b_size; |
There was a problem hiding this comment.
This must be introduced no before "f9_defvalsets: add F9T-10B (L1+L5) config array" commit
|
|
||
| bool check_gnss_config_in_ram(RX_t *rx, UBLOXCFG_KEYVAL_t *allKvCfg, int nAllKvCfg); | ||
| UBLOXCFG_KEYVAL_t *get_default_value_from_config(int *nKv, int major, int minor); | ||
| UBLOXCFG_KEYVAL_t *get_default_value_from_config(int *nKv, int major, int minor, int bands); |
There was a problem hiding this comment.
Missing src/gnss.c update for use of get_default_value_from_config
rxGetConfig() internally checks if there's room for another 64-item batch after receiving data: (totNumKv + 64) > maxKv. This means maxKv must always be at least received_items + 64, otherwise the call fails with "Too many config items". Fix by using a 128-element result buffer for batch reads of 64 keys at a time. Also simplify check_gnss_config_in_ram() to read only the keys we need (from the config array) rather than using the ALL wildcard which can overflow on receivers with many config items.
The ZED-F9T-10B supports L1+L5 signals instead of L1+L2. Add a dedicated config array (default_configuration_f9t_10b) with the correct L5 signal keys: GPS_L5_ENA, GAL_E5A_ENA, QZSS_L5_ENA = true BDS_B2_ENA, GLO_L2_ENA = false (no L5 equivalent)
Add GNSS_BAND_L1/L2/L5 flags and pass a band mask to get_default_value_from_config() so it selects the correct config array for the detected receiver model. At startup, probe CFG-SIGNAL-GPS_L5_ENA from receiver RAM. If L5 is enabled, load the F9T-10B config array instead of the standard L2 config. This ensures an already-configured L5 receiver won't trigger unnecessary hardware resets on restart. As fallback, if L5 wasn't detected but the L2 config is rejected by the receiver, reload with L5 config and retry.
Always enable UBX-RXM-RAWX on UART1 (moved out of RTCM gate) and parse it every second to count L1/L2/L5 signals. Classification uses both gnssId and sigId per the u-blox UBX-RXM-RAWX signal numbering table: GPS (0): sigId 0,1=L1 3,4=L2 6,7=L5 SBAS (1): sigId 0=L1 3=L5 Galileo (2): sigId 0,1=E1(L1) 3,4=E5a(L5) 5,6=E5b(L2) BeiDou (3): sigId 0,1=B1I(L1) 2,3=B2I(L2) 5,6=B1C(L1) 7=B2a(L5) QZSS (5): sigId 0,1=L1 4,5=L2 8,9=L5 GLONASS (6): sigId 0=L1OF 2=L2OF Signal counts are included in the per-second log line: signals L1=N L2=N L5=N
c05cd90 to
6c25739
Compare
|
Thanks for the feedback verified each commit |
|
Thank you @nbourdau please issue a release when you can we don't have pending updates. |
The F9T-10B supports L1+L5 but not L2. At startup, probe the receiver's RAM for CFG-SIGNAL-GPS_L5_ENA to detect the receiver model:
The correct config array is selected before comparison, so an already- configured receiver won't trigger unnecessary hardware resets.
Also adds:
L1/L5 receiver:
L1/L2 receiver (L1 antenna):