Author Topic: DigiUSB driver problem under Linux  (Read 6458 times)

pirlouwi

  • Newbie
  • *
  • Posts: 19
DigiUSB driver problem under Linux
« on: May 17, 2014, 12:05:05 am »
I have put the "49-micronucleus.rules" and "50-digispark.rules" in my /etc/udev/rules.d directory, and restarted udev service.
But I still cannot run the "echo" sketch.

Here are the syslog traces while plugging my Digispark in:

Quote
May 17 08:47:28 portaap kernel: [46970.835256] usb 3-3: >new low-speed USB device number 52 using xhci_hcd
May 17 08:47:28 portaap kernel: [46970.835269] xhci_hcd 0000:00:14.0: >ERROR: unexpected command completion code 0x0.
May 17 08:47:29 portaap kernel: [46971.060465] usb 3-3: >New USB device found, idVendor=16d0, idProduct=0753
May 17 08:47:29 portaap kernel: [46971.060471] usb 3-3: >New USB device strings: Mfr=0, Product=0, SerialNumber=0
May 17 08:47:29 portaap mtp-probe: checking bus 3, device 52: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-3"
May 17 08:47:29 portaap mtp-probe: bus: 3, device: 52 was not an MTP device
May 17 08:47:33 portaap kernel: [46975.809435] usb 3-3: >USB disconnect, device number 52
May 17 08:47:37 portaap kernel: [46979.098785] usb 3-3: >new low-speed USB device number 53 using xhci_hcd
May 17 08:47:37 portaap kernel: [46979.098798] xhci_hcd 0000:00:14.0: >ERROR: unexpected command completion code 0x0.
May 17 08:47:37 portaap kernel: [46979.328029] usb 3-3: >New USB device found, idVendor=16d0, idProduct=0753
May 17 08:47:37 portaap kernel: [46979.328036] usb 3-3: >New USB device strings: Mfr=0, Product=0, SerialNumber=0
May 17 08:47:37 portaap mtp-probe: checking bus 3, device 53: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-3"
May 17 08:47:37 portaap mtp-probe: bus: 3, device: 53 was not an MTP device
May 17 08:47:42 portaap kernel: [46984.143856] usb 3-3: >USB disconnect, device number 53
May 17 08:47:45 portaap kernel: [46987.434302] usb 3-3: >new low-speed USB device number 54 using xhci_hcd
May 17 08:47:45 portaap kernel: [46987.434315] xhci_hcd 0000:00:14.0: >ERROR: unexpected command completion code 0x0.
May 17 08:47:45 portaap kernel: [46987.661610] usb 3-3: >New USB device found, idVendor=16d0, idProduct=0753
May 17 08:47:45 portaap kernel: [46987.661617] usb 3-3: >New USB device strings: Mfr=0, Product=0, SerialNumber=0
May 17 08:47:45 portaap mtp-probe: checking bus 3, device 54: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-3"
May 17 08:47:45 portaap mtp-probe: bus: 3, device: 54 was not an MTP device

My device can be programmed without errors.
But I never see the 16c0:05df usb device enumeration, so I cannot use the DigiUSB functionnalities.

Could you give me support on this?

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: DigiUSB driver problem under Linux
« Reply #1 on: May 17, 2014, 12:22:28 am »
scan the forum- I don't do Linux, but something caught my eye about start up timing and a device being recognized just this week, may not have been new but I think it may relate.  hopefully it was this forum

pirlouwi

  • Newbie
  • *
  • Posts: 19
Re: DigiUSB driver problem under Linux
« Reply #2 on: May 17, 2014, 12:34:46 am »
Nothing this week ??.
I found this thread, which is about 1 year old:
http://digistump.com/board/index.php/topic,289.msg3520.html#msg3520

I don't know if this is related.
BTW, how can I check the firmware version on my device?

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: DigiUSB driver problem under Linux
« Reply #3 on: May 18, 2014, 04:25:41 pm »
'I was looking just this week' - what I saw was older - it might have been this that I saw: http://digistump.com/board/index.php/topic,1360.msg6183.html#msg6183

When I did "Search results for: linux device" that and 29 other items came up.  Not sure if any might be relevant.

gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: DigiUSB driver problem under Linux
« Reply #4 on: May 19, 2014, 01:30:55 am »
Which linux distribution you are using? 32 or 64 bit?
Can you post the content of both rules files
What is the output of udevadm monitor running in a root terminal window, while you connect the digispark?

pirlouwi

  • Newbie
  • *
  • Posts: 19
Re: DigiUSB driver problem under Linux
« Reply #5 on: May 19, 2014, 01:58:30 am »
I am using Linux Mint 14 Cinnamon 64bit,
Quote
Linux portaap 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:31:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux


The output of udevadm monitor (when only programming the digiblink sketch in my Digispark rev3 and plugging it in an USB2 port):

Quote
KERNEL[89153.645252] add      /devices/pci0000:00/0000:00:14.0/usb3/3-3 (usb)
KERNEL[89153.645730] add      /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0 (usb)
UDEV  [89153.666368] add      /devices/pci0000:00/0000:00:14.0/usb3/3-3 (usb)
UDEV  [89153.669632] add      /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0 (usb)
KERNEL[89155.945081] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0 (usb)
KERNEL[89155.945464] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-3 (usb)
UDEV  [89155.945820] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0 (usb)
UDEV  [89155.954338] remove   /devices/pci0000:00/0000:00:14.0/usb3/3-3 (usb)
KERNEL[89158.962660] add      /devices/pci0000:00/0000:00:14.0/usb3/3-3 (usb)
KERNEL[89158.963630] add      /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0 (usb)
KERNEL[89158.965850] add      /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0/0003:16C0:05DF.0011 (hid)
KERNEL[89158.966892] add      /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0/usb/hiddev1 (usb)
KERNEL[89158.966979] add      /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0/0003:16C0:05DF.0011/hidraw/hidraw2 (hidraw)
UDEV  [89158.982300] add      /devices/pci0000:00/0000:00:14.0/usb3/3-3 (usb)
UDEV  [89158.983391] add      /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0 (usb)
UDEV  [89158.984482] add      /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0/0003:16C0:05DF.0011 (hid)
UDEV  [89158.985213] add      /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0/0003:16C0:05DF.0011/hidraw/hidraw2 (hidraw)
UDEV  [89158.985499] add      /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0/usb/hiddev1 (usb)

Quote
$ cat /etc/udev/rules.d/49-micronucleus.rules
# UDEV Rules for Micronucleus boards including the Digispark.
# This file must be placed at:
#
# /etc/udev/rules.d/49-micronucleus.rules    (preferred location)
#   or
# /lib/udev/rules.d/49-micronucleus.rules    (req'd on some broken systems)
#
# After this file is copied, physically unplug and reconnect the board.
#
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0753", MODE:="0666"
KERNEL=="ttyACM*", ATTRS{idVendor}=="16d0", ATTRS{idProduct}=="0753", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1"
#
# If you share your linux system with other users, or just don't like the
# idea of write permission for everybody, you can replace MODE:="0666" with
# OWNER:="yourusername" to create the device owned by you, or with
# GROUP:="somegroupname" and mange access using standard unix groups.

Quote
$ cat /etc/udev/rules.d/50-digispark.rules
# UDEV Rules for DigiUSB library.
# This is required to use the DigiUSB library even if you installed the udev rules for the Digispark/Micronucleus
# This file must be placed at:
#
# /etc/udev/rules.d/50-digispark.rules    (preferred location)
#   or
# /lib/udev/rules.d/50-digispark.rules    (req'd on some broken systems)
#
# After this file is copied, physically unplug and reconnect the board.
#

# For usage as usb device (5s after connect to usb bus)
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05df", MODE:="0666"
KERNEL=="ttyACM*", ATTRS{idVendor}=="16c0", ATTRS{idProduct}=="05df", MODE:="0666", ENV{ID_MM_DEVICE_IGNORE}="1"


#
# If you share your linux system with other users, or just don't like the
# idea of write permission for everybody, you can replace MODE:="0666" with
# OWNER:="yourusername" to create the device owned by you, or with
# GROUP:="somegroupname" and mange access using standard unix groups.

Thanks for support

gogol

  • Sr. Member
  • ****
  • Posts: 398
Re: DigiUSB driver problem under Linux
« Reply #6 on: May 19, 2014, 08:18:31 am »
Hi,

the output of the programming part looks good.

That looks on my most identical system (ubuntu 14.04 x64) like that:
Code: [Select]
KERNEL[3566.961654] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-1 (usb)
KERNEL[3566.964602] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0 (usb)
UDEV  [3566.970378] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-1 (usb)
UDEV  [3566.972238] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0 (usb)
KERNEL[3568.124513] remove   /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0 (usb)
UDEV  [3568.125734] remove   /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0 (usb)
KERNEL[3568.127677] remove   /devices/pci0000:00/0000:00:1d.0/usb6/6-1 (usb)
UDEV  [3568.127749] remove   /devices/pci0000:00/0000:00:1d.0/usb6/6-1 (usb)
KERNEL[3569.332531] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-1 (usb)
KERNEL[3569.335266] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0 (usb)
UDEV  [3569.345545] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-1 (usb)
UDEV  [3569.349402] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0 (usb)
KERNEL[3571.844392] remove   /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0 (usb)
UDEV  [3571.845730] remove   /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0 (usb)
KERNEL[3571.850708] remove   /devices/pci0000:00/0000:00:1d.0/usb6/6-1 (usb)
UDEV  [3571.850794] remove   /devices/pci0000:00/0000:00:1d.0/usb6/6-1 (usb)
KERNEL[3574.751519] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-1 (usb)
KERNEL[3574.754278] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0 (usb)
KERNEL[3574.763837] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0/0003:16C0:05DF.0002 (hid)
KERNEL[3574.767445] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0/usbmisc/hiddev2 (usbmisc)
KERNEL[3574.767740] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0/0003:16C0:05DF.0002/hidraw/hidraw0 (hidraw)
UDEV  [3574.773952] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-1 (usb)
UDEV  [3574.777043] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0 (usb)
UDEV  [3574.781215] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0/0003:16C0:05DF.0002 (hid)
UDEV  [3574.783942] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0/0003:16C0:05DF.0002/hidraw/hidraw0 (hidraw)
UDEV  [3574.788528] add      /devices/pci0000:00/0000:00:1d.0/usb6/6-1/6-1:1.0/usbmisc/hiddev2 (usbmisc)

So it should be ok, the device enumeration takes place!

Can you post a more detailed description, which code you are running on the digispark, which code runs on the host?


pirlouwi

  • Newbie
  • *
  • Posts: 19
Re: DigiUSB driver problem under Linux
« Reply #7 on: May 20, 2014, 02:13:08 pm »
The code on the host is the one given by Digistump:
monitor.c
receive.c
send.c

The code on the target is simply:
initializing DigiUSB, and use the USB functionalities.