Hello everyone i am trying to integrate nRF Calendar example with the nRF5 Thread MQTTSN example. In my application, I will get the date and time source from the MQTT-SN JSON payload. I am able to parse the date and time and pass it as an argument to nrf_cal_set_time function. When parsing and passing these values to the function works well and my epoch time gets updated as per the passed value. But the problem arises when I try to re-update the epoch time. When I parse a new date and time and pass it as arguments 2nd or 3rd time the application crashes if the duration of the date-time update is very less. If the duration is more there is no issue in updating the epoch time.
Here is the debug log, I am publishing the data every 5 seconds here. So if I calculate even after 20 seconds I am not able to update the date-time successfully.
Console Output
<info> app: MQTT-SN event: Client has successfully published content.
Date : 16/11/1995 ##Epoch time updated succesfully here
Time : 1:12:00
T: 11/16/95 - 01:12:55
CT: 11/16/95 - 01:12:00
<info> app: MQTT-SN event: Client received content.
<info> app: Topic ID: 1266
<info> app: Length: 82
<info> app: MQTT-SN event: Client has successfully published content.
<info> app: MQTT-SN event: Client has successfully published content.
<info> app: MQTT-SN event: Client has successfully published content.
<info> app: MQTT-SN event: Client has successfully published content.
Date : 16/11/2021 #Recieved new epoch time data
T: 11/16/21 - 01:12:16 #epoch time set and program crashed
CT: 11/16/21 - 01:12:00
<info> app: MQTT-SN event: Client received content.
<info> app: Length: 82
<error> app: ASSERTION FAILED at /home/dnk121/Nikhil/Project/S-Node/SDK/Thread_SDK/nRF5_SDK_for_Thread_and_Zigbee_v4.1.0_32ce5f8/components/thread/utils/thread_utils.c:331
<error> app: ASSERTION FAILED at /home/dnk121/Nikhil/Project/S-Node/SDK/Thread_SDK/nRF5_SDK_for_Thread_and_Zigbee_v4.1.0_32ce5f8/components/thread/utils/thread_utils.c:331
Line 331 indicates " ASSERT((original_fpscr & 0x7) == 0);}"
A similar sort of issue arrives when I try to stop the app timer configured in repeated mode.
I am using two app timers one in repeated mode and one in single-shot mode. Repeated app timer will publish data till the single-shot timeout callback handler stops the repeated app timer. It works fine if the repeated app timer is stopped by a single-shot timer. But if I pass a command to stop the repeated timer in between (before the single shot timer expires), it also gives me the same error.
Can anyone please help me to resolve this issue?