Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Unable to upload sketch to Arduino Uno board

  1. #1

    Default Unable to upload sketch to Arduino Uno board

    Hi,
    I need to connect to an Arduino board using Arduino IDE. When I plug in the board, it is recognised and a /dev/ttyACM0 is created and available in the Tools menu of the IDE. However whenever I tried to upload a sketch it give the following error:

    Code:
    avrdude: ser_open(): can't open device "/dev/ttyACM0": Input/output error
    I have search on the web and tried the following solution but without success:

    • Add the user to 'dialout' group.
    • Change the permission of /dev/ttyACM0 to 666.
    • Disable/Stop ModemManager service.


    There was a discussion in one Arch based forum about kernel issues. So I booted into my Kubuntu installation that runs kernel 5.8 and ran the same sketch and it works without any problem. So I tested again with another distro - Garuda Linux (Arch based) also worked without any problem. This was running kernel 5.11.17. So the I deduced that the problem could be just the Tumbleweed kernel.

    Then I checked for kernel messages and found this:
    Code:
    May 04 17:31:01 venks-lappy kernel: cdc_acm 3-1.1.3:1.0: acm_port_activate - usb_submit_urb(ctrl irq) failed
    At the moment I am running the latest kernel - 5.12.0.2 also without any success.

    Any help, guidance or solutions are most welcome. I don't want to boot into Kubuntu just to do this as I am happy with Tumbleweed.

  2. #2
    Join Date
    Oct 2014
    Location
    Rotterdam
    Posts
    471

    Default Re: Unable to upload sketch to Arduino Uno board

    That is a tough one...

    One question: That kernel message timestamp, is that the same time you tried to upload a sketch or was it triggered earlier/later?

  3. #3

    Default Re: Unable to upload sketch to Arduino Uno board

    It happened at the same time and everytime I tried uploading.

  4. #4
    Join Date
    Oct 2014
    Location
    Rotterdam
    Posts
    471

    Default Re: Unable to upload sketch to Arduino Uno board

    Okay, not sure if it helps but I connected a board, did run Arduino 1.8.9 and uploaded a sketch successfully and below I what I see:

    When I connect the board dmesg shows:
    Code:
    [20270.041272] usb 2-3: New USB device found, idVendor=239a, idProduct=800b, bcdDevice= 1.00 
    [20270.041277] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3 
    [20270.041279] usb 2-3: Product: Feather M0 
    [20270.041280] usb 2-3: Manufacturer: Adafruit 
    [20270.041282] usb 2-3: SerialNumber: 530C7DD4514D503259202020FF181733 
    [20270.055549] cdc_acm 2-3:1.0: ttyACM0: USB ACM device 
    [20270.056246] usbcore: registered new interface driver cdc_acm 
    [20270.056249] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
    Checking things:
    Code:
    $ ls -als /dev/ttyACM0
    0 crw-rw---- 1 root dialout 166, 0 May  5 13:27 /dev/ttyACM0
    $ groups             
    users docker wireshark dialout
    Once I uploaded the sketch I see in dmesg that the board disconnects and connects again.

    Code:
    [20414.304328] usb 2-3: USB disconnect, device number 11 
    [20415.077516] usb 2-3: new full-speed USB device number 12 using xhci_hcd 
    [20415.226116] usb 2-3: New USB device found, idVendor=239a, idProduct=000b, bcdDevice= 2.00 
    [20415.226122] usb 2-3: New USB device strings: Mfr=0, Product=0, SerialNumber=0 
    [20415.227773] cdc_acm 2-3:1.0: ttyACM0: USB ACM device 
    [20417.696988] usb 2-3: USB disconnect, device number 12 
    [20418.481531] usb 2-3: new full-speed USB device number 13 using xhci_hcd 
    [20418.636490] usb 2-3: New USB device found, idVendor=239a, idProduct=800b, bcdDevice= 1.00 
    [20418.636508] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3 
    [20418.636515] usb 2-3: Product: Feather M0 
    [20418.636520] usb 2-3: Manufacturer: Adafruit 
    [20418.636525] usb 2-3: SerialNumber: 530C7DD4514D503259202020FF181733 
    [20418.641195] cdc_acm 2-3:1.0: ttyACM0: USB ACM device
    Do you see any significant differences?

  5. #5

    Default Re: Unable to upload sketch to Arduino Uno board

    This is what I get in 'dmesg -w' when I plugin the board and then try to connect serial monitor from Arduino IDE...

    Code:
    [55305.245690] usb 3-1.1.3: new full-speed USB device number 30 using xhci_hcd
    [55305.497743] usb 3-1.1.3: New USB device found, idVendor=2341, idProduct=0043, bcdDevice= 0.01
    [55305.497749] usb 3-1.1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=220
    [55305.497750] usb 3-1.1.3: Manufacturer: Arduino (www.arduino.cc)
    [55305.497752] usb 3-1.1.3: SerialNumber: 757353230303518001E1
    [55305.537975] cdc_acm 3-1.1.3:1.0: ttyACM0: USB ACM device
    [55317.312996] cdc_acm 3-1.1.3:1.0: acm_port_activate - usb_submit_urb(ctrl irq) failed  <<== Me trying to connect the serial monitor
    [55333.912743] cdc_acm 3-1.1.3:1.0: acm_port_activate - usb_submit_urb(ctrl irq) failed  <<== Me trying to connect the serial monitor
    

  6. #6
    Join Date
    Oct 2014
    Location
    Rotterdam
    Posts
    471

    Default Re: Unable to upload sketch to Arduino Uno board

    So you do not see the two lines after "ttyACM0: USB ACM device" that I see:
    Code:
    [20270.056246] usbcore: registered new interface driver cdc_acm
    [20270.056249] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
    If so, that might be the reason your are running into a problem.
    Also to double check: the rights on /dev/ttyACM0 are matching and you are member of the dailout group?

  7. #7

    Default Re: Unable to upload sketch to Arduino Uno board

    Quote Originally Posted by marel View Post
    Also to double check: the rights on /dev/ttyACM0 are matching and you are member of the dailout group?
    Already tried as I have mentioned on the first post.

  8. #8
    Join Date
    Oct 2014
    Location
    Rotterdam
    Posts
    471

    Default Re: Unable to upload sketch to Arduino Uno board

    Okay, that leave the two lines missing.

    Can you check if the cdc_acm is loaded and used by used bu usbcore:
    Code:
    lsmod | grep cdc_acm      
    cdc_acm                45056  0 
    usbcore               323584  14 xhci_hcd,ehci_pci,snd_usb_audio,usbhid,snd_usbmidi_lib,cdc_acm,usb_storage,uvcvideo,ehci_hcd,btusb,xhci_pci,uas
    I think that is not the case.

    Please provide also the output of "usb-devices" for the Arduino device.

  9. #9

    Default Re: Unable to upload sketch to Arduino Uno board

    Here is the output of lsmod:
    Code:
    cdc_acm                45056  0
    usbcore               323584  6 xhci_hcd,usbhid,cdc_acm,uvcvideo,btusb,xhci_pci
    


    This is the output of lsusb:
    Code:
    Bus 004 Device 002: ID 05e3:0620 Genesys Logic, Inc. USB3.2 Hub
    Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 003 Device 005: ID 048d:c100 Integrated Technology Express, Inc. ITE Device(8910)
    Bus 003 Device 003: ID 8087:0029 Intel Corp. AX200 Bluetooth
    Bus 003 Device 006: ID 24ae:1813 Shenzhen Rapoo Technology Co., Ltd. E9260 Wireless Multi-mode Keyboard
    Bus 003 Device 007: ID 046d:c077 Logitech, Inc. M105 Optical Mouse
    Bus 003 Device 009: ID 2341:0043 Arduino SA Uno R3 (CDC ACM)
    Bus 003 Device 004: ID 1a40:0101 Terminus Technology Inc. Hub
    Bus 003 Device 002: ID 05e3:0610 Genesys Logic, Inc. Hub
    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 003: ID 048d:c955 Integrated Technology Express, Inc. ITE Device(8295)
    Bus 001 Device 002: ID 13d3:56ff IMC Networks Integrated Camera
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    

  10. #10
    Join Date
    Oct 2014
    Location
    Rotterdam
    Posts
    471

    Default Re: Unable to upload sketch to Arduino Uno board

    As cdc_acm is used by usbcore, I think those two lines missing in the dmesg output are not relevant.

    "usb-devices" is a command that dumps detailed information about all USB devices, for me it gives for the Arduino board:

    Code:
    T:  Bus=03 Lev=01 Prnt=01 Port=02 Cnt=05 Dev#= 11 Spd=12  MxCh= 0
    D:  Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs=  1
    P:  Vendor=239a ProdID=800b Rev=01.00
    S:  Manufacturer=Adafruit
    S:  Product=Feather M0
    S:  SerialNumber=530C7DD4514D503259202020FF181733
    C:  #Ifs= 2 Cfg#= 1 Atr=a0 MxPwr=100mA
    I:  If#=0x0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=02 Prot=00 Driver=cdc_acm
    I:  If#=0x1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_acm
    Searching for the problem I found Bug 1950958 - cdc_acm acm_port_activate usb_submit_urb(ctrl irq) failed.

    My Tubleweed is reporting ("uname -r") 5.11.15-1-default so I guess you are having something like that. Seems like the 5.13 kernel will fix it.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •