Using arm_math.h problem


#1

I'm trying to use some of the functions that are written in the arm_math.h file, but am encountering some problems.

Although "arm_mult_q31(A,B,C,8);" works to multiply two arrays of 8 values together, this doesn't seem to work for "arm_add_q31(A,B,C,8);". Although it's being described in the same file as "arm_mult_q31(.. , .. , .. , ..)", the add functions returns an error, telling me it ain't there..

I've added "#include "arm_math.h" to the local data, which seems to load (I see no errors), but somehow I still cannot use these functions..

Can anyone tell me how to make use of these math functions? it seems to me that it would be really helpful to use on tables and might be lower on cpu..


#2

That function isn’t in the library.

Google arm_add_q31.c and you’ll find source code. Easy to just add it to your code.


#3

Might be a late response :zzz:, however, I stumbled over the same problem (arm_add_q31 missing) and I do prefer the solution to add the arm_add_q31 by patching the firmware.
You just need to patch the Makefile in /Contents/Java/firmware and add
${CMSIS}/DSP_Lib/Source/BasicMathFunctions/arm_add_q31.c \
${CMSIS}/DSP_Lib/Source/BasicMathFunctions/arm_sub_q31.c \

run compile_firmware(platform).sh (don't forget to export the axoloti_runtime path for the toolchain)
and use the functions out of the box.

Advantage: it's all there, no need to hack more code :slight_smile:
Disadvantage: your patches are not compatible with the community, your older patches on sd-card neither :frowning:


#4

Hmm. I tried to make an include at some point.

From what I remember you can't load includes from the "init code", you have to do it from a text editor, like Atom:

Includes seems to have it's own section in XML editor.

Dunno if it's the same issue you are having there.


#5

in the first post I just wondered why only a couple of the arm_math functions were actually added to the math header and not just all of them that are shown to be included at the arm website.
But you raise another good question.. why can't we just edit the "init" part of the editor?? We got a screen, but it's not usable..
It would save a lot of time if we could just add headers there directly, not only for these math functions, but also for simple building blocks like oscillators, envelopes and sequencers, instead of having to open the file in a text-editor and edit the text.


#6

You mean edit xml part of the editor, right?

Yes that would be lovelly. Ir just give us a fan for includes. Though just being able to edit the XML part would probably do it :slight_smile: