Skip to content

Commit 7c4b0c2

Browse files
bjarki-andreasennashif
authored andcommitted
soc: nordic: nrf54h: bicr: fix incorrect scaling of lfrccal props
The lfrccal takes the two properties tempMeasIntervalSeconds and tempDeltaCalibrationTriggerCelsius which are in steps of 0.25. The bicrgen.py script incorrectly treated these values as steps of 1, so the actual values written to (and read from) bicr where scaled incorrectly. This commit fixes the scaling for those two props. Signed-off-by: Bjarki Arge Andreasen <[email protected]>
1 parent 155a371 commit 7c4b0c2

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

soc/nordic/nrf54h/bicr/bicrgen.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,8 @@ def from_raw(
391391
if calibration_enabled:
392392
return cls(
393393
calibration_enabled=calibration_enabled,
394-
temp_meas_interval_seconds=lfosc_lfrcautocalconfig["TEMPINTERVAL"],
395-
temp_delta_calibration_trigger_celsius=lfosc_lfrcautocalconfig["TEMPDELTA"],
394+
temp_meas_interval_seconds=lfosc_lfrcautocalconfig["TEMPINTERVAL"] * 0.25,
395+
temp_delta_calibration_trigger_celsius=lfosc_lfrcautocalconfig["TEMPDELTA"] * 0.25,
396396
max_meas_interval_between_calibrations=lfosc_lfrcautocalconfig["INTERVALMAXNO"],
397397
)
398398
else:
@@ -431,8 +431,10 @@ def to_raw(self, bicr_spec: ET.Element, buf: bytearray):
431431
"ENABLE", "Enabled" if self.calibration_enabled else "Disabled"
432432
)
433433
if self.calibration_enabled:
434-
lfosc_lfrcautocalconfig["TEMPINTERVAL"] = self.temp_meas_interval_seconds
435-
lfosc_lfrcautocalconfig["TEMPDELTA"] = self.temp_delta_calibration_trigger_celsius
434+
lfosc_lfrcautocalconfig["TEMPINTERVAL"] = int(self.temp_meas_interval_seconds / 0.25)
435+
lfosc_lfrcautocalconfig["TEMPDELTA"] = int(
436+
self.temp_delta_calibration_trigger_celsius / 0.25
437+
)
436438
lfosc_lfrcautocalconfig["INTERVALMAXNO"] = self.max_meas_interval_between_calibrations
437439

438440
def to_json(self, buf: dict):

0 commit comments

Comments
 (0)