Fraunhofer-IMS / AIfES_for_Arduino

This is the Arduino® compatible port of the AIfES machine learning framework, developed and maintained by Fraunhofer Institute for Microelectronic Circuits and Systems.
GNU Affero General Public License v3.0
216 stars 45 forks source link

Which #include <arm_math.h> for nano33BleSense CMSIS example #4

Open hpssjellis opened 2 years ago

hpssjellis commented 2 years ago

On both the Portenta or the Nano33BleSense my Arduino IDE 1.18.15 compiler dies on the line

include

When I try to install it I only get the option to install the

"Arduino_CMSIS-DSP" which does not work

if I google arm_math I get several libraries such as:

https://github.com/ARM-software/CMSIS/blob/master/CMSIS/Include/arm_math.h

https://github.com/PaulStoffregen/arm_math

etc, etc. Any suggestions?

PierreGembaczka commented 2 years ago

Hi Jeremy,

for the CMSIS example you definitely need the "Arduino_CMSIS-DSP" library.

I just tested this successfully on the Portenta with the following setup:

Do you maybe still have the old Mbed core installed which is deprecated? You will only get the sketch compiled if the "Arduino_CMSIS-DSP" library is installed. This is still quite new and works only with the new Mbed cores. Seems to be a bug in the Arduino IDE. Maybe a reinstallation of the IDE will help.

Many greetings Pierre

hpssjellis commented 2 years ago

@AIfES-Pierre You are correct, this time installing the "Arduino_CMSIS-DSP" library and uncommenting #define AIFES_WITH_CMSIS from the AifES.h library source does seem to solve the issue I was having. Thank you.

Surprised just adding the define into the sketch didn't solve the issue. I don't really want my students editing the library.

The following did not work, although I am not really sure why.

#define AIFES_WITH_CMSIS
#include <aifes.h>    
PierreGembaczka commented 2 years ago

Hi @hpssjellis,

unfortunately this does not work. In the Arduino IDE the library is compiled first and then the sketch. So the define in the sketch has no effect at all. In addition, compiler/linker flags are not so easy to set in the Arduino IDE: https://forum.arduino.cc/t/how-to-add-compile-options-to-arduino-ide-1-8-13/692640

That's why we solved it in such a complicated way. But we are working on a more elegant solution for the next update.

Many greetings Pierre