2023-11-02 10:49 AM - edited 2023-11-03 05:42 AM
Whenever the compiler executes
printf("frequency %f: %f \n", ((float32_t)(i * SAMPLING_RATE) / FFT_BUFFER_SIZE), output_fft_mag);
it goes to HardFault.
I attach main.c and syscall.c
All the code that we need to analyze is inside the function void get_sineval_FFT2()
Here's the problem:
EDIT: The problem is only there when I try to printf floats ... whereas with normal strings or ints everything goes
2023-11-03 01:45 PM - edited 2023-11-03 01:47 PM
This is very strange. Floats passed to printf must be automatically converted to doubles. Something else goes on there. The float 'coprocessor' not enabled by startup?
2023-11-17 03:16 AM
Now it works:
After so many trials I don't really remember what I changed from the main.c I had posted in the first post of this thread, maybe I was using temp while I should have used temp[i] ? .. I don't know.
In any case, thank you for your efforts and help.
2023-12-28 10:13 AM
This is a late-in-the-game longshot. Is your FFT producing double or long double complex results as successive real and imaginary parts in the buffer ?
include <complex.h> support is not in your main.c.
2024-01-03 12:01 PM
The FFT produces a vector like this: [a0, b0, a1, b1 ...] where a0 is the real part while b0 is the imaginary part of the number