You are not logged in.

#1 2019-02-10 02:31:55

Martinsos
Member
From: Croatia
Registered: 2015-08-27
Posts: 59

[SOLVED] ttyACM0 does not appear when I connect atmega

Hi all,
I am trying to flash a microcontroller (atmega32u4), however I can't get it to create a port in /dev.
I am connecting with with USB C cable.

I can confirm with lsusb that it appears:
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 0424:5734 Standard Microsystems Corp.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 04f3:24a0 Elan Microelectronics Corp.
Bus 001 Device 004: ID 0cf3:e300 Qualcomm Atheros Communications
Bus 001 Device 008: ID 0424:274c Standard Microsystems Corp.
Bus 001 Device 006: ID 046d:c534 Logitech, Inc. Unifying Receiver
Bus 001 Device 003: ID 0424:2734 Standard Microsystems Corp.
Bus 001 Device 007: ID 0c45:6713 Microdia
Bus 001 Device 010: ID 03eb:2ff4 Atmel Corp. atmega32u4 DFU bootloader
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I do ls /dev/tty* and there is no new device appearing.

I added udev rule specifically for this atmega, like this:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff4", MODE:="0666", SYMLINK+="mcu/atmega32u4-%k"

and while that symlink is created, I can't use it for flashing because flashing tool complaints it is not right type of device. I am pretty sure that is because it is not being mounted as ACM device. Symlink that gets created points to /dev/bus/usb/001/029 .

So lsusb can see it, udev can see it, but it does not get mounted in the correct way.
I also added my user to uucp, lock and tty groups, as suggested somewhere.

I also tried loading cdc_acm module as that allegedly helps sometimes, however nothing changed. I did this with `modprobe cdc_acm` and could confirm with lsmod that it was loaded.

I believe the main problem is that my atmega is not mounted as /dev/ttyACM0 when I plug it in, because all my research on internet has shown that everybody has it mounted that way, and that is how it should be.

Thanks for any help!
Linux ArchDell 4.20.7-arch1-1-ARCH x86_64

Last edited by Martinsos (2019-02-11 10:33:40)

Offline

#2 2019-02-10 03:42:59

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 16,702

Re: [SOLVED] ttyACM0 does not appear when I connect atmega

What are the output of uname -a and pacman -Q linux   ?
Checking that the running kernel can find its modules.
Also, what gets posted to the journal when you connect the device?


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2019-02-10 10:10:51

Martinsos
Member
From: Croatia
Registered: 2015-08-27
Posts: 59

Re: [SOLVED] ttyACM0 does not appear when I connect atmega

uname -a:
Linux ArchDell 4.20.7-arch1-1-ARCH #1 SMP PREEMPT Wed Feb 6 18:42:40 UTC 2019 x86_64 GNU/Linux

pacman -Q linux:
linux 4.20.7.arch1-1

Messages when I connect device:
dmesg:
[  128.555787] usb 1-1: new full-speed USB device number 9 using xhci_hcd
[  128.698414] usb 1-1: New USB device found, idVendor=03eb, idProduct=2ff4, bcdDevice= 0.00
[  128.698421] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  128.698426] usb 1-1: Product: ATm32U4DFU
[  128.698430] usb 1-1: Manufacturer: ATMEL
[  128.698434] usb 1-1: SerialNumber: 1.0.0

journalctl:
Feb 10 11:07:47 ArchDell kernel: usb 1-1: new full-speed USB device number 11 using xhci_hcd
Feb 10 11:07:47 ArchDell kernel: usb 1-1: New USB device found, idVendor=03eb, idProduct=2ff4, bcdDevice= 0.00
Feb 10 11:07:47 ArchDell kernel: usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Feb 10 11:07:47 ArchDell kernel: usb 1-1: Product: ATm32U4DFU
Feb 10 11:07:47 ArchDell kernel: usb 1-1: Manufacturer: ATMEL
Feb 10 11:07:47 ArchDell kernel: usb 1-1: SerialNumber: 1.0.0
Feb 10 11:07:49 ArchDell dbus-daemon[538]: [system] Activating via systemd: service name='org.freedesktop.Avahi' unit='dbus-org.freedesktop.Avahi.service' requested by ':1.303' (uid=976 pid=3854 comm="/usr/lib/colord-sane ")
Feb 10 11:07:49 ArchDell dbus-daemon[538]: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.Avahi.service': Unit dbus-org.freedesktop.Avahi.service not found.

Offline

#4 2019-02-10 10:52:42

Martinsos
Member
From: Croatia
Registered: 2015-08-27
Posts: 59

Re: [SOLVED] ttyACM0 does not appear when I connect atmega

I have dual boot with Windows so I also tried doing the flashing from Windows and there it works! That eliminates the problem with cable / hardware.
Extra info: On Windows USB is recognized but no drivers are found, so I downloaded Flip from Atmel, used that as driver and then it works.

Offline

#5 2019-02-10 13:04:14

stronnag
Member
Registered: 2011-01-25
Posts: 54

Re: [SOLVED] ttyACM0 does not appear when I connect atmega

I suspect your device is connecting in DFU mode (from the name, and the lack of /dev/ttyACM0).

In this case, you can use `sudo dfu-util -l` to 'see' the device, and appropriate dfu-util options to flash it.

Offline

#6 2019-02-10 14:57:50

Martinsos
Member
From: Croatia
Registered: 2015-08-27
Posts: 59

Re: [SOLVED] ttyACM0 does not appear when I connect atmega

Thanks @stronnag, I tried that but nothing is listed, this is the output:

dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Offline

#7 2019-02-10 22:19:24

dmartins
Member
Registered: 2006-09-23
Posts: 360

Re: [SOLVED] ttyACM0 does not appear when I connect atmega

What is your hardware setup? A link to the product page or documentation might turn up some clues.
Edit: however, to me it doesn't look like the 32u4 should not show up as a serial port. This chip has USB support and most dev boards come with the DFU bootloader preinstalled. This would appear to be the case here since it is registering as a USB device.

You could try dfu-programmer if dfu-util did not work. Make sure you are running this utilities as root


dfu-programmer atmega32u4 get ID1
or
dfu-programmer atmega32u4 get --debug 1000 ID1

Last edited by dmartins (2019-02-10 22:49:36)

Offline

#8 2019-02-11 10:28:37

Martinsos
Member
From: Croatia
Registered: 2015-08-27
Posts: 59

Re: [SOLVED] ttyACM0 does not appear when I connect atmega

@dmartins thanks, I managed to to figure out to some extent what is happening in the meantime luckily!

So the board in question is Postage Board: https://github.com/LifeIsOnTheWire/Postage-Board . Documentation is however somewhat lacking (at least I found it so).

The big "breakthrough" I had was that I managed to get it working with dfu-programmer yesterday, even though I did not manage to mount it in any different way in /dev. So I did nothing special, just used dfu-programmer and it worked.

What I learned on reddit today:
- It works with dfu-programmer, not dfu-util - the latter is for boards with STM chips and the former is for your atmega32u4's DFU bootloader.
- The Postage Board uses the DFU bootloader instead of the Caterina bootloader that the Pro Micros use, so it doesn't show up as a TTY device.

So summary would be:
I learned that Postage Board is not supposed to turn up as tty device because it has DFU bootloader (and not Caterina bootloader as e.g. ProMicro).
DFU bootloader it uses is also the reason why it does not work with dfu-utils, because dfu-utils expects some other type of DFU bootloader.
It works with dfu-programmer though, so I can use that.
So there is no problem with Archlinux at all, it was me having wrong expectations from the board and missing knowledge on bootloaders and tools.

I would still love to hear any helpful opinions or advice here, as to how I should have approached this differently or maybe some additional explanations, but I will mark post as solved in the meantime.
Thanks a lot all!

Last edited by Martinsos (2019-02-11 10:32:31)

Offline

Board footer

Powered by FluxBB