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.

The hard fault handler and interrupts task

Hello all,

can anybody give any information about hard fault handler - FaultISR()? I have read "2.2.4 Exception Model" charter in Technical Reference manual, and I saw that FaultISR is calling when:

• A bus error on an instruction fetch or vector table load or a data access.
• An internally detected error such as an undefined instruction or an attempt to change state wit
instruction.
• Attempting to execute an instruction from a memory region marked as Non-Executable (XN).

The core of my question relates with UART comunication in serial_wifi example. I notice when this handle is called my TX,RX and Overflow flags in bits are set (in UARTRIS ). I suppose It is the reason of FaultISR's calling, but I'm not sure. When FaultISR() can be called, and what are conditions about its calling? Thanks in advance!

Best regards,

Sergey Mihaylov.

  • Hi Sergei,

    Sergei Mihailov said:
    I suppose It is the reason of FaultISR's calling, but I'm not sure. When FaultISR() can be called, and what are conditions about its calling? Thanks in advance!

    I have not tried the serial_wifi example program. But, as it is an example program from the SDK, it should not go into FaultISR(). When you tested serial_wifi example program in debug mode, did it go to FaultISR()?

    FaultISR() is a way of telling you that there is something wrong with your microcontroller, or there is something wrong your code.

    One example that would cause a FaultISR(), is that you did not enable the clock for a peripheral that you are going to use in your program. 

    - kel

  • Hi Markel,

    serial_wifi example works fine. The reason which enters my code in Hard fault function is that, send string which is greater than 500 bytes.

    Best regards,

    Sergey Mihaylov.

  • Sergei Mihailov said:
    The reason which enters my code in Hard fault function is that, send string which is greater than 500 bytes.

    Seems you don't have enough memory to handle sending string of more than 500 bytes.

    In this case adjust the size of memory that is associated with that. From what I know that is stack memory. I currently don't know where it is defined. So, look for it in the files.

    - kel

  • Thanks Markel !

    Regards,

    Sergey.