USBDM JS16 serial-port pass through with udev on Linux

cancel
Showing results for 
Search instead for 
Did you mean: 

USBDM JS16 serial-port pass through with udev on Linux

Jump to solution
620 Views
Contributor I

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

0 Kudos
1 Solution
15 Views
Senior Contributor V

Hi Ralph,

This page has links to the different versions and a table giving the capabilities.

http://usbdm.sourceforge.net/

This page shows the two JS16 designs - with and without serial.

http://usbdm.sourceforge.net/USBDM_V4.10/USBDM_JS16/html/index.html

It sounds like your unit doesn't have the hardware for the serial interface (level shifters basically).

Note that serial pass through requires additional connects over those provided by the 6-pin BDM connector.

bye

View solution in original post

0 Kudos
3 Replies
15 Views
Senior Contributor V

Hi Ralph,

Which firmware did you program to the JS16.

The CDC is only supported on the versions including "SER" in the name e.g. USBDM_SER_JS16CWJ_V4.sx.

bye

15 Views
Contributor I

Hi pgo, The JS16 came ready-programmed.  That lsusb output (that the forum unhelpfully zip'd) says "iSerial 3 USBDM-JS16-0001", matching https://github.com/podonoghue/usbdm-firmware/blob/master/USBDM_JMxx_V4_10/Configure/USBDM_JS16CWJ.h#... and not https://github.com/podonoghue/usbdm-firmware/blob/master/USBDM_JMxx_V4_10/Configure/USBDM_SER_JS16CW... so that means no CDC.

It's not my JS16 so I'll go back to the provider, not wanting to flash their hardware without permission.  But in theory, does all JS16 hardware support SER firmware?  (That both SER and non-SER firmware exists makes me ask.)

BTW, whilst you're here, two of the man pages in usbdm_4.10.6.180-1-amd64.deb are duplicates of ARM_FlashProgrammer.

$ zgrep -A 1 '^\.SH NAME' usr/share/man/man1/* | grep :ARM_FlashProgrammer

usr/share/man/man1/ARM_FlashProgrammer.1.gz:ARM_FlashProgrammer - USBDM ARM Flash programmer

usr/share/man/man1/FirmwareChanger.1.gz:ARM_FlashProgrammer - USBDM ARM Flash programmer

usr/share/man/man1/JS16_Bootloader.1.gz:ARM_FlashProgrammer - USBDM ARM Flash programmer

$

They're the ones that look useful to me now.  :-)

I'm having trouble getting binary-compatible libraries for the executables on this particular Linux system.  Two suggestions;  static executables would remove a lot of the pain and cover a wider spread of Linux installations without users having to hunt around for the right binary libraries or, worse, building from source.  If WXWidgets is only used for the GUI, then would a GUI-less executable be possible, removing that dependency?  If there's a better place to raise USBDM stuff like this, let me know.

Thanks for the help.  Ralph.

0 Kudos
16 Views
Senior Contributor V

Hi Ralph,

This page has links to the different versions and a table giving the capabilities.

http://usbdm.sourceforge.net/

This page shows the two JS16 designs - with and without serial.

http://usbdm.sourceforge.net/USBDM_V4.10/USBDM_JS16/html/index.html

It sounds like your unit doesn't have the hardware for the serial interface (level shifters basically).

Note that serial pass through requires additional connects over those provided by the 6-pin BDM connector.

bye

View solution in original post

0 Kudos