Hi Daniel,
There could be many reasons of why your code is going to the unhandled interrupt. Please take a look to the following post created by our colleague Erich Styger, it gives some guidance on how to find what is causing that hard fault:
Debugging Hard Faults on ARM Cortex-M | MCU on Eclipse
Hope it helps!
Best Regards,
Carlos Mendoza
Technical Support Engineer
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------