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

Modularize CMSIS-DSP and add full examples #241

Merged
merged 2 commits into from
Jul 11, 2019

Conversation

salkinium
Copy link
Member

This modularizes CMSIS-DSP to reduce the amount of source files that need to be compiled for your project and fixes #239.

This also wraps all CMSIS-DSP examples into modm examples to check for regressions in future.

cc @se-bi @chris-durand

@salkinium salkinium force-pushed the feature/cmsis_dsp_submodules branch 2 times, most recently from 9cca259 to 256c7c0 Compare July 10, 2019 22:58
/* `float arm_linear_interep_table[188495]` is 736kB large and MUST be placed in Flash
* memory NOT SRAM otherwise it won't fit on the device. Since we don't want (=cannot)
* to change the example, we need to take drastic measures... */
#define float const float
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is epic… ARM thought it would be a fantastic idea to declare arm_linear_interep_table not as const, so it gets placed into SRAM, which at 736kB does not fit (surprise, surprise).
I can fix that with this define, however, the arm_linear_interp_instance_f32 structure requires a non-const float*
pointer, so there is a cast missing, which normally causes a compile error. But with -fpermissive I can reduce this to a warning:

In file included from main.cpp:25:
../../../../ext/arm/cmsis/CMSIS/DSP/Examples/ARM/arm_linear_interp_example/arm_linear_interp_example_f32.c: In function 'int32_t arm_cmsis_dsp_example()':
../../../../ext/arm/cmsis/CMSIS/DSP/Examples/ARM/arm_linear_interp_example/arm_linear_interp_example_f32.c:151:80: warning: invalid conversion from 'const float*' to 'float32_t*' {aka 'float*'} [-fpermissive]
   arm_linear_interp_instance_f32 S = {188495, -3.141592653589793238, XSPACING, &arm_linear_interep_table[0]};
                                                                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

This is the best I can do…

@salkinium salkinium force-pushed the feature/cmsis_dsp_submodules branch from 256c7c0 to ab7c69e Compare July 10, 2019 23:59
@salkinium
Copy link
Member Author

So to summarize… All these examples run in a int32_t main() function and write their success to a arm_status status variable and always end with while(1); and it's the only use of the while keyword in that file…

Screenshot 2019-07-11 at 01 54 44

Hmmmmmmm 🤔🤔🤔🤔 what if we just redefine a few things…

Screenshot 2019-07-11 at 01 55 21

😳 #define while return status; void 👀

Screenshot 2019-07-11 at 01 51 31

@salkinium salkinium force-pushed the feature/cmsis_dsp_submodules branch 2 times, most recently from b4a8bbf to b52f794 Compare July 11, 2019 06:29
@salkinium salkinium force-pushed the feature/cmsis_dsp_submodules branch from b52f794 to 022a60a Compare July 11, 2019 06:58
@salkinium salkinium merged commit 022a60a into modm-io:develop Jul 11, 2019
@salkinium salkinium deleted the feature/cmsis_dsp_submodules branch July 11, 2019 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

CMSIS DSP duplicate targets for arm_bitreversal2.o
1 participant