Comments (8)
@ACleverDisguise You need to avoid using initialization functions like arm_cfft_init_f32
and instead use dedicated versions for the FFT lengths you need. For instance arm_cfft_init_512_f32
There are similar functions for other data types, and other transforms (rfft ...)
Like that, the linker will be able to deduce the table that are not used and they won't be included in the final build.
Those functions are documented in the doxygen generated documentation.
There is also a new section in the README : https://github.com/ARM-software/CMSIS-DSP?tab=readme-ov-file#code-size
(The required build and link options that are compiler dependent must also be used : like -ffunction-sections
, -fdata-sections
, -Wl,--gc-sections
...)
from cmsis-dsp.
I'm calling arm_cfft_init_256_q15().
It's still bringing in every size of every static variable.
from cmsis-dsp.
What's your compiler and command line options for compiling and linking ?
from cmsis-dsp.
IAR and I have no idea: the IDE does its level best to conceal that from me. I'll go digging to see what command line it comes up with.
from cmsis-dsp.
Ah, never mind. A third-party (as in another coworker's) file had a call for the general init and I wasn't expecting it to have any calls to the math lib at all, not to mention FFT.
Stripping that out and replacing it with the appropriately-sized init (64 in this case) solved our problem. Thanks, @christophe0606!
from cmsis-dsp.
Problem solved, but this really needs to be documented in the actual library docs, not buried in a README. Like perhaps arm_cfft_init_<type>()
's documentation should mention the sized variants?
Or optionally initialization could be a macro call that parametrizes by size and type like this: ARM_CFFT_INIT(&my_init_struct, q15, 256)
and have that assemble the call to arm_cfft_init_256_q15(&my_init_struct)
?
A macro I've (loosely) tested that does this is below:
#define ARM_CFFT_INIT_IMPL(S, T, N) arm_cfft_init ##N ##T(S)
#define ARM_CFFT_INIT_PREP(S, T, N) ARM_CFFT_INIT_IMPL(S, _ ##T, _ ##N)
#define ARM_CFFT_INIT(S, T, N) ARM_CFFT_INIT_PREP(S, T, N)
This permits me to write code like this:
#define DATA_TYPE q15
#define SAMPLE_SIZE 256
ARM_CFFT_INIT(&my_struct, DATA_TYPE, SAMPLE_SIZE)
And if I decide I want to expand or contract my sample size, I change it in one place and all uses are updated. Similarly if I decide I want to move to f32, I change it in one place and it gets updated everywhere.
from cmsis-dsp.
@ACleverDisguise We will upgrade the documentation so that it is more visible.
The macro is a good suggestion. Thank you.
from cmsis-dsp.
I've written now about a dozen such macros for the features I use. They've really helped in rapid changes while testing and prototyping. I'm sure if I spent actual time on it, I'd make macros that sucked slightly less. ;)
from cmsis-dsp.
Related Issues (20)
- Value range of arm_atan2_* HOT 3
- Implementation `*.c-files` not being copied correctly in STM32CubeMX - missing from .pdsc? HOT 7
- GCC compiler warning in arm_divide_q15() HOT 1
- GCC compiler errors with pendantic flag enabled HOT 4
- Not being able to keep tables out of compilation HOT 4
- arm_sqrt_q31 return value for input value 0 HOT 3
- CppCheck giving warning for arm_divide_q31 because of CWE 758 violation HOT 2
- ARMCM0.h not found HOT 1
- Redirect to DSP hardware HOT 1
- QR Decomposition seems to coverge very quickly. How to adjust parameters. HOT 4
- Encountering some issues with the latest DSP version on Keil HOT 2
- Add __WEAK attribute to DSP Functions HOT 3
- Singular Matrix Inversion HOT 2
- Python 3.12 support HOT 6
- Overflow Handling in arm_fir_q31 Function HOT 2
- FFT Neon support HOT 1
- Migration guide to use new linker-based code size optimization HOT 4
- 'WindowFunctions' compiling error HOT 4
- Compiling error when using CMSIS-DSP: conflicting types for 'clip_q63_to_q31'; have 'q31_t(q63_t)' {aka 'long int(long long int)'} HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cmsis-dsp.