Hi everyone,
I'm trying to run some code on a KL82Z MCU, however i keep running into Hard Faults constantly. The MCU is LQFP 80 and it's soldered on a socket with male pins to help me test the code without an actual PCB. My problem is that at random times the MCU would enter hard faults, usually during the initialization lines of code(every time it's at a different line). This can happen dozens of times in a row, while other times everything works perfectly. Currently all the wires are connected on a breadboard and i have 2 decoupling capacitors between the positive and negative pins on the breadboard. So far I've checked all the connected wires and they have a good connection. Does anyone have any suggestions on what can i check next?
Hi,
It is quite difficult to answer your question straight-forwaedly. As normal cases, the hard fault always caused by usage faults, bus faults, and memory management faults if their handler cannot be excuted. In addition, it can also be caused by a bus fault during vector fetch (reading of a vector table during exception handling). In the NVIC there is a hard fault status register that can be used to determine whether the fault was caused by a vector fetch. If not, the hard fault handler will need to check the other fault status registers to determine the cause of the hard fault.