cancel
Showing results for 
Search instead for 
Did you mean: 

HardDefault when using DSP arm filter

Jinchen
Associate II

Hi, I try to use arm_fir_f32 from CMSIS-DSP to bandpass my signal. But the program always run into the hard fault handler.

I wonder if that could be i didn't correctly import the CMSIS-DSP library. I followed the instruction from https://community.st.com/t5/stm32-mcus/how-to-integrate-cmsis-dsp-libraries-on-a-stm32-project/ta-p/666790. But in the last step, there were so many multi definition, i commented so much more lines to make compliation work. But now the program kept run into hard fault, I wonder if this could be the problem from CMSIS-DSP.

 

4 REPLIES 4
KDJEM.1
ST Employee

Hello @Jinchen ,

 

Could you please give more detail about this hardfault? Is the optimization level set to 0?

May this FAQ "How to debug a HardFault on an Arm Cortex®-M STM32" can help you.  This article can help you to learn about fault registers, how to automate fault analysis, and figure out ways to recover from some faults.

 

Thank you.

Kaouthar

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi Kaouthar,

Thank you for your reply, and I looked the tutorial you recommended.

The optimization level is set to be 0, and the Fault Analyzer and the address of the PC are shown in the image below. But I couldnt figure out how fix this hardfault.

Could you please give me some more advice?

Thank you 

Jinchen. 

Jinchen_0-1733869578647.png

Jinchen_1-1733869747847.png

 

 

 

Jinchen
Associate II

All of the code was working fine, utill it run into the "arm_fir_f32(&S, tmpB1, tmpC1, FLOATS_PER_WINDOW_SIZE);"

If it's in the HardFault Handler and that just does while(1), there's no point in illustrating that.

Show the CODE that's actually failing and the REGISTERs

Imprecise suggests its a failing memory write just prior.

This is what I use in KEIL

https://github.com/cturvey/RandomNinjaChef/blob/main/KeilHardFault.c

I'm interested in the PC of the FAULT, the registers that code is using, and perhaps LR to understand the next level up, where the current function was called, so I can check the passed parameters, or perhaps add code to sanity check them. ie not NULL or Errant Pointers, etc.

Check size fields, if they describe bytes or array elements.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..