tnt has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/27894 )
Change subject: icE1usb fw/gpsdo: Attempt to recover from bad tuning
......................................................................
icE1usb fw/gpsdo: Attempt to recover from bad tuning
If we're in hold over mode and getting a bunch of invalid
frequency measurement despite a good fix, then we most likely
ended up on a bad tuning value and we need to recover by starting
from scratch.
Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com>
Change-Id: If8503a3eaf695e02a0ef0a3b6536de985d247c20
---
M firmware/ice40-riscv/icE1usb/gpsdo.c
1 file changed, 17 insertions(+), 4 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
tnt: Looks good to me, approved
diff --git a/firmware/ice40-riscv/icE1usb/gpsdo.c b/firmware/ice40-riscv/icE1usb/gpsdo.c
index c94a5ed..057490f 100644
--- a/firmware/ice40-riscv/icE1usb/gpsdo.c
+++ b/firmware/ice40-riscv/icE1usb/gpsdo.c
@@ -280,6 +280,7 @@
if (!gps_has_valid_fix()) {
/* No GPS fix, go to hold-over */
g_gpsdo.state = STATE_HOLD_OVER;
+ g_gpsdo.meas.invalid = 0;
return;
}
@@ -293,10 +294,22 @@
return;
}
} else {
- /* Count invalid measurements and if too many of
- * them, we go back to hold-over */
- if (++g_gpsdo.meas.invalid >= MAX_INVALID)
- g_gpsdo.state = STATE_HOLD_OVER;
+ /* Count invalid measurements */
+ if (++g_gpsdo.meas.invalid >= MAX_INVALID) {
+ if (g_gpsdo.state != STATE_HOLD_OVER) {
+ /* We go back to hold-over */
+ g_gpsdo.state = STATE_HOLD_OVER;
+ g_gpsdo.meas.invalid = 0;
+ } else {
+ /* We're in hold-over, with valid fix, and
+ * still get a bunch of invalid. Reset tuning */
+ g_gpsdo.tune.coarse = 2048;
+ g_gpsdo.tune.fine = 2048;
+
+ pdm_set(PDM_CLK_HI, true, g_gpsdo.tune.coarse, false);
+ pdm_set(PDM_CLK_LO, true, g_gpsdo.tune.fine, false);
+ }
+ }
/* In all cases, invalid measurements are not used */
return;
--
To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/27894
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-e1-hardware
Gerrit-Branch: master
Gerrit-Change-Id: If8503a3eaf695e02a0ef0a3b6536de985d247c20
Gerrit-Change-Number: 27894
Gerrit-PatchSet: 1
Gerrit-Owner: tnt <tnt(a)246tNt.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: tnt <tnt(a)246tNt.com>
Gerrit-MessageType: merged
tnt has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/27892 )
Change subject: icE1usb fw/gpsdo: Never use invalid measurements to feed loop
......................................................................
icE1usb fw/gpsdo: Never use invalid measurements to feed loop
Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com>
Change-Id: I9c7b81c6e2e600ed49ac766fa33df23747dd339e
---
M firmware/ice40-riscv/icE1usb/gpsdo.c
1 file changed, 4 insertions(+), 3 deletions(-)
Approvals:
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/firmware/ice40-riscv/icE1usb/gpsdo.c b/firmware/ice40-riscv/icE1usb/gpsdo.c
index cd9866c..7e3682f 100644
--- a/firmware/ice40-riscv/icE1usb/gpsdo.c
+++ b/firmware/ice40-riscv/icE1usb/gpsdo.c
@@ -286,10 +286,11 @@
} else {
/* Count invalid measurements and if too many of
* them, we go back to hold-over */
- if (++g_gpsdo.meas.invalid >= MAX_INVALID) {
+ if (++g_gpsdo.meas.invalid >= MAX_INVALID)
g_gpsdo.state = STATE_HOLD_OVER;
- return;
- }
+
+ /* In all cases, invalid measurements are not used */
+ return;
}
g_gpsdo.meas.invalid = 0;
--
To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/27892
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-e1-hardware
Gerrit-Branch: master
Gerrit-Change-Id: I9c7b81c6e2e600ed49ac766fa33df23747dd339e
Gerrit-Change-Number: 27892
Gerrit-PatchSet: 1
Gerrit-Owner: tnt <tnt(a)246tNt.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: tnt <tnt(a)246tNt.com>
Gerrit-MessageType: merged
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/27885 )
Change subject: paging: Submit up to 20 paging requests in a single work iteration
......................................................................
Set Ready For Review
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/27885
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I609fa67834b426456f48f6fb2acb601c5905f178
Gerrit-Change-Number: 27885
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Fri, 22 Apr 2022 13:39:00 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: tnt.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/27895 )
Change subject: icE1usb fw/gpsdo: Limit the fine tuning range
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/27895
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-e1-hardware
Gerrit-Branch: master
Gerrit-Change-Id: I2d9d348f5466f581b3d6d36c98847c47e2452f98
Gerrit-Change-Number: 27895
Gerrit-PatchSet: 1
Gerrit-Owner: tnt <tnt(a)246tNt.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: tnt <tnt(a)246tNt.com>
Gerrit-Comment-Date: Fri, 22 Apr 2022 12:56:57 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment