RTC alarm problem

hi, we are having problem with RTC alarm. The accuracy of alarm is changing after each callback. The time interval between callbacks is decreasing. here is the code that sets up RTC alarm, when callback occur, recall set alarm with period, default period is 10 second, and our log:

    def __set_rtc(self, period, callback):
        self.__business_rtc.enable_alarm(0)
        if callback and callable(callback):
            self.__business_rtc.register_callback(callback)
        atime = utime.localtime(utime.mktime(utime.localtime()) + period)
        alarm_time = (atime[0], atime[1], atime[2], atime[6], atime[3], atime[4], atime[5], 0)
        _res = self.__business_rtc.set_alarm(alarm_time)
        log.debug("alarm_time: %s, set_alarm res %s." % (str(alarm_time), _res))
        return self.__business_rtc.enable_alarm(1) if _res == 0 else -1

log.txt (58.3 KB)

May I ask which module you are using? And what is the firmware version?

Hi, we are using DEVICE_FIRMWARE_NAME: EC800K-CNLC, DEVICE_FIRMWARE_VERSION: EC800KCNLCR07A03M04_OCPU_QPY.
Log file attached above.

hi,Linh
I can reproduce your issue. Let me confirm with the internal team.
May I ask for your project information? This will help me track the issue more effectively.

hi,Linh

it might be related to the alarm clock time. I suggest you can set the alarm clock time longer, such as 30 minutes, and see if the error is the same. Thank you.

We tried different time intervals, and got the same error. We monitored and noticed that the alarm occurred earlier than the set time interval.