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.

TMS320F280023: Hard Fault Handler Assistance

Part Number: TMS320F280023

Hi, can anyone assist me in writing a hard fault handler interrupt? 

I am not finding much info on such a handler.

Regards,

Ezra

  • Hello Ezra,

    You need to provide details on the error and the function being called; the reason for the fault occurring can range from an ASSERT being flagged to accessing invalid memory.

  • Hi Omer

    I need something very much like STs and NXPs generic hard fault handler. 

    It should be able to interrupt on errors like:

    - Divide by zero errors

    - Invalid mem access

    - etc.

    Is this enough info? I do not really know what more to add?

  • Hi Ezra,

    Apologies, I misread your post and thought you were trying to debug an error; there may be a way to do this with the interrupt architecture on the device, but I will let another expert speak on this.

  • Ezra,

           We don't have such generic fault handlers. Attempting to execute an unimplemented opcode would result in an ITRAP. RESC register shows you the errors that are captured, but handlers are not part of Driverlib

  • Additional information from my colleagues: 

    If you execute code from undefined memory, the bus will return 0x0000 (or 0xFFFFF for blank/unprogrammed Flash). These are illegal op-codes and hence generate an ITRAP. Illegal data access will return random values.  In our errata, there is “fetching beyond valid memory”, which results in undefined behavior.  

    Divide by zero: Don't divide by zero. Check for divide by zero first. The standards for C and C++ say that division by zero is undefined behavior.  The final effect is that compiler simply presumes that never happens.  Any check for division by 0, or how the system responds when it occurs, must be manually added by the user.