Type Definition nrf_softdevice_s113::nrf_fault_handler_t
source · pub type nrf_fault_handler_t = Option<unsafe extern "C" fn(id: u32, pc: u32, info: u32)>;
Expand description
@brief Fault Handler type.
When certain unrecoverable errors occur within the application or SoftDevice the fault handler will be called back. The protocol stack will be in an undefined state when this happens and the only way to recover will be to perform a reset, using e.g. CMSIS NVIC_SystemReset(). If the application returns from the fault handler the SoftDevice will call NVIC_SystemReset().
@note It is recommended to either perform a reset in the fault handler or to let the SoftDevice reset the device. Otherwise SoC peripherals may behave in an undefined way. For example, the RADIO peripherial may continously transmit packets.
@note This callback is executed in HardFault context, thus SVC functions cannot be called from the fault callback.
@param[in] id Fault identifier. See @ref NRF_FAULT_IDS. @param[in] pc The program counter of the instruction that triggered the fault. @param[in] info Optional additional information regarding the fault. Refer to each Fault identifier for details.
@note When id is set to @ref NRF_FAULT_ID_APP_MEMACC, pc will contain the address of the instruction being executed at the time when the fault is detected by the CPU. The CPU program counter may have advanced up to 2 instructions (no branching) after the one that triggered the fault.