I’m trying to set up an interrupt for a SPI driver in my SPI0M task. In setting up the interrupt, my first call causes a hard fault. I’m calling the function NVIC_SetPriority(). I’m using a Nordic Semiconductor nRF9160 which is based on an ARM Cortex M33 core. This core also contains an MPU which I have enabled in my system.
If I make this task a privileged task, the system works. This implies that the task may be accessing memory without authorization and is being trapped by the MPU. I’ve tried adding the SPI0M and NVIC system registers to the allowed memory region access checked by the MPU to no avail.
Has anyone had this problem? How can I resolve this?