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

What might cause HardFault on sd_nvic_critical_region_enter

I have an nrf51822AC chip connected to another ARM based processor which provides a CAN interface. The two are connected via the UART and we are using the ble_connectivity software in connection with the S120 softdevice on the nrf51.

So far, I can initialize the BLE stack, the client handler and the device manager and starting scanning (sending back and forth messages between the CAN and nrf51 processor) as outlined in one of the examples. As soon as the first BLE event needs to be transferred from the nrf51 chip to the CAN processor though, I end up with a hard fault when sd_nvic_critical_region_enter() is called from within app_sched_pause() inside ser_conn_ble_event_encoder(). What can be done to avoid this hard fault?

current_int_priority_get() returns NRF_APP_PRIORITY_THREAD (4) when this happens.

I am not sure which version of the SDK this is based on, but it could be as old as 8.1.0 if that is important.

Any help is very much appreciated.

Related