So I'm using the spi_master.c from SDK 6.1 to communicate with an LCD driver. I'm using an nrf51822 with s110 softdevice. My system has been sporadically hardfaulting on me. I've traced the hard_fault to the spi_master.c driver. Specifically the function spi_master_send_recv(). The fault occurs when the function tries to execute this line
//Disable interrupt SPI.
APP_ERROR_CHECK(sd_nvic_DisableIRQ(p_spi_instance->irq_type));
below I've attached a screen shot of the register values while inside the HardFault_Handler().
I'm not certain if this is relevent however they could be linked so I figured I should mention it.I just tried to erase and reprogram the softdevice using nrfgoStudio and now I am having a fault generated by the following line in softdevice_handler.c
// Initialize SoftDevice.
err_code = sd_softdevice_enable(clock_source, softdevice_assertion_handler);
The fault is triggered via a call to the app_error_handler() function which only contains a call to NVIC_SystemReset(). Below are the register values while inside app_error_handler()
I'm not sure how to overcome these issues and would really appreciate any suggestions on overcoming them.