You are not logged in.

#1 2016-06-17 02:52:26

thonloc
Member
Registered: 2016-06-17
Posts: 6

[SOLVED] PICkit 3 USB Debugger/Programmer not creating /dev/ttyUSB*

I am trying to get my PICkit 3 USB to serial device to appear so I can communicate with it using screen

lsusb shows

Bus 005 Device 003: ID 04d8:900a Microchip Technology, Inc. PICkit3

and dmesg shows

[ 2317.302208] usb 5-2: new full-speed USB device number 3 using xhci_hcd
[ 2317.486582] hid-generic 0003:04D8:900A.0002: hiddev0,hidraw0: USB HID v1.11 Device [Microchip Technology Inc. PICkit 3] on usb-0000:00:10.0-2/input0

but there is no entry in /dev/ for the serial device.
I've had success doing this in Ubuntu (14.04 I think), but none in my Arch Linux 4.6.2-1

I'm not sure where to go from here, any help would be appreciated.

Last edited by thonloc (2016-06-21 21:20:21)

Offline

#2 2016-06-17 03:58:38

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,791

Re: [SOLVED] PICkit 3 USB Debugger/Programmer not creating /dev/ttyUSB*

Are you sure?  Are you looking for /dev/ttyUSBxx ? or have you also looked for /dev/ttyACMxx devices?


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 2016-06-17 04:45:22

thonloc
Member
Registered: 2016-06-17
Posts: 6

Re: [SOLVED] PICkit 3 USB Debugger/Programmer not creating /dev/ttyUSB*

Yeah, I've been trying to figure this out for a couple days now. ls /dev/tty* only shows the standard tty#s and ttyS0-3. My colleague is trying the same thing on her archlinux laptop with the same results.

Offline

#4 2016-06-17 05:27:46

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,523

Re: [SOLVED] PICkit 3 USB Debugger/Programmer not creating /dev/ttyUSB*

As it is listed as HID, it might be a psmouse.
Try to se the difference, in /dev, before and after you plug the device


do it good first, it will be faster than do it twice the saint wink

Offline

#5 2016-06-17 06:06:05

thonloc
Member
Registered: 2016-06-17
Posts: 6

Re: [SOLVED] PICkit 3 USB Debugger/Programmer not creating /dev/ttyUSB*

After plugging in the device, /dev gains the following
/dev/hidraw0
/dev/usb/hiddev0

Offline

#6 2016-06-17 07:02:52

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: [SOLVED] PICkit 3 USB Debugger/Programmer not creating /dev/ttyUSB*

Looks like the device claims to be HID, not serial. What lsusb -v says about it?

Offline

#7 2016-06-17 07:37:08

thonloc
Member
Registered: 2016-06-17
Posts: 6

Re: [SOLVED] PICkit 3 USB Debugger/Programmer not creating /dev/ttyUSB*

Here's the output of lsusb -v

Bus 005 Device 004: ID 04d8:900a Microchip Technology, Inc. PICkit3
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x04d8 Microchip Technology, Inc.
  idProduct          0x900a PICkit3
  bcdDevice            0.02
  iManufacturer           1 Microchip Technology Inc.
  iProduct                2 PICkit 3
  iSerial                 3 BUR152971173
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           41
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      29
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0000
  (Bus Powered)

Any idea why it thinks it is an HID? Or how to change that?

Offline

#8 2016-06-17 08:46:24

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: [SOLVED] PICkit 3 USB Debugger/Programmer not creating /dev/ttyUSB*

Well, those descriptors come from your device. I don't know why your device thinks it is an HID when you want it to be something else tongue

Maybe this HID thing is just a bootloader waiting for some firmware upload? I'd ask Microchip or somebody else who knows how this board works.

I don't know why it behaves differently on Ubuntu. Maybe some udev rules command it to disconnect and reconnect as serial, in one way or another?

Last edited by mich41 (2016-06-17 08:50:13)

Offline

#9 2016-06-17 12:04:20

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,523

Re: [SOLVED] PICkit 3 USB Debugger/Programmer not creating /dev/ttyUSB*

You should investigate in /etc/udev in ubuntu to see if they put some rule in it. But mostly the installation of PicKit will set some new device. Or probably pikdev.


do it good first, it will be faster than do it twice the saint wink

Offline

#10 2016-06-17 18:13:13

thonloc
Member
Registered: 2016-06-17
Posts: 6

Re: [SOLVED] PICkit 3 USB Debugger/Programmer not creating /dev/ttyUSB*

The same two udev rules are made in both Ubuntu and Arch when I install the MPLAB IDE.

z010_mchp_tools.rules

# 2012.01.23 Changed SYSFS reference(s) to ATTR.
# 2011.12.15 Note: Reboot works on all systems to have rules file recognized.
# 2010.01.26 Add reference to "usb" for Ubuntu.
# 2010.01.22 Attempt to further simplify rules files requirements.
# 2009.08.18 Rules file simplified.
# 2009.07.15 Rules file created.

ENV{hotplugscript}="/etc/.mplab_ide/mchplinusbdevice"

ACTION!="add", GOTO="check_remove"
SUBSYSTEM=="usb_device", GOTO="check_add"
SUBSYSTEM!="usb", GOTO="rules_end"

LABEL="check_add"

ATTRS{idVendor}=="04d8", MODE="666", RUN+="%E{hotplugscript} add"
GOTO="rules_end"

LABEL="check_remove"

ACTION=="remove", RUN+="%E{hotplugscript} remove %E{PRODUCT}"

LABEL="rules_end"

z011_mchp_jlink.rules

# 2014.04.10 Rule file created.
# 2014.04.25 Change target file.
# 2014.05.01 Change ENV and label names changed.

ENV{seghotplugscript}="/etc/.mplab_ide/mchpsegusbdevice"

ACTION!="add", GOTO="seg_check_remove"
SUBSYSTEM=="usb_device", GOTO="seg_check_add"
SUBSYSTEM!="usb", GOTO="seg_rules_end"

# ===========================================================================

LABEL="seg_check_add"

ATTR{idVendor}=="1366", GOTO="seg_check_pid"
GOTO="seg_rules_end"

LABEL="seg_check_pid"

ATTRS{idProduct}=="0101", MODE="666", RUN+="%E{seghotplugscript} add"
ATTRS{idProduct}=="0102", MODE="666", RUN+="%E{seghotplugscript} add"
ATTRS{idProduct}=="0103", MODE="666", RUN+="%E{seghotplugscript} add"
ATTRS{idProduct}=="0104", MODE="666", RUN+="%E{seghotplugscript} add"
ATTRS{idProduct}=="0105", MODE="666", RUN+="%E{seghotplugscript} add"
GOTO="seg_rules_end"

# ===========================================================================

LABEL="seg_check_remove"

SUBSYSTEM=="usb_device", GOTO="seg_check_remove_b"
SUBSYSTEM!="usb", GOTO="seg_rules_end"

LABEL="seg_check_remove_b"

ENV{DEVTYPE}=="usb_device", GOTO="seg_check_remove_c"
GOTO="seg_rules_end"

LABEL="seg_check_remove_c"

ACTION=="remove", RUN+="%E{seghotplugscript} remove %E{PRODUCT} %E{DEVTYPE}"

# ===========================================================================

LABEL="seg_rules_end"

Offline

#11 2016-06-17 19:58:04

mich41
Member
Registered: 2012-06-22
Posts: 796

Re: [SOLVED] PICkit 3 USB Debugger/Programmer not creating /dev/ttyUSB*

The first file seems to run

/etc/.mplab_ide/mchplinusbdevice add

every time this device is connected.

I'm not sure how to inspect what happens when udev runs this (and whether it runs it at all), so... what happens if you just run this manually as root? smile

What's the dmesg output from Ubuntu when everything works?

Offline

#12 2016-06-18 06:38:59

TheSaint
Member
From: my computer
Registered: 2007-08-19
Posts: 1,523

Re: [SOLVED] PICkit 3 USB Debugger/Programmer not creating /dev/ttyUSB*

In these script don't appear your productID, try to add it in z011_mchp_jlink.rules


do it good first, it will be faster than do it twice the saint wink

Offline

#13 2016-06-21 21:19:09

thonloc
Member
Registered: 2016-06-17
Posts: 6

Re: [SOLVED] PICkit 3 USB Debugger/Programmer not creating /dev/ttyUSB*

After more testing and research it turns out that my expectations were too high. The PICkit 3 does not actually have the serial capability of its predecessor. Alone it should not create the /dev/ttyUSB*, but when attached to an Uno32 board it does.
Thanks for the help everyone, I'm going to mark this one solved.

Offline

Board footer

Powered by FluxBB