• Resolved

DK-TM4C129X: Problem determining what causes FaultISR

Part Number: DK-TM4C129X

Hello everyone.

I'm using IAR and FreeRTOS.

Like the title says, I'm getting into the FaultISR infinite loop. In order to determine what casuses this problem, I follow the instructions on spma043 document and found this:

I check the Fault Status and it has a value of 0x00008200, that according with the register description, it means that there is an error and that FAULTADDR register is holding a valid fault address.

So I checked FAULTADDR and it has the next value:

Like you can see the value is 0x1FFFFFF4, but investigating I see that correspond to reserve memory and I can figure out what is causing the problem.

So I followed the next suggestion and went to the Stack Pointer and see that it has the value of 0x2001E020 and then I went to that direction int he disassembly and I found the next:

But that doesn't tell me nothing to me.

So I'm still confused, how can I know what is causing the problem?

Regards, Juan.

  • Hi Juan,
    Can you try to increase you stack size?

    regards,

    Charles

    Please click the Verify Answer button on this post if it answers your question.

  • Assuming your FaultISR is just a simple loop then the data starting at location 0x2001E020 is what was saved on the stack. You need to show the remaining locations:
    0x2001E020 contains r0
    0x2001E024 contains r1
    0x2001E028 contains r2
    0x2001E02C contains r3
    0x2001E030 contains r12
    0x2001E034 contains LR
    0x2001E038 contains PC (this is the value you want to disassemble to see what was happening when the fault occurred.)
    0x2001E03C contains xPSR

    Best Regards,
    Bob Crosby

  • In reply to Bob Crosby:

    My previous post describes how you interpret the values on the ISR stack. If your thread stack was linked to start at address 0x20000000, then Charles gave you the quick answer. You most likely exceeded the thread stack size and when the stack pointer decremented below 0x20000000, you generated a bus fault. Note that the fault address of 0x1FFFFFF4 is just 12 bytes below the start of RAM.

    Best Regards,
    Bob Crosby

  • In reply to Charles Tsai:

    Hi Charles

    I've increased the stack size of the task and the error took so much longer to happend, so that make me realize that maybe I'm having an error with some pointer and that I'm writing on an invalid direction. Sadly, right now I can't work on that but as soon as I try it again I will comment you if something happens.
    Thank you.

    Regards, Juan
  • In reply to Bob Crosby:

    Hi Bob

    Your post will be very helpful in further debugging.
    Thanks.

    Regards, Juan.
  • In reply to Charles Tsai:

    Hi Charles

    Do you know how to increase the stack size? I'm using IAR 7.4 and I can't find how to do that.
    I found that was in Project->Options->Linker->Config Tab and Edit but it doesn't work. Then I open the .icf file with a text editor but there is no stack size in the file, just heap size.
    Then on the startup_ewarm file i found this:

    //*****************************************************************************
    //
    // Reserve space for the system stack.
    //
    //*****************************************************************************
    static uint32_t pui32Stack[1024] @ ".noinit";

    it's enough if I just increase the 1024? and if so how I have to increase that value

    Regards, Juan.
  • In reply to juanquique_22:

    Hi,
    Did you change the pui32Stack size to 1024 already? The default is 64 which is equal to 256 bytes. If array size of 1024 which is equal to 4kbytes is still overflowing then you want to try using the stack analysis tool and call graph in IAR to understand your program flow. I never used these tools myself though.

    You might also find the below article helpful.
    www.iar.com/.../

    regards,

    Charles

    Please click the Verify Answer button on this post if it answers your question.

  • In reply to Charles Tsai:

    Hi
    The size of 1024 it was the default value,
    just changing that value it modifies the stack size?

    The article was very helpfull, I just gonna find out how to change the stack size and how to monitor it with the IAR tool
    Thanks

    Regards, Juan