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

nRF52 spurious resets with SDK12.2.0 - How to resolve?

Hello,

we have developed a solar powered LED module with an additional battery. It is based on the nrf52832. The WDT and TWI is mainly used and for BLE the soft device is applied. From time to time, the NRF resets itself. I do not really know, how to debug the problem, as it takes days or even weeks that it happens. Using RTT does not work, as it clears it buffers when reseting. We tried to store every possible error as some int value in the flash, but for that specific error, nothing is written. So we do not know what the problem could be. The TWI implementation uses timeouts and un/init in case of an error. Thus I do not believe that this is the problem.

Any suggestions to gain more insights?

[Update: The RESETREAS register is telling me 0x00000004; thus software reset. I implemented 'assert_nrf_callback(uint16_t, const uint8_t*)', 'app_error_fault_handler(uint32_t, uint32_t, uint32_t)' and 'HardFault_Handler(void)' and have there a while loop. As the WDT is activated, a WDT event should occur if these functions are active. I do not use 'NVIC_SystemReset()'. So how to proceed? Right now it is getting critical, as we get some complains about that spurious resets ... ]

Thanks.

Parents
  • If you look inside the macros and functions you will see that:

    1. SOFTDEVICE_EVT_IRQHandler calls
    2. APP_ERROR_CHECK() calls
    3. APP_ERROR_HANDLER() calls
    4. app_error_handler_bare() calls
    5. app_error_fault_handler()

    As mentioned above, app_error_fault_handler() is declared as __WEAK in the file app_error_weak.c. This allows you to "redefine" app_error_fault_handler() in e.g. your main.c file at implement it however you want. Just make a function like this in main.c:

    void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info)
    {
        // Your own implementation
    }
    

    This is now the function that will be used to handle errors by your application.

Reply
  • If you look inside the macros and functions you will see that:

    1. SOFTDEVICE_EVT_IRQHandler calls
    2. APP_ERROR_CHECK() calls
    3. APP_ERROR_HANDLER() calls
    4. app_error_handler_bare() calls
    5. app_error_fault_handler()

    As mentioned above, app_error_fault_handler() is declared as __WEAK in the file app_error_weak.c. This allows you to "redefine" app_error_fault_handler() in e.g. your main.c file at implement it however you want. Just make a function like this in main.c:

    void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info)
    {
        // Your own implementation
    }
    

    This is now the function that will be used to handle errors by your application.

Children
No Data
Related