This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

hard fault exception

I am generating optimsed code using simulink coder for LMS filter using stm32f4VG407 discovery board,KEIL MDK-ARM, but upon single conversion of signal through ADC , it is stopping at hardfault handler. fault report:
MM_FAULT_STAT:0x00
BUS_FAULT_STAT:0x04 i.e. IMPRECISERR IS HIGH
USG_FAULT_STAT:0x000
HARD_FAULT_STAT:0x4000000 i.e.FORCED IS HIGH
DBG_FAULT_STAT:0x00000001 i.e. HALTED IS HIGH

I am using Matlab 2013b & MDK_ARM 4.74
please help me how to get rid of this.

Parents
  • since it is MATLAB generated code ,it should work on its own without much editing from user side....so I have no idea how to do it......
    Also I am not able to increase stack size by editing startup_stm32f4xx.s since it is locked
    Also code coverage tool option is not active....

    also since BFARVALID of Bus Fault status register is high so there is valid bus fault
    again IMPRECISERR is high i.e.a data bus error has occurred ,

    from "USING CORTEX-M3 AND CORTEX-M4 FAULT EXCEPTIONS" document:
    FORCED: Indicates a forced Hard Fault, generated by escalation of a fault with configurable priority that cannot be handled, either because of priority or because it is disabled

    FORCED of Hard Fault status register is high means :When this bit is set, the Hard Fault handler must read the other fault status registers to find the cause of the fault.

    So may be it is pointing to bus fault.

    please help me regarding this

Reply
  • since it is MATLAB generated code ,it should work on its own without much editing from user side....so I have no idea how to do it......
    Also I am not able to increase stack size by editing startup_stm32f4xx.s since it is locked
    Also code coverage tool option is not active....

    also since BFARVALID of Bus Fault status register is high so there is valid bus fault
    again IMPRECISERR is high i.e.a data bus error has occurred ,

    from "USING CORTEX-M3 AND CORTEX-M4 FAULT EXCEPTIONS" document:
    FORCED: Indicates a forced Hard Fault, generated by escalation of a fault with configurable priority that cannot be handled, either because of priority or because it is disabled

    FORCED of Hard Fault status register is high means :When this bit is set, the Hard Fault handler must read the other fault status registers to find the cause of the fault.

    So may be it is pointing to bus fault.

    please help me regarding this

Children