cancel
Showing results for 
Search instead for 
Did you mean: 

Hard Fault handler FFT

AKhot.1
Senior

After the arm_fft function, I am running into a hard fault handler when running in debug mode. I am not getting why is it happening. Please help with this.

 

AKhot1_0-1693225742548.png

Is it because of some wrong memory allocation?

 

6 REPLIES 6

Suggest you get a Hard Fault Handler implementation that prints out register details, rather than stopping in a while(1) loop, so you can determine what the actual cause is rather than have to guess.

Determine what memory or related access it is objecting too, and work back from there.

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

Hard to say without more info. Perhaps bogus values in fftHandler. Is the FPU enabled?

If you feel a post has answered your question, please click "Accept as Solution".
AKhot.1
Senior

I was able to solve that by doing this:

arm_rfft_fast_f32(&fftHandler, &fftIn, &fftOut, 0);

but now this portion of code giving the same hard fault error

AKhot1_0-1693227891571.png

 

TDK
Guru

A loop that depends on z and p that never get modified. Can't end well.

TDK_0-1693231294627.png

 

If you feel a post has answered your question, please click "Accept as Solution".

The logic and index here are confusing, no comments as to goals or expectations. 

Could some of these values go negative or exceed bounds?

Not sure what's happening? Instrument the loop, see if it is moving things as expected or anticipated..

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

You are right. There was a problem with the loop.