This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

RTC1_IRQHandler(); Error

Hi all,

I am debugging a program after compiling with no errors using the SDK 15.2.0 on a windows laptop and nRF52840 board. The program was designed to save 8 bytes of data to flash every 50ms for 3 days using fstorage. There should be enough storage on this particular board to allow for this, however I have not had a successful 3 day run yet. The latest bug in the code occurred at "void RTC1_IRQHandler();" in the call stack and about 90 minutes in with an error value of what looks to be 0x00026FC4, which doesn't make sense, at least not to me. I understand this has something to do with the timers, which I use to call the fstorage functions every 50ms. However, as a beginner programmer, I am unable to assess any issues at a lower level. Could someone give some suggestions as to what may be causing this issue?

Thanks,

Jack

Parents Reply Children
  • Hi Simon,

    Thanks for the helpful link! APP_TIMER_CONFIG_RTC_FREQUENCY is set to 31, I believe this sets the prescaler. The past two runs have both stopped at this "BA4A" value which is the value of the counter stored in flash. I believe in decimal this is about 13 hours because the hex value is stored different from its real value 4ABA, however I ran the test overnight and didn't time it myself. Data is now being stored every 5 seconds and this was set by changing the timeout_ticks parameter passed in app_timer_start(). A single 32 bit variable is being stored but is only about 8 bit when the program crashes. Also, my interpretation of the error code was that there was an error 6 on page 2, error 6 being "storage full" based on https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Fgroup__sdk__error.html . 

    Thanks,

    Jack

  • jackiemoon98 said:
    A single 32 bit variable is being stored but is only about 8 bit when the program crashes.

     What does this mean? Are you writing 32 bit every 5 seconds, or is this something else?

    Are you able to see the data stored when the application crashes, to confirm that the data is what you are expecting? You could try running the fds_gc function to collect and delete any garbage data if you have any unexpected data in your flash storage.

    Best regards,

    Simon

  • Yes, I am writing 32 bit every 5 seconds. However, the value being stored is just a counter, which crashes when it hits 4ABA. 4ABA is only 19130 seconds which only takes 15 bit to store, not 32, even though 32 bits are allocated in the memory for every instance. I can see the data stored correctly in the memory 1 view and unfortunately I don't think the fds_gc function will work because I am using the fstorage library instead of FDS. 

    Thanks,

    Jack

Related