Skip to content

Error message when udev code not configured on Linux is unhelpful #2274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
aliphys opened this issue Aug 23, 2023 · 2 comments
Open
3 tasks done

Error message when udev code not configured on Linux is unhelpful #2274

aliphys opened this issue Aug 23, 2023 · 2 comments
Labels
os: linux Specific to Linux operating system type: imperfection Perceived defect in any part of project

Comments

@aliphys
Copy link

aliphys commented Aug 23, 2023

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

  1. Update the Arduino-cli via brew.
    brew update
    brew upgrade arduino-cli
    
  2. Install the core for the Nicla Sense ME
    arduino-cli core install arduino:mbed_nicla
    
  3. 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
    
  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
    
  5. Upload to the Nicla Sense ME board on the /dev/ttyACM0 port. It is not possible to upload, and we get the exit 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
    
  6. We apply the udev rules as stated at the bottom of this page.
  7. 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
@aliphys aliphys added the type: imperfection Perceived defect in any part of project label Aug 23, 2023
@aliphys
Copy link
Author

aliphys commented Aug 23, 2023

Related issues:

Related forum post:

This Help Centre article is very helpful. However, it does not show up high in google when searching for the error message.
image

@umbynos umbynos added os: macos Specific to macOS operating system os: linux Specific to Linux operating system and removed os: macos Specific to macOS operating system labels Sep 1, 2023
@umbynos
Copy link
Contributor

umbynos commented Sep 1, 2023

We may allow a platform to provide a way to augment the error messages of the uploader, similarly to what's described in #1657

@per1234 per1234 changed the title [AE-127] Error message when udev code not configured on linux is unhelpful Error message when udev code not configured on Linux is unhelpful Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
os: linux Specific to Linux operating system type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants