This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BQ32002: Soft reset issue

Part Number: BQ32002

Hi,

 I have a RTC application which sets the time using RTC_SET_TIME ioctl call in BQ32002 RTC chip. After executing the app, the time is being set and I am reading it using RTC_RD_TIME which is working fine. But once the date is set and then I do a soft reboot of the board, next time if I read the date , it is showing an old value. But after a hard reboot the updated value is being displayed.

I tried soft reboot after setting the date through command line using date -s and hwlock -w  comands. In this case also date is being updated and displayed as expected without any issue even after a soft reboot. I  tried an ioctl flush and a system call of hwclock -w from the app after the RTC_SET_TIME ioctl but the value are not being retained after soft reboot. This happens only in soft reboot.

Why this behaviour? Any help would be appreciated.

  • What is the difference between the soft reboot and hard reboot?

    Time and date are set in the same function RTC_SET_TIME, correct?

    The date is incorrect after soft reboot, but is the time correct?

    It is good that using the date -s commands appears to properly set the date.

    The command hwclock -w will set the time, but does it also set the date (before the soft reboot)?

    Kind regards,
    Lane

  • Hi Lane

    What is the difference between the soft reboot and hard reboot?

    : Hard reboot is done by toggling the main power switch and soft reboot is done by executing the command  "reboot".  But I know you would be expecting the code wise difference between both which I am checking now.

    Time and date are set in the same function RTC_SET_TIME, correct?

    : Yes

    The date is incorrect after soft reboot, but is the time correct?

    : Both date and time is incorrect after soft reboot.

    The command hwclock -w will set the time, but does it also set the date (before the soft reboot)?

    : The date command is used to set the date and time together and then syncing the hw clock to system clock using hwclock -w

    Kind Regards,

    Anjali

  • Hi Anjali,

    Thank you for the information. 

    One thing to note is that the time-keeping registers need one second to update after supply switchover. If you are operating off of the backup supply and then reapply VCC, make sure that you are not reading too quickly. 

    Looking forward to more info about your soft reboot and hard reboot.

    • Are you operating from the backup supply when you issue the hard reboot? If not, I would not expect you to read back the correct updated value.
    • After soft reboot, I would expect you to read back the correct updated value.

    Kind regards,
    Lane

  • Hi Lane,

      

    • Are you operating from the backup supply when you issue the hard reboot? If not, I would not expect you to read back the correct updated value.

             :  I tried with and without backup supply when issuing the hard reboot. Both the cases the date and time is updated as expected when checked 

              Soft reboot also I tried with and without backup supply, but the issue persists.

            Since the RTC is connected externally, is there any chance  that the  soft reboot tends to put the device in an unpredicatable state?. But date -s and hwclock -w command works well with soft reboot to give the proper output. This leads again to trouble.

    Regards,

    Anjali

  • Hi Anjali,

    Could you explain what occurs when the soft reboot happens? Need to understand what happens to the device in terms of VCC, backup supply, and register access

    Kind regards,
    Lane