Arduino 33 IoT - no inference

Hello everyone,

I know that some of you have already experimented with the Nano 33 IoT, so maybe somebody has a suggestion/solution for me. Here’s what’s going on:

  • I took this code example: https://www.edgeimpulse.com/blog/platformio, replaced the sensor library with the one used by Nano 33 IoT (LSM6DS3), connected it to the data forwarder, and acquired some gesture/movement data;
  • built and trained a model, ran some tests with the board, no problems here;

Next step is deployment to the board, and here I ran into some problems:

I build the Arduino library, I include it in Arduino IDE (unfortunately it seems hard to do it in PlatformIO). I get the “accelerometer” example, and replace the sensor library again.
I also had to add #include <cstdarg> otherwise it wouldn’t compile.

I build it, flash it, it runs on the Arduino Nano 33 IoT board, but… it’s not doing any inference.
It’s supposed to tell me the probabilities for various classes, but it doesn’t give any, just prints the standard, hardcoded output (“Predictions…, Classification…”).
As if it either wasn’t sampling the acceleration, or running any inference.

So just out of curiosity I built the Nano BLE Sense firmware from the exact same project, and flashed it to the BLE Sense: it works like a charm.

I can’t figure out what’s going on: the API between the two sensor drivers is the same, and in fact it works no problem when acquiring data, or doing live classification. Is there more that I need to fix in the Arduino library example, to make sure that it runs OK on a slower board?

1 Like

Hi @nebelgrau77,

You may have issues printing float numbers on the SAMD21 core. Can you check the link below to modify how to print predictions? There is also some tips on slow DSP operations that would be worth to add for your board:

Aurelien

1 Like

If what @aurel said is the case you might want to steal this function: https://github.com/edgeimpulse/example-standalone-inferencing-ecm3532/blob/6ba67247b9202561f7f2ffe742c5eef12596d091/src/main.cpp#L54

1 Like

Yep, that’s definitely it, it does print results when using what @aurel suggested. I will work on it some more then, thanks guys!

Edit: I also did the DSP fix, it slashes the DSP time from over 380 ms to 150!

2 Likes