AnsweredAssumed Answered

USBDM JS16 serial-port pass through with udev on Linux

Question asked by Ralph Corderoy on Oct 12, 2014

Hi,

 

I'm working towards having http://usbdm.sourceforge.net/ program an MC9S08 using a USBDM JS16 on Linux x86_64.

 

The JS16 USB device presents one interface descriptor with two endpoints; see attached `lsusb' output.  If https://github.com/podonoghue/usbdm-firmware/blob/master/USBDM_JMxx_V4_10/Sources/USB.c#L162 is the right place, that means HW_CAPABILITY does not have CAP_CDC capability.

 

I've been told that the JS16 provides a pass-through `serial port' interface separate from the BDM control and I'm trying to get the relevant device to appear under Linux.  Is CAP_CDC needed for this, or is it possible with the JS16's USB firmware that I have?

 

USBDM's own usbdm_4.10.6.180-1-amd64.deb has usr/share/usbdm/usbdm.rules with lines that would match this 16d0:0567 device.

 

ATTR{idVendor}=="16d0", ATTR{idProduct}=="0567", SYMLINK+="usbdm%n", MODE:="0666"

ATTR{idVendor}=="16d0", ATTR{idProduct}=="0567", SYMLINK+="usbdm%n", MODE:="0666" [sic; duplicate]

#

# Allow unrestricted access to USBDM CDC serial port (named ttyUsbdm0 ...)

#KERNEL=="tty*", ATTRS{idVendor}=="16d0", MODE="0666", SYMLINK+="ttyUsbdm%n"

SUBSYSTEM=="tty", ATTRS{idVendor}=="16d0", MODE="0666", SYMLINK+="ttyUsbdm%n"

 

udevd's logging shows it uses the first rule, doing "creating symlink '/dev/usbdm1' to 'bus/usb/002/013'", and attempts a "/sbin/modprobe -bv usb:v16D0p0567d0410dcFFdscFFdpFFicFFiscFFipFF", which fails as no module claims to handle that.

 

The second SUBSYSTEM-tty rule isn't acted upon.  I'm not too sure what would cause udev to set the SUBSYSTEM to tty, but the comment suggests I'd only expect a serial port with CDC;  is that true?

 

Opening /dev/usbdm1, I get sent binary, which I assume is the start of a BDC handshake.

 

$ cu -l /dev/usbdm1 -s 9600 dir </dev/null | hd

cu: End of file on terminal

00000000  12 01 00 02 ff ff ff 20  d0 16 67 05 10 04 01 02  |....... ..g.....|

00000010  03 01 09 02 20 00 01 01  00 80 fa 09 04 00 00 02  |.... ...........|

00000020  ff ff ff 05 07 05 01 02  40 00 01 07 05 82 02 40  |........@......@|

00000030  00 00 07 43 6f 6e 6e 65  63 74 65 64 2e 0a 07 43  |...Connected...C|

00000040  6f 6e 6e 65 63 74 65 64  2e 0a 0a 07 44 69 73 63  |onnected....Disc|

*

00000050

 

I'm thinking this JS16 doesn't provide serial-port pass through.  Could its hardware with appropriate firmware, or is that not something the JS16 can do?  Or is my Linux configuration wrong, so I'm just missing the appropriate /dev entry?

 

Freescale, USBDM, BDC, and JS16 are all new to me, so apologies if these are obvious questions.

 

Thanks, Ralph.

Original Attachment has been moved to: lsusb.zip

Outcomes