what kind of reasons make software reset(0x04)?


We created a product using nrf52840.

the product is operating well, but it has been confirmed that software reset (0x04) operates in very few times (2weeks per 1time).
In this case, I want to know software reset due to low power or external physical interference are excluded.
Is the cause of software reset only in the firmware code?

Are there any causes worth considering from code?

In addition, a function was added to save to external memory in app_error_fault_handler , but there was no log in external memory even the software
reset after.

(we use sdk17.1.0)
Parents
  • A soft reset could be generated when the SYSRESETREQ bit of the application interrupt and reset control register (AIRCR) in the ARM core is set. A soft reset can also be generated via the RESET register of CTRL-AP.

    Did you test your fault handler by intentionally making a fault and checking if it is working as intended?

  • Q. Did you test your fault handler by intentionally causing a fault and verifying if it worked as intended?

    A. We created a BLE command to test the app error handler (APP_ERROR_HANDLER(NRF_ERROR_TIMEOUT)). Additionally, we implemented a function to store reset markers in external memory within the __WEAK void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info) function. We verified that it was functioning correctly.

    But, We observed that the NVIC_SystemReset function is also within the HardFault_c_handler function.

    So we realized that if the reset occurred outside of the `app_error_fault_handler` function, the reset mark would not have been stored in external memory.

    Recently, we focused on LED blinking as the cause of resets and modified our code to reproduce the reset issue.
    In our device, the LED blinks using PWM, flashing every 3 seconds, and also blinks when a button is pressed.
    Accordingly, we tested whether the operation of the LED, controlled by 300ms and 500ms timers, affects the reset.

    And we confirmed that the following log appeared twice on one device.

    [01:29:07.243,164] <error> hardfault: HARD FAULT at 0x00060290
    [01:29:07.249,023] <error> hardfault: R0: 0x00000000 R1: 0x200321BC R2: 0x200348DC R3: 0x10000000
    [01:29:07.258,789] <error> hardfault: R12: 0x00000000 LR: 0x0005FA9B PSR: 0x61000000
    [01:29:07.266,601] <error> hardfault: Cause: The processor has attempted an illegal load of EXC_RETURN to the PC, due to an invalid context, or an invalid EXC_RETURN value.

    --after reset--
    [00:00:00.000,000] <info> app: reset_reason: 0x00000004.

    What information can we gather from the above log?

  • Today, we ran the Segger tool for approximately 2 hours, and it stopped in the following state. Below are the

    screenshots of each stack.

Reply Children
No Data
Related