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.
So move a copy of startup_stm32f4xx.s into your project directory, and remove the read-only attribute.
Review the code and processor registers at the fault location.
I am still struck in hard fault exception
after running 36 times(i.e 36 adc conversions & hence 36 outputs at dac) the program is getting into hard fault exception from within this for loop:
/* Update weights for the next input sample */ j_0 = 0; for (j = (int32_T)*startIdx; j < wLen; j++) { prodMuErrX = accWtU * xBuf[j]; prodMuErrX += mul_s32_s32_s32_sr30(leakFac, wBuf[j_0]); wBuf[j_0] = prodMuErrX; j_0++; }
I even checked changing stack size but the number of conversions (i.e 36 ) was independent of change in stack size.
Can somebody please help me regarding this?
Hello Satyajit Sahoo,
maybe Application Note 209 (http://www.keil.com/appnotes/docs/apnt_209.asp) helps you examining the HardFault.
Best Regards, Martin