Strange behaviour when writing to RTC calibration register
Hi everyone,
I am trying to trim the internal RTC of an STM32MP157 to run slightly faster. According to the reference manual, you need to set bits CALP and CALM[8:0] in RTC_CALR to do so.
Here is what I did (using devmem2:(
# Enable write access to RTC_CALR
./devmem2 0x5C004024 h 0xCA
./devmem2 0x5C004024 h 0x53
# Write calibration factor (CALP=1, CALM=327) to RTC_CALR
./devmem2 0x5C004028 h 0x8147Reading back the contents of register RTC_CALR returns 0x0147 instead of 0x8147, which corresponds to CALP=0.
Measuring the RTC deviation confirms that CALP does not get set to 1.
I am aware that using hwclock with adjtime can easily work around this issue. Yet not knowing what is going wrong here keeps bugging me...

