Library on arduino not running (binary does)

I have a strange thing happening, i use the Arduino Nano 33 BLE Sense.
When i make my model an deploy it using the build firmware option (binary), it runs normally.

When i create it with a library, it is impossible to make it runs :frowning:
On my terminal i saw nothing (terminal is well configured and data rate is good) seems like the MC cannot initialize serial port or that program dont start…

Could you help ?

PS : Addon found, i add delay on my serial port and now see more messages, the serial port running well, the program block at this point :frowning:

“FAILED TO START PDM!”
Seems to be the library PDM.h not running…
But this runs when doing a binary using edge impulse…

Could you help ?

I am also having some issues. On twitter was given the suggestion to try the Arduino cloud. For myself things work with MBED board version 1.1.6 not 1.3.0. Keep in touch about this, I hope things get better.

1 Like

Some users (including @Rocksetta) have indeed found that the 1.1.6 Mbed core works - I’m not sure what’s going on with 1.3.0 so far, but until we’ve figured it out you can revert back via Tools > Boards Boards Manager.

1 Like

@Tronic19 @Rocksetta This is the underlying bug: https://github.com/arduino/ArduinoCore-mbed/issues/92

We’re patching our example sketches today, but you can fix it right now by removing:

ei_printf("Predictions (DSP: %d ms., Classification: %d ms., Anomaly: %d ms.): \n",
         result.timing.dsp, result.timing.classification, result.timing.anomaly);

And replacing with:

    ei_printf("Predictions ");
    ei_printf("(DSP: %d ms., Classification: %d ms., Anomaly: %d ms.)",
        result.timing.dsp, result.timing.classification, result.timing.anomaly);
    ei_printf(": \n");
1 Like

Thanks a lot to all your replies !
I will check in end of day and let you knows if runs

Kind regards

Bruno

This has now been deployed as well.

@janjongboom look what Arduino has done with Portenta and Nano33BLE board define names. The NANO33BLE has changed to ARDUINO_NANO33BLE

https://github.com/arduino/ArduinoCore-mbed/blob/727c0181f89137db902d8ecf041fb0102c91716a/boards.txt#L118 The Portenta has also changed for each core. Also the way the Nano33BLE prints debug from TensorflowLite has changed to how the Portenta M7 core prints.

That fixed my issues with Mbed 1.3.0

@Rocksetta We don’t use that define though, we just use normal define’s to detect ARDUINO which seems to work well. Did you have to change anything to get Portenta to work with the new core or did the new Edge Impulse Arduino library export fix this?

I haven’t tested yet on the Portenta, but converting DebugLog from how I had it running for the Nano33Ble to how the Portenta M7 Core runs is what fixed it for me. Even if you don’t use “defines” your situation with your Arduino Library might be similar. Or it could be something else, but thought I should mention it.

What worked for me using MBED core 1.1.6 on the Nano33BleSense were these lines of code:

here

 #if  defined (CORE_CM7)  ||  defined (YOUR_BOARD1) // CORE_CM7 is for the PortentaH7 outer core
 
    // do abosolutely nothing the default works
    
 #elif defined (CORE_CM4)  || defined (NANO_33_BLE) ||  defined (YOUR_BOARD2)  // CORE_CM4 is for the PortentaH7 inner core
 
     #define DEBUG_SERIAL_OBJECT (Serial) 

     extern "C" void DebugLog(const char* s) {
        static bool is_initialized = false;
        if (!is_initialized) {
           DEBUG_SERIAL_OBJECT.begin(9600);
           is_initialized = true;
        }
        DEBUG_SERIAL_OBJECT.print(s);
     }


Thanks. I had heard of that bug, but did not look for it in your code. Good catch.

Hi to all,
It is runnning for me now on my platform.

Thanks a lot for your help :slight_smile:

1 Like

Hello everyone
generated the Arduino library from Edge Impulse. I run the example nano_ble33_sense_accelerometer or nano_ble33_sense_accelerometer + Continuous and get the error
Arduino IDE 1.8.5 -
“Arduino: 1.8.5 (Windows 7), Board: “Arduino Nano 33 BLE”
WARNING: Category ‘Data processing’ in library victoruni-project-1 Inferencing - Edge Impulse is not valid. Setting to ‘Uncategorized’
fork/exec C:\Users\user\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++.exe: The filename or extension is too long.
Error compiling for board Arduino Nano 33 BLE.”
Arduino IDE 1.8.11, Arduino IDE 1.8.13
“fork/exec C:\Users\user\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4/bin/arm-none-eabi-g++.exe: The filename or extension is too long.
Error compiling for board Arduino Nano 33 BLE.”
There was no such error a few months ago. And now on two different computers. Arduino IDE 1.8.5, Arduino IDE 1.8.11, Arduino IDE 1.8.13 for Windows 7 32-bit

@aurel is our designated file names are too long expert ^

Hi @victoruni,

You can grab the mbed platform.local file here: https://docs.edgeimpulse.com/docs/running-your-impulse-arduino#code-compiling-fails-under-windows-os

Also this bug will be fixed in the next Arduino release.

Cheers,
Aurelien

Thank you. Now everything works!!!

2 Likes