Skip to main content
AKhot.1
Associate III
August 28, 2023
Question

Hard Fault handler FFT

  • August 28, 2023
  • 4 replies
  • 3444 views

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?

 

This topic has been closed for replies.

4 replies

Tesla DeLorean
Guru
August 28, 2023

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 VenmoUp vote any posts that you find helpful, it shows what's working..
TDK
Super User
August 28, 2023

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
AKhot.1Author
Associate III
August 28, 2023

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

 

Tesla DeLorean
Guru
August 28, 2023

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 VenmoUp vote any posts that you find helpful, it shows what's working..
AKhot.1
AKhot.1Author
Associate III
August 29, 2023

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

TDK
Super User
August 28, 2023

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""."