Skip to main content
Graduate II
October 23, 2025
Solved

CMSIS-DSP rfft init throwing an error

  • October 23, 2025
  • 1 reply
  • 223 views

STM32WB55

arm_rfft_fast_instance_f32 fft_instance;
arm_rfft_fast_init_f32(&fft_instance, NUM_SAMP);


I'm trying to use the rfft_fast function from the arm_math.h library

But when I compile I get...

 

../STM32_WPAN/App/custom_app.c:122:24: error: expected declaration specifiers or '...' before '&' token
122 | arm_rfft_fast_init_f32(&fft_instance, NUM_SAMP);
| ^
../STM32_WPAN/App/custom_app.c:69:25: error: expected declaration specifiers or '...' before numeric constant
69 | #define NUM_SAMP 256

 

I looked at the docs & many examples of the init function, the usage is always as above. Compiles fine if I comment out the init function but obviously that is of no use to me.

 

    This topic has been closed for replies.
    Best answer by TDK

    You can't call functions directly like this at the global scope. This needs to be within a function such as main().

    If that's not it, include the full custom_app.c file that throws this error.

    1 reply

    TDKAnswer
    Super User
    October 23, 2025

    You can't call functions directly like this at the global scope. This needs to be within a function such as main().

    If that's not it, include the full custom_app.c file that throws this error.

    Graduate II
    October 23, 2025

    Thanks, getting lost in my own code here...