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.

  • Well, using RTT does not help as the messages vanish when the micro controller resets himself. I tested the callbacks and they are working. But nevertheless, I get softresets and I do not call NVIC_SystemReset() at all. I also replaced all APP_ERROR_CHECK(). I do not have any further idea.

  • Very strange.

    1. Are you using J-Link RTT Viewer? In my experience the messages just don't disappear unless I clear my screen programmatically in the beginning of the application. Are you doing this? Also, even if I do clear my screen, all messages still show up in the "All Terminals" tab in RTT Viewer regardless.
    2. Can you confirm that you have tried to define DEBUG in your preprocessor defines? I understand that you have redefined all the relevant functions without NVIC_SystemReset(), but it should be worth a shot anyway.

    If none of this is helpful I think we need to have a look at your code. You can upload it in confidence in our MyPage support portal if you want that.

    1. Well, I do not clear the messages, but what you mention only works when having the computer/debugger being connected at all times or?

    2. I have defined the DEBUG symbol but still I am getting resets

    I used 'sd_power_gpregret_set' to debug further. Is it sure that the GPREGRET register is not cleared when the NRF_POWER->RESETREAS register has value 0x04? How can a value of 0x04 be obtained? Jumping to address 0?

  • Q1) Yes.

    Yes, GPREGRET should be retained after a soft reset. Refer to the documentation here.

    The value should only be 4 after a soft reset. Note though, that the bit might be retained if you program your device without power cycling it afterwards. Is it possible that you see "old" values in the resetreas register?

  • Can someone explain me why inside softdevice_handler.c 'APP_ERROR_CHECK' is called multiple times whereas I cannot install an own handler without modifying the SDK files? I mean, did I missed some informations about that behavior?

Related