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.

TM4C1294NCPDT: Invalid State Usage Fault (INVSTAT)

Part Number: TM4C1294NCPDT

Hi,

I'm encountering a problem in my code where I'm getting a INVSTAT fault. I have been trying this Diagnosis of Fault provided by TI to debug it but I'm not able to get anywhere.

My NVIC_FAULT_STAT = 0x00020000which states its a INVSTAT fault.

As per the document I read my MSP value which is: 0x2002EEC0

I'm not able to pinpoint the instruction that's causing the issue. I'm able to recreate the issue as I have a http server running which when receives the data from the webpage goes into fault. If I don't send the data from the webpage it works perfectly fine and no issues.

Can anyone help me debug this or help me get the instruction where this problem is originating? Has anyone encountered the same issue?

Thank you.

  • The most common cause is stack overflow or corruption. Have you tried increasing the stack size?

  • Yes I did. It didn't help. does the value of MSP help with anything?

  • The value of the Main Stack Pointer shows that it was still in RAM. I suggest you first look at the exception stack pointer and identify the instruction that caused the fault by as described in section 3.5 of  Diagnosis of Fault. If that instruction is loading the PC from the stack, then look at the contents pointed to by the MSP. It is possible that a variable overrun caused the stack to be corrupt.

  • Hi BoB,

    Thank you for your response. I tried the method and I'm confused a little with values. I have attached the screenshots of core registers and my memory browser .

    Does it help to find the cause?

     

    I'm still not able to get to the instruction that is causing the issue. Any help would be great. Thank you.

    -Deepak

  • This gives us a clue. From the stack we see the previous PC was 00000000. This is clearly a problem as this is the location of the initial stack pointer, not a valid instruction. That explains the INVSTAT fault. But how did it get there? The value before (0001BD73) is the link register at the time the fault occurred. It likely contains the address of a function call, perhaps an indirect call. Can you do a disassembly at that location? If you have symbols loaded, by scrolling backwards in the disassembly you may find the name of the function.