Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CMSIS-DSP] How to use latest version of ARM DSP APIs? #1162

Closed
cogito666 opened this issue Sep 8, 2024 · 2 comments · Fixed by #1165
Closed

[CMSIS-DSP] How to use latest version of ARM DSP APIs? #1162

cogito666 opened this issue Sep 8, 2024 · 2 comments · Fixed by #1165
Assignees

Comments

@cogito666
Copy link

Hi there,

I want to use the latest version of ARM CMSIS-DSP APIs on the MAXIM product.
But I don't know if it's possible or not.

As I checked, currently MAXIM SDK relies on CMSIS version 5.9.0.

So my questions are

  1. Is there any document/Guide from analogdevice so that developers build/merge/use the latest version of CMSIS-DSP APIs?
  2. Is there any plan for analogdevice to merge/test/release new versions of DSP APIs?
@Jake-Carter
Copy link
Contributor

Hi @cogito666, I was able to build the latest CMSIS-DSP with our existing CMSIS-Core v5.9.0. It was not 100% straightforward, but the new version seems compatible.

The biggest change is to how code size optimizations are handled (see "Code Size").

I had to enable -fdata-sections and -ffunction-sections so that the linker could optimize the unused tables, otherwise the library would take about 1MB of flash. Even then, using the new initialization functions further reduces the code size by as much as 15-20%.

For example, for a 1024-size FFT you should now use:

--- a/Examples/MAX78000/ARM-DSP/arm_fft_bin_example/arm_fft_bin_example_f32.c
+++ b/Examples/MAX78000/ARM-DSP/arm_fft_bin_example/arm_fft_bin_example_f32.c
@@ -129,7 +129,7 @@ int main(void)
 
     status = ARM_MATH_SUCCESS;
 
-    status = arm_cfft_init_f32(&varInstCfftF32, fftSize);
+    status = arm_cfft_init_1024_f32(&varInstCfftF32);
 
     /* Process the data through the CFFT/CIFFT module */
     arm_cfft_f32(&varInstCfftF32, testInput_f32_10khz, ifftFlag, doBitReverse);

I also disabled -fshort-enum and -fshort-wchar, which were enabled by default. I'm not sure what the performance implications are, but we don't use these in our MSDK builds yet. So for compatability I removed them.

There's still a little more work to integrate this into the build system. I will have a development branch up tomorrow that you can use to start trying out the new library.

@Jake-Carter Jake-Carter self-assigned this Sep 9, 2024
@Jake-Carter Jake-Carter transferred this issue from analogdevicesinc/VSCode-Maxim Sep 9, 2024
@Jake-Carter
Copy link
Contributor

@cogito666 PR opened. The branch is available on feat/cmsis-dsp-v1-16-2 if you'd like to test it early and report any issues. No project changes are needed to start using the updated version other than building against the branch.

The added version is 1.16.2, and the new CMSIS_DSP_VERSION build option should make future updates more transparent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants