Arduino CLI Version

Edge Impulse doesn’t seem to support the current offering at https://arduino.github.io/arduino-cli/latest/.
Dropping to 0.13.0 worked for me. What CLI level is suggested?

arduino-cli version
arduino-cli.exe alpha Version: 0.16.0 Commit: c977a238 Date: 2021-02-15T09:30:01Z
flash_windows.bat
You’re using an untested version of Arduino CLI, this might cause issues (found: 0.16.0, expected: 0.13.x
Finding Arduino Mbed core…
arduino:mbed 1.3.2 1.3.2 Arduino mbed-enabled Boards
Finding Arduino Mbed core OK
Finding Arduino Nano 33 BLE…
Finding Arduino Nano 33 BLE OK at Arduino
No device found on Arduino
Error during Upload: uploading error: uploading error: exit status 1

arduino-cli version
arduino-cli.exe Version: 0.13.0 Commit: 693a045
flash_windows.bat
Finding Arduino Mbed core…
arduino:mbed 1.3.2 1.3.2 Arduino mbed-enabled Boards
Finding Arduino Mbed core OK
Finding Arduino Nano 33 BLE…
Finding Arduino Nano 33 BLE OK at COM6
No new serial port detected.
Device : nRF52840-QIAA
Version : Arduino Bootloader (SAM-BA extended) 2.0 [Arduino:IKXYZ]
Address : 0x0
Pages : 256
Page Size : 4096 bytes
Total Size : 1024KB
Planes : 1
Lock Regions : 0
Locked : none
Security : false
Erase flash

Done in 0.000 seconds
Write 525440 bytes to flash (129 pages)
[==============================] 100% (129/129 pages)
Done in 23.391 seconds
Flashed your Arduino Nano 33 BLE development board
To set up your development with Edge Impulse, run ‘edge-impulse-daemon’
To run your impulse on your development board, run ‘edge-impulse-run-impulse’

You're using an untested version of Arduino CLI, this might cause issues (found: 0.16.0, expected: 0.13.x

@dfrap Looks like we have only tested the Arduino CLI up to version 0.13.x, I will create a ticket in our backlog for upgrading to 0.16.x+, is there anything specific you need from the latest CLI?

However, I was able to flash our continuous motion recognition tutorial (https://studio.edgeimpulse.com/public/14299/latest) successfully to the Arduino Nano 33 BLE with version 0.16.0 of the Arduino CLI and version 1.3.2 of the Arduino mbed-enabled boards package:

You're using an untested version of Arduino CLI, this might cause issues (found: 0.16.0, expected: 0.13.x
Finding Arduino Mbed core...
arduino:mbed 1.3.2     1.3.2  Arduino mbed-enabled Boards
Finding Arduino Mbed core OK
Finding Arduino Nano 33 BLE...
Finding Arduino Nano 33 BLE OK at COM10
Device       : nRF52840-QIAA
Version      : Arduino Bootloader (SAM-BA extended) 2.0 [Arduino:IKXYZ]
Address      : 0x0
Pages        : 256
Page Size    : 4096 bytes
Total Size   : 1024KB
Planes       : 1
Lock Regions : 0
Locked       : none
Security     : false
Erase flash

Done in 0.000 seconds
Write 267952 bytes to flash (66 pages)
[==============================] 100% (66/66 pages)
Done in 11.340 seconds
Flashed your Arduino Nano 33 BLE development board
To set up your development with Edge Impulse, run 'edge-impulse-daemon'
To run your impulse on your development board, run 'edge-impulse-run-impulse'

I would try unplugging / replugging your board into your computer and restarting your computer.

I have no reason to prefer any version of the Arduino CLI. I have years of experience with the Arduino IDE. This is my first experience with the CLI.

I was just following the install directions from https://docs.edgeimpulse.com/docs/arduino-nano-33-ble-sense that lead me to install the latest version of the CLI from https://arduino.github.io/arduino-cli/latest/

Ok! I’ll add our supported version information to the docs.

Thanks!

@dfrap we’re actually following the Arduino CLI release schedule, and 0.13 - 0.16 should all work (despite the message). Like Jenny I’ve just tested this on 0.16 in Windows and can flash successfully.

I’ve seen the “Error during Upload: uploading error: uploading error: exit status 1” error also on 0.13 when the CLI could not connect to the bootloader. E.g. issues when mounting the new USB port in a VM, pressing restart in the middle of an upgrade, etc. I assume there’s other cases too.

FYI - I tried 0.16 again and the problem persists. Please let me know if you need more information about my very basic setup. There is no VM for example.

Since the documentation has been updated to specify the 0.13 CLI, it is officially not a bug.

@dfrap, yeah, I’d still consider it a bug, we try to keep up to date. Have pinged Arduino!

edit: Could you add the -v command to this line:

CALL arduino-cli upload -p %COM_PORT% --fqbn arduino:mbed:nano33ble  --input-dir .

edit 2: If you have the exact Windows version that’d help too.

Windows 10 Home Version 2004 build 19042.804

It appears that the bossac.exe being used on my machine is from the Arduino IDE 1.8.13. The IDE is not in my PATH, so it’s not clear to me how that file was selected. The obvious difference is the port selected: Arduino vs COM6

flash_windows.bat
You’re using an untested version of Arduino CLI, this might cause issues (found: 0.16.0, expected: 0.13.x
Finding Arduino Mbed core…
arduino:mbed 1.3.2 1.3.2 Arduino mbed-enabled Boards
Finding Arduino Mbed core OK
Finding Arduino Nano 33 BLE…
Finding Arduino Nano 33 BLE OK at Arduino
Waiting for upload port…
“C:\Users\Darrell\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.9.1-arduino2/bossac.exe” -d --port=Arduino -U -i -e -w “./arduino-nano-33-ble-sense.ino.bin” -R
No device found on Arduino
Error during Upload: uploading error: uploading error: exit status 1

flash_windows.bat
Finding Arduino Mbed core…
arduino:mbed 1.3.2 1.3.2 Arduino mbed-enabled Boards
Finding Arduino Mbed core OK
Finding Arduino Nano 33 BLE…
Finding Arduino Nano 33 BLE OK at COM6
Performing 1200-bps touch reset on serial port COM6
Waiting for upload port…
No new serial port detected.
“C:\Users\Darrell\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.9.1-arduino2/bossac.exe” -d --port=COM6 -U -i -e -w “./arduino-nano-33-ble-sense.ino.bin” -R
Set binary mode
version()=Arduino Bootloader (SAM-BA extended) 2.0 [Arduino:IKXYZ]
Connected at 921600 baud
… (succeeds)

Thanks @dfrap I guess this could be our parsing of the COM port here… This is the last one I’ll ask, but what’s the output of this with 0.16?

$ arduino-cli board list 

For me this looks like:

C:\Users\Jan Jongboom>arduino-cli board list
Port Type              Board Name          FQBN                   Core
COM1 Serial Port       Unknown
COM4 Serial Port (USB) Arduino Nano 33 BLE arduino:mbed:nano33ble arduino:mbed

Which gets parsed correctly by the script…

arduino-cli version
arduino-cli.exe Version: 0.13.0 Commit: 693a045
arduino-cli board list
Port Type              Board Name          FQBN                   Core
COM5 Serial Port (USB) Arduino Nano 33 BLE arduino:mbed:nano33ble arduino:mbed

arduino-cli version
arduino-cli.exe alpha Version: 0.16.0 Commit: c977a238 Date: 2021-02-15T09:30:01Z
arduino-cli board list
Port Type              Board Name          FQBN                   Core
COM5 Serial Port (USB) Arduino Nano 33 BLE arduino:mbed:nano33ble arduino:mbed
                       Arduino Nano 33 BLE arduino:mbed:nano33ble arduino:mbed

So it appears that the 0.16 CLI puts out a second line without the port.

Thanks, that’s super helpful! Have communicated this back to Arduino!