Open
Description
Describe the problem
It is required to configure the udev code in Linux to provide access to the Serial port. Otherwise, it is not possible to upload sketches to the Arduino board.
Given that configuring the udev rules is essential, then most (all?) linux users will face this issue. For new users, this could be especially difficult to figure out.
To reproduce
- Update the Arduino-cli via brew.
brew update brew upgrade arduino-cli
- Install the core for the Nicla Sense ME
arduino-cli core install arduino:mbed_nicla
- Compile a sketch (using this as an example)
user@user-laptop:~/github/nicla-sense-me-fw$ arduino-cli compile --fqbn arduino:mbed_nicla:nicla_sense Arduino_BHY2/examples/BHYFirmwareUpdate Sketch uses 259384 bytes (49%) of program storage space. Maximum is 527616 bytes. Global variables use 10768 bytes (16%) of dynamic memory, leaving 53520 bytes for local variables. Maximum is 64288 bytes. Used platform Version Path arduino:mbed_nicla 4.0.4 /home/user/.arduino15/packages/arduino/hardware/mbed_nicla/4.0.4
- Identify the serial port for the connected Nicla Sense ME board
user@user-laptop:~/github/nicla-sense-me-fw$ arduino-cli board list Port Protocol Type Board Name FQBN Core /dev/ttyACM0 serial Serial Port (USB) Arduino Nicla Sense ME arduino:mbed_nicla:nicla_sense arduino:mbed_nicla
- Upload to the Nicla Sense ME board on the
/dev/ttyACM0
port. It is not possible to upload, and we get theexit status 1 error
user@user-laptop:~/github/nicla-sense-me-fw$ arduino-cli upload --port /dev/ttyACM0 --fqbn arduino:mbed_nicla:nicla_sense Arduino_BHY2/examples/BHYFirmwareUpdate Open On-Chip Debugger 0.11.0+dev-gab95bac57-dirty (2021-05-11-10:49) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html debug_level: 0adapter speed: 1000 kHzError: unable to open CMSIS-DAP device 0x2341:0x60 Error: unable to find a matching CMSIS-DAP deviceFailed uploading: uploading error: exit status 1
- We apply the udev rules as stated at the bottom of this page.
- It is now possible to upload the sketch
user@user-laptop:~/github/nicla-sense-me-fw$ arduino-cli upload --port /dev/ttyACM0 --fqbn arduino:mbed_nicla:nicla_sense Arduino_BHY2/examples/BHYFirmwareUpdate Open On-Chip Debugger 0.11.0+dev-gab95bac57-dirty (2021-05-11-10:49) Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html debug_level: 0 adapter speed: 1000 kHz target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x00006dd0 msp: 0x20010000 target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x00006dd0 msp: 0x20010000 ** Programming Started ** ** Programming Finished ** shutdown command invoked New upload port: /dev/ttyACM0 (serial)
Expected behavior
The user is informed of this issue when error occur. Something like If using a Linux OS, make sure that the udev rules are configured correctly to enable access to the Serial port. See https://support.arduino.cc/hc/en-us/articles/9005041052444-Fix-udev-rules-on-Linux for more information
Arduino CLI version
0.34
Operating system
Linux
Operating system version
Ubuntu 22.04.03 LTS
Additional context
No response
Issue checklist
- I searched for previous reports in the issue tracker
- I verified the problem still occurs when using the nightly build
- My report contains all necessary details