This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Hard Fault when stepping

Other Parts Discussed in Thread: SYSBIOS

I am using a TM4C123 with sysbios. Are code is functioning fine, but in some places when I break the debugger and try to step I get a Hard Fault: FORCED: USAGE: NOCP. What is causing this, I seem to only get it when I break in certain parts of the code and step. 

  • NOCP is a coprocessor fault. This is usually a Usage Fault, but if Usage Faults aren't enable it trips the Hard Fault handler instead (the FORCED part of the error you're seeing). It's caused by attempting to access a coprocessor that isn't present or enabled.

    The most common occurrences of this fault I've seen have been when someone compiled code that uses hardware floating point and attempts to run it on a Cortex-M3, which doesn't have an FPU.

    I don't know why this should happen when single stepping code that runs fine otherwise. Can you post the contents of the fault registers?