Deployment: building firmware for Arduino Nano error

Hi there,

I built an image classification model following the Edge Impulse tutorial, but I’m getting an error when I try and build the firmware for deployment to my Arduino Nano 33 BLE. I get the following:

Creating job… OK (ID: 236752)

Writing templates OK

Scheduling job in cluster…
Job started
Exporting TensorFlow Lite model…
Found operators [‘Add’, ‘Conv2D’, ‘DepthwiseConv2D’, ‘Dequantize’, ‘FullyConnected’, ‘Reshape’, ‘Softmax’, ‘Pad’, ‘Quantize’]
Exporting TensorFlow Lite model OK

Building firmware…
Building firmware-arduino-nano-33-ble-sense
Still building…

Still building…
Still building…
/tmp/arduino-sketch-E6CD5D74FD94744E1C51B6AB551D61DD/sketch/src/ingestion-sdk-c/ei_run_impulse.cpp: In function ‘void run_nn_normal()’:
/tmp/arduino-sketch-E6CD5D74FD94744E1C51B6AB551D61DD/sketch/src/ingestion-sdk-c/ei_run_impulse.cpp:292:5: error: ‘run_nn’ was not declared in this scope

  • run_nn(false);*
    
  • ^~~~~~*
    

/tmp/arduino-sketch-E6CD5D74FD94744E1C51B6AB551D61DD/sketch/src/ingestion-sdk-c/ei_run_impulse.cpp:292:5: note: suggested alternative: ‘union’

  • run_nn(false);*
    
  • ^~~~~~*
    
  • union*
    

Still building…
Error during build: exit status 1
./arduino-build.sh: line 42: exit: Building firmware-arduino-nano-33-ble-sense failed: numeric argument required

Application exited with code 2 (Error)

Job failed (see above)

Any ideas on what the issue might be?

Thanks in advance,

Kas

H @Kasim21,

The Arduino Nano 33 BLE doesn’t have a camera sensor which explains why the firmware cannot build (we should prevent building firmware in this situation).
If you wish to use a camera module connected to the Arduino, you can create an Arduino library instead in the Deployment section.

Cheers,
Aurelien

Hi Aurelien,

That makes a lot of sense. Thanks for clarifying.

I’ve also been trying to deploy using the Arduino library. This downloads correctly; however, I then get issues when trying to compile the sketch for deployment to the board (see end of this post for error).

To clarify, I do have an Arducam for connecting to the Arduino. However, for the sketch, I was just copying the raw features from the ‘live classification’ page, and apart from that change, I was just running the sketch as downloaded. I was then later going to build up complexity and connect the Arducam for inputting the raw data.

Can you provide any insights into why the compilation is failing. Is this also to do with the Arduino not having a camera module?

Cheers,

Kas

Arduino: 1.8.13 (Windows 10), Board: “Arduino Nano 33 BLE”

In file included from sketch\static_buffer.ino.cpp:1:0:

C:\Users\kasim\OneDrive\Documents\Arduino\libraries\ei-plant_pot-arduino-1.0.1\examples\static_buffer\static_buffer.ino: In function ‘void setup()’:

C:\Users\kasim\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.6\cores\arduino/Arduino.h:128:16: error: reference to ‘SerialUSB’ is ambiguous

#define Serial SerialUSB

            ^

C:\Users\kasim\OneDrive\Documents\Arduino\libraries\ei-plant_pot-arduino-1.0.1\examples\static_buffer\static_buffer.ino:53:5: note: in expansion of macro ‘Serial’

 Serial.begin(115200);

 ^

In file included from C:\Users\kasim\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.6\cores\arduino/Arduino.h:127:0,

             from sketch\static_buffer.ino.cpp:1:

C:\Users\kasim\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.6\cores\arduino/USB/PluggableUSBSerial.h:279:27: note: candidates are: arduino::USBSerial SerialUSB

extern arduino::USBSerial SerialUSB;

                       ^~~~~~~~~

In file included from sketch\static_buffer.ino.cpp:1:0:

C:\Users\kasim\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.6\cores\arduino/Arduino.h:128:16: note: class mbed::SerialUSB

#define Serial SerialUSB

            ^

C:\Users\kasim\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.6\cores\arduino/mbed/drivers/Serial.h:56:7: note: in expansion of macro ‘Serial’

class Serial : public SerialBase, public Stream, private NonCopyable {

   ^~~~~~

C:\Users\kasim\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.6\cores\arduino/Arduino.h:128:16: error: reference to ‘SerialUSB’ is ambiguous

#define Serial SerialUSB

            ^

C:\Users\kasim\OneDrive\Documents\Arduino\libraries\ei-plant_pot-arduino-1.0.1\examples\static_buffer\static_buffer.ino:55:5: note: in expansion of macro ‘Serial’

 Serial.println("Edge Impulse Inferencing Demo");

 ^

In file included from C:\Users\kasim\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.6\cores\arduino/Arduino.h:127:0,

             from sketch\static_buffer.ino.cpp:1:

C:\Users\kasim\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.6\cores\arduino/USB/PluggableUSBSerial.h:279:27: note: candidates are: arduino::USBSerial SerialUSB

extern arduino::USBSerial SerialUSB;

                       ^~~~~~~~~

In file included from sketch\static_buffer.ino.cpp:1:0:

C:\Users\kasim\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.6\cores\arduino/Arduino.h:128:16: note: class mbed::SerialUSB

#define Serial SerialUSB

            ^

C:\Users\kasim\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.6\cores\arduino/mbed/drivers/Serial.h:56:7: note: in expansion of macro ‘Serial’

class Serial : public SerialBase, public Stream, private NonCopyable {

   ^~~~~~

C:\Users\kasim\OneDrive\Documents\Arduino\libraries\ei-plant_pot-arduino-1.0.1\examples\static_buffer\static_buffer.ino: In function ‘void ei_printf(const char*, …)’:

C:\Users\kasim\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.6\cores\arduino/Arduino.h:128:16: error: reference to ‘SerialUSB’ is ambiguous

#define Serial SerialUSB

            ^

C:\Users\kasim\OneDrive\Documents\Arduino\libraries\ei-plant_pot-arduino-1.0.1\examples\static_buffer\static_buffer.ino:122:9: note: in expansion of macro ‘Serial’

     Serial.write(print_buf);

     ^

In file included from C:\Users\kasim\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.6\cores\arduino/Arduino.h:127:0,

             from sketch\static_buffer.ino.cpp:1:

C:\Users\kasim\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.6\cores\arduino/USB/PluggableUSBSerial.h:279:27: note: candidates are: arduino::USBSerial SerialUSB

extern arduino::USBSerial SerialUSB;

                       ^~~~~~~~~

In file included from sketch\static_buffer.ino.cpp:1:0:

C:\Users\kasim\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.6\cores\arduino/Arduino.h:128:16: note: class mbed::SerialUSB

#define Serial SerialUSB

            ^

C:\Users\kasim\AppData\Local\Arduino15\packages\arduino\hardware\mbed\1.1.6\cores\arduino/mbed/drivers/Serial.h:56:7: note: in expansion of macro ‘Serial’

class Serial : public SerialBase, public Stream, private NonCopyable {

   ^~~~~~

exit status 1

Error compiling for board Arduino Nano 33 BLE.

This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.

@Kasim21, FYI the Nano 33 BLE Sense does not have enough RAM or flash to run image classification.

Can you provide any insights into why the compilation is failing. Is this also to do with the Arduino not having a camera module?

No, this seems unrelated. What version of the Arduino core do you have? Under Tools > Board > Boards manager.

Hi @janjongboom ,

Here’s an image of the Arduino core details (I think):

Any ideas?

Also, thanks for clarification re. Nano capabilities. Do you have any alternative newbie development board suggestions. As a background, I’m a wildlife researcher with limited development experience (just in Arduino). Trying to create a hardware prototype (in a three month sprint) to automate wildlife monitoring during safari game drives.

Cheers,

Kas

Hi Kas,

Loos like the latest Arduino core version broke something with our libraries. I will investigate the issue. In the meantime, you can rollback to v1.1.4 to avoid compiling errors.

Regarding easy-to-use dev boards with camera, I would suggest looking at OpenMV Cam H7 Plus: https://docs.edgeimpulse.com/docs/openmv-cam-h7-plus

Aurelien

Filed a bug with the Arduino team here: https://github.com/arduino/ArduinoCore-nRF528x-mbedos/issues/100

But for now reverting back to v1.1.4 indeed solves the issue.

Hi Aurelien, Jan,

Great - thank you for the input and troubleshooting.

Will roll back to 1.1.4 and also will check out the OpenMV Cam H7 Plus.

Cheers,

Kas

We’ve identified a fix with Arduino, going through our testing pipeline now and hopefully live by the end of the day!

Great! Thanks for the rapid turnaround!

Does the Nano33Ble really not have enough memory to do any Camera Machine Learning? I have the Nano33BLeSense with ov7670 Cam, the PortentaH7 with the Vision shield but the later only works with micro-python. (It works great by the way.) Do we have any Arduino Camera options? I was hoping the Portenta and Vision cam would come out with Arduino code but that might be a long wait. Any suggestions.

@Rocksetta, the Nano 33 BLE Sense can run some models. Think 48x48 input with the smallest transfer learning model, but I still haven’t hooked up any OV7670 cams to it, so not sure how much the frame buffer takes.

For the Portenta: the models work as-is on the board, if you know of any examples to read data from the frame buffer on that target I’ll hook it up as an example - I have the vision shield laying around the office somewhere.

1 Like