RTC not working correctly

Hi,

I have a little troubl with RTC and timer1&timer2 not counting impulse.

Program hangs after a while. :(

custom boart sat-tech-sbox232

rtc_20240718_1745.zip

Parents
  • Hi Mariusz,

    I do not see any obvious issues with your use of nrfx_rtc API. I am not able to compile it so I did not get a chance to run and test it myself. There are some issues to compile and I do not want to patch it myself since it will make our setups different.

    Make sure you compile your application with no optimizations and build it for the debug build. Run the program again the debugger and run it until you see that it is hanging. Then pause the debugger (pause/halt - do not exit the debugger).

    When you halt/pause the debugger when you feel that your application is stuck/hanging, then you would see the debugger is pointing the context in which is stuck/looping. It is important to know this context to understand what is happening in your application. The stuck state normally can mean many different things based on the unique context to that application.

    Also check the function call stack to understand the code path of how you application reached there. After this info, we would have more info to proceed into proper debugging direction.

  • on SDK 2.5.3 all is OK..... but more power consumption

    Maybe I messed up the code after corrections to 2.6.1?

  • Sorry for the late response Mariusz.

    Yes, it looks like something went wrong while porting your application. 

    mkoniarz said:
    When in this code, program hangs on first call of k_sleep, also when I ported code do main project, program hangs in first k_msleep call :(

    Not sure what hangs means here, when you stop the debugger and if your program context is inside k_sleep, then it does not mean that your application hangs, it means that it went to sleep and possibly low power mode.

    mkoniarz said:
    Maybe I messed up the code after corrections to 2.6.1?

    Yes, can to try to get your code working on the nRF52832 DK? do you see the same results? If yes, then I can help debug it at my end. With your custom board, which I don't have, it is hard for me to debug it at my end.

Reply
  • Sorry for the late response Mariusz.

    Yes, it looks like something went wrong while porting your application. 

    mkoniarz said:
    When in this code, program hangs on first call of k_sleep, also when I ported code do main project, program hangs in first k_msleep call :(

    Not sure what hangs means here, when you stop the debugger and if your program context is inside k_sleep, then it does not mean that your application hangs, it means that it went to sleep and possibly low power mode.

    mkoniarz said:
    Maybe I messed up the code after corrections to 2.6.1?

    Yes, can to try to get your code working on the nRF52832 DK? do you see the same results? If yes, then I can help debug it at my end. With your custom board, which I don't have, it is hard for me to debug it at my end.

Children
No Data
Related