[SOLVED] JLink OB reporting incorrect USB max packet size on Linux preventing virtual com port operation

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] JLink OB reporting incorrect USB max packet size on Linux preventing virtual com port operation

    Hello,

    I'm having some issues getting the virtual com port (VCP) working correctly for a Segger J-Link OB connection to a Nordic nRF52840 Preview DK (nordicsemi.com/eng/Products/nRF52840-Preview-DK).

    When connected to the target board using Putty on Windows 10, UART comms via the VCP work correctly when JLink enumerates as a USB high speed device.
    When connected to the target board using Minicom or similar within Linux, UART comms via the VCP don't work if the JLink enumerates as a USB high speed device.
    When connected to the target board using Minicom or similar within Linux, UART comms via the VCP do work if the JLink enumerates as a USB full speed device through a USB hub.

    The following text appears in the dmesg log when the JLink enumerates as USB high speed device.


    [297130.313927] usb 1-1: new high-speed USB device number 65 using ehci-pci
    [297130.539199] usb 1-1: config 1 interface 1 altsetting 0 bulk endpoint 0x83 has invalid maxpacket 64
    [297130.539201] usb 1-1: config 1 interface 1 altsetting 0 bulk endpoint 0x4 has invalid maxpacket 64

    If the information at the following link sourceforge.net/p/libusb/mailman/message/32662224/ is correct, it would appear the JLink is reporting the incorrect max packet size of 64 when enumerated as a USB high speed device. The max packet size should be 512. I suspect this to be the reason that the USB CDC driver in Linux doesn't tranfer any characters to/from the target.

    The 'invalid maxpacket' error doesn't occur when the enumerated as a USB full speed device and USB CDC comms work as expected. Interestingly, the JLink Plus that I have with VCP enabled enumerates with the correct maxpacket size of 512 under Linux (I haven't had a change to test the USB CDC comms using the JLink Plus).

    To help debug this issue please see the attached log outputs. segger-high-speed-usb-issues.txt

    Regards
    Austin
  • Can any one from Segger provide insight into this issue?

    I read the detail of wiki.segger.com/index.php?title=J-Link-OB_SAM3U which I think is likely to be the same issue. This page describes the problem from OS X but the details seem very similar to the problem that I'm seeing under Linux.

    I'd be interested to know if anyone else has come across this issue or can otherwise confirm that nRF52 DK virtual serial port works correctly under linux when using a USB High Speed connection.

    As per the mentioned wiki page I disabled the mass storage device and the incorrect endpoint error messages disappeared. With this change however there was no USB serial port enumerate due to other errors as shown below:


    [587875.176071] usb 2-1: new full-speed USB device number 100 using ohci-pci
    [587875.430895] usb 2-1: not running at top speed; connect to a high speed hub
    [587875.455038] usb 2-1: New USB device found, idVendor=1366, idProduct=0105
    [587875.455040] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
    [587875.455041] usb 2-1: Product: J-Link
    [587875.455042] usb 2-1: Manufacturer: SEGGER
    [587875.455043] usb 2-1: SerialNumber: 000683568900
    [587875.466620] cdc_acm 2-1:1.0: ttyACM0: USB ACM device
    [587896.249678] usb 2-1: USB disconnect, device number 100
    [587896.251746] cdc_acm 2-1:1.0: failed to set dtr/rts
    [587919.256001] usb 1-1: new high-speed USB device number 5 using ehci-pci
    [587924.665401] usb 1-1: unable to read config index 0 descriptor/start: -110
    [587924.665409] usb 1-1: can't read configurations, error -110
    [587924.936049] usb 1-1: new high-speed USB device number 6 using ehci-pci
    [587930.293329] usb 1-1: device descriptor read/all, error -110
    [587930.568122] usb 1-1: new high-speed USB device number 7 using ehci-pci
    [587935.667479] usb 1-1: unable to read config index 0 descriptor/start: -110
    [587935.667487] usb 1-1: can't read configurations, error -110
    [587935.941897] usb 1-1: new high-speed USB device number 8 using ehci-pci
    [587941.046731] usb 1-1: unable to read config index 0 descriptor/start: -110
    [587941.046738] usb 1-1: can't read configurations, error -110


    Austin
  • Hi Austin,


    [297130.313927] usb 1-1: new high-speed USB device number 65 using ehci-pci
    [297130.539199] usb 1-1: config 1 interface 1 altsetting 0 bulk endpoint 0x83 has invalid maxpacket 64
    [297130.539201] usb 1-1: config 1 interface 1 altsetting 0 bulk endpoint 0x4 has invalid maxpacket 64


    I can reproduce this behavior.
    As you have already figured out , this is the expected behavior.

    However, after disabling MSD, I could not reproduce the errors messages
    [587919.256001] usb 1-1: new high-speed USB device number 5 using ehci-pci
    [587924.665401] usb 1-1: unable to read config index 0 descriptor/start: -110
    [587924.665409] usb 1-1: can't read configurations, error -110
    [587924.936049] usb 1-1: new high-speed USB device number 6 using ehci-pci
    [587930.293329] usb 1-1: device descriptor read/all, error -110
    [587930.568122] usb 1-1: new high-speed USB device number 7 using ehci-pci
    [587935.667479] usb 1-1: unable to read config index 0 descriptor/start: -110
    [587935.667487] usb 1-1: can't read configurations, error -110
    [587935.941897] usb 1-1: new high-speed USB device number 8 using ehci-pci
    [587941.046731] usb 1-1: unable to read config index 0 descriptor/start: -110
    [587941.046738] usb 1-1: can't read configurations, error -110


    cdc_adm and J-Link both enumerated fine.


    Best regards,
    Niklas
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Thanks Niklas. I retried my setup with mass storage disabled on my JLink OB and was able to successfully communicate using the VCP.

    You may want to update your wiki page to note that this problem affects Linux systems as well as OS X.

    Regards
    Austin