Skip to content

Atmega4809 Curiosity Nano upload not working under Linux #25

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
Szum123321 opened this issue May 14, 2021 · 5 comments
Open

Atmega4809 Curiosity Nano upload not working under Linux #25

Szum123321 opened this issue May 14, 2021 · 5 comments

Comments

@Szum123321
Copy link

Szum123321 commented May 14, 2021

Hi

I've recently bought the Microchip Atmega4809 Curiosity Nano dev board rev 5. Sadly, uploading doesn't work on Linux.
The error message says:

avrdude: Version 6.3-20201216
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "/home/[user]/.arduino15/packages/MegaCoreX/hardware/megaavr/1.0.8/avrdude.conf"
         User configuration file is "/home/[user]/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping
         Using Port                    : usb
         Using Programmer              : curiosity_updi
avrdude: usbdev_open(): Found nEDBG CMSIS-DAP, serno: ATML3094051800000641
avrdude: usbdev_open(): WARNING: failed to set configuration 1: Device or resource busy
avrdude: Found CMSIS-DAP compliant device, using EDBG protocol
avrdude: usbdev_send(): wrote -5 out of 912 bytes, err = Input/output error
avrdude: jtag3_edbg_prepare(): failed to send command to serial port

The issue occurs on both Arch Linux 5.12.3-arch1-1 and Linux Mint 20.04(i think). I tested both flatpak version 1.8.13 and the normal nightly build 1.8.14 2020.05.12 ide. I also did the test on Windows with ide 1.8.13 and everything worked.

Here is also kernel log when I connect teh device:

[ 6489.927841] usb 1-3: new full-speed USB device number 9 using xhci_hcd
[ 6490.099992] usb 1-3: New USB device found, idVendor=03eb, idProduct=2175, bcdDevice= 1.00
[ 6490.099998] usb 1-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 6490.100001] usb 1-3: Product: nEDBG CMSIS-DAP
[ 6490.100003] usb 1-3: Manufacturer: Microchip Technology Incorporated
[ 6490.100005] usb 1-3: SerialNumber: ATML3094051800000641
[ 6490.172575] hid-generic 0003:03EB:2175.0008: hiddev96,hidraw2: USB HID v1.11 Device [Microchip Technology Incorporated nEDBG CMSIS-DAP] on usb-0000:05:00.3-3/input0
[ 6490.175067] cdc_acm 1-3:1.1: ttyACM0: USB ACM device
[ 6490.181022] usb-storage 1-3:1.4: USB Mass Storage device detected
[ 6490.181177] scsi host0: usb-storage 1-3:1.4
[ 6491.186761] scsi 0:0:0:0: Direct-Access     MCHP     Curiosity Nano   1.00 PQ: 0 ANSI: 3
[ 6491.187483] sd 0:0:0:0: [sda] 4096 512-byte logical blocks: (2.10 MB/2.00 MiB)
[ 6491.188052] sd 0:0:0:0: [sda] Write Protect is off
[ 6491.188056] sd 0:0:0:0: [sda] Mode Sense: 0f 00 00 00
[ 6491.190064] sd 0:0:0:0: [sda] No Caching mode page found
[ 6491.190072] sd 0:0:0:0: [sda] Assuming drive cache: write through
[ 6491.217449]  sda:
[ 6491.221043] sd 0:0:0:0: [sda] Attached SCSI removable disk

And when upload begin:

[ 6502.418058] usb 1-3: usbfs: interface 0 claimed by usbhid while 'avrdude' sets config #1

The same issue has been discussed here, on MegaCoreX github.

@leo60228
Copy link

Have you found a solution for this?

@leo60228
Copy link

This also affects the AVR128DB48 Curiosity Nano (which is expected, seeing as they use the same debugger).

@leo60228
Copy link

I've done some troubleshooting and these lines seem unrelated to the core issue:

avrdude: usbdev_open(): WARNING: failed to set configuration 1: Device or resource busy
[ 6502.418058] usb 1-3: usbfs: interface 0 claimed by usbhid while 'avrdude' sets config #1

They can be worked around by forcing usbhid, usb-storage, and cdc-acm to avoid claiming the device. This requires a kernel patch for the latter, but can be done via kernel flags for the former two. This doesn't seem to do anything other than remove the error message, however.

@leo60228
Copy link

Turns out these can be programmed by copying a .hex file to an emulated mass-storage device, which bypasses avrdude completely.

@Szum123321
Copy link
Author

For now I installed newest version of avrdude from AUR (avrdude-svn) and replaced binary file in ~/.arduino15/packages/arduino/tools/avrdude/6.3.0-arduino18/bin/avrdude with a symlink to /usr/bin/avrdude

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants