Posts by P&Tconnected

    Hi Mike,


    I am sorry, most of the configuration of rauc did a colleague, especially the part with uboot. I know that this project has a
    very good documentation and is working reliably but I was not directly involved in the implementation.


    Kind regards,

    Stefan

    I went through the SNVS section in the reference manual and came to the same conclusion. The RTC in HP domain should be synchronized with the RTC in LP domain. It seems also to be the intended way to do this, because the LPRTC counter registers are not even documented in the reference manual….


    However, your hint with the rtc-snvs.c driver helped me to solve the problem. I took the memory offsets from this driver and was able to access the LPRTC counter registers directly. Now, everything is working as intended.

    Thank you for your help.


    Kind regards,

    Stefan

    Thank you for your response. I disabled the external RTC (pcf8563) and enabled the internal RTC (snvs-rtc-lp). Now I have only /dev/rtc0 available and can read/ write time with the hwclock command. This is working fine, but I still have problems on the cortex-m4 side when I try to read the current rtc value.


    In my understanding, it should now be possible to use the cortex-m4 and read the SNVS_HP Real-Time Counter Registers (SNVS_HPRTCMR and SNVS_HPRTCLR) to get the current time. But the SNVS_HP RTC is not enabled and the counter registers do not change.


    I saw, that I activated in the device tree the snvs-rtc-lp (RTC_LP?) and try to read from RTC_HP. Are this two different RTC’s?

    Kind regards,

    Stefan

    Short update.

    I found the snvn_rtc section in imx6sx.dtsi and enabled the rtc. Now I see in the kernel log during bootup the entry “snvs_rtc 20cc000.snvs:snvs-rtc-lp: setting system clock to 2021-08-30 14:27:21 UTC (1630333641)”. Looks like snvs_rtc is now working as hardware clock, but when I change the system time in Linux, it has no influence on the cortex-m4 application.

    Is the Linux system time not synchronized with SNVS_RTC?


    Kind regards,

    Stefan

    Hello F&S Team,


    We would like to use the cortex-m4 for time synchronization. The idea is to read the Linux system time and generate a hardware pulse at the beginning of every second.


    So I created a small test application for the cortex-m4 and was able to enable the SNVS_HP RTC, read the current time from the SNVS_HPRTCMR and SNVS_HPRTCLR register and generate a pulse on a gpio pin . This worked so far, but it seems that the time from SNVS_RTC is not equal to our current Linux system time.


    In the kernel log I do not see any hint, that SNVS_RTC is used by Linux. Do I need to enable this in the device tree first? Am I right, that it is possible to read the current Linux system time in the cortex-m4?


    Kind regards,

    Stefan