Hello,
Could you please confirm the microcontroller that you are using? Also do you experience the same behavior with the example as is?
If not, could you also provide the description of the APIs you have added.
Generally the error that you have shown in your image, is easily identifiable. Being that the precise bit is on and the bfar bit is on, means that the address located in the BFAR register holds the information of when the exception ocurred. I suggest to check the instruction prior to.
Best Regards,
Sabina