Full-speed usb

This forum covers PCAN-Linux and Linux development issues concerning our products
Post Reply
Christian_
Posts: 5
Joined: Wed 24. Apr 2019, 14:59

Full-speed usb

Post by Christian_ » Wed 24. Apr 2019, 15:19

Hi all

We have several PCAN-USB Pro FD interfaces, which all work great on both Windows and Linux.

Now we are forced to use the interface in full-speed USB mode (in contrary to the default high-speed mode).

The USB LED is green in high-speed mode and turns red / orange when we change to full-speed mode - in accordance with the product manual.

We use socketcan to transmit messages. In high-speed mode, this works great. In low-speed mode, no messages enter the bus. We use a second PCAN-USB Pro FD interface to sniff the traffic.

We use the same machine, same USB port and same socketcan commands in both cases (we change a kenel setting a reboot to force full-speed mode). The CAN1/2 LEDs on the interface remain green in both cases while transmitting.

We start the interface with "ip link set can0 up type can bitrate 250000" and transmit messages with e.g "cansend can0 01a#11223344AABBCCDD". In high-speed mode, the messages are immediately received by the sniffer interface. In full-speed mode we never receive any messages.

Link status shows that messages have been transmitted:

Code: Select all

ip -s -d link show can0
3: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 10
    link/can  promiscuity 0
    can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
          bitrate 250000 sample-point 0.875
          tq 25 prop-seg 69 phase-seg1 70 phase-seg2 20 sjw 1
          pcan_usb_pro_fd: tseg1 1..256 tseg2 1..128 sjw 1..128 brp 1..1024 brp-inc 1
          pcan_usb_pro_fd: dtseg1 1..32 dtseg2 1..16 dsjw 1..16 dbrp 1..1024 dbrp-inc 1
          clock 80000000
          re-started bus-errors arbit-lost error-warn error-pass bus-off
          0          0          0          0          0          0         numtxqueues 1 gso_max_size 65536 gso_max_segs 65535
    RX: bytes  packets  errors  dropped overrun mcast
    0          0        0       0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    368        46       0       0       0       0
If we keep transmitting, we often end up getting a "No buffer space available" error.

Suggestions on how to solve above will be highly appreciated.

Best regards
Christian

User avatar
S.Grosjean
Software Development
Software Development
Posts: 357
Joined: Wed 4. Jul 2012, 17:02

Re: Full-speed usb

Post by S.Grosjean » Thu 25. Apr 2019, 10:43

Hello,

We first need to know if the forced full-speed mode is correctly accepted by the driver.

Please, do unplug the device connected to the full-speed USB port. Then type in a terminal window:

Code: Select all

$ dmesg -w 
Then re-plug the device and do the "ip link set" configuration (from another terminal window, of course). Finally, send us the new text lines that have been printed onto the terminal window.

Regards,
— Stéphane

Christian_
Posts: 5
Joined: Wed 24. Apr 2019, 14:59

Re: Full-speed usb

Post by Christian_ » Thu 25. Apr 2019, 13:35

Hi,

thanks for the prompt reply.

Here is the result of dmesg -w:

Code: Select all

[  +0.569073] usb 1-1.4: new full-speed USB device number 5 using dwc_otg
[  +0.130386] usb 1-1.4: not running at top speed; connect to a high speed hub
[  +0.001135] usb 1-1.4: New USB device found, idVendor=0c72, idProduct=0011
[  +0.000018] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  +0.000012] usb 1-1.4: Product: PCAN-USB Pro FD
[  +0.000011] usb 1-1.4: Manufacturer: PEAK-System Technik GmbH
[  +0.019558] peak_usb 1-1.4:1.0: PEAK-System PCAN-USB Pro FD v2 fw v3.2.0 (2 channels)
[  +0.004424] peak_usb 1-1.4:1.0 can0: attached to PCAN-USB Pro FD channel 0 (device 4294967295)
[  +0.002270] peak_usb 1-1.4:1.0 can1: attached to PCAN-USB Pro FD channel 1 (device 4294967295)
[Apr25 12:32] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
Thanks

User avatar
S.Grosjean
Software Development
Software Development
Posts: 357
Joined: Wed 4. Jul 2012, 17:02

Re: Full-speed usb

Post by S.Grosjean » Mon 29. Apr 2019, 12:47

Hello,

Are you running a RPi and, if yes, which is the model, please?
Do you confirm that you use an USB OTG adapter to connect our USB device?
Can you give us the Kernel version of your Linux system? ($ uname -a)

In principle, there is no reason why The PCAN-USB Pro FD device doesn't work at all in full-speed mode so we must know a bit more about your configuration to try to reproduce your issue in our labs first.

Regards,
— Stéphane

Christian_
Posts: 5
Joined: Wed 24. Apr 2019, 14:59

Re: Full-speed usb

Post by Christian_ » Mon 29. Apr 2019, 15:26

Hi

Thanks for getting back.

Yes, we are running this on a RPi Zero W.

We use a short OTG to USB-A cable to interface with the PEAK device.

Linux kernel:

Code: Select all

uname -a
Linux PiEOL1 4.14.95+ #3 Fri Feb 1 12:33:54 UTC 2019 armv6l GNU/Linux
Let me know if I can provide more information.

Thanks

Best regards
Christian

User avatar
S.Grosjean
Software Development
Software Development
Posts: 357
Joined: Wed 4. Jul 2012, 17:02

Re: Full-speed usb

Post by S.Grosjean » Thu 2. May 2019, 15:29

Hi,

We confirm that the PCAN-USB Pro FD works like a charm with hi-speed (480M) settings on the USB OTG port of the RPi Zero. We also confirm that the PCAN-USB Pro FD works with full-speed (12M) USB ports in host mode.
Unfortunately, ATM we also confirm that running the RPi Zero with the dwc_otg driver set in full-speed mode (12M) (dwc_otg.speed=1) prevents from the PCAN-USB Pro FD to work with the peak_usb driver as well as with our pcan driver: none of them are notified by the Linux USB core that packets have been written on the USB wire.

First investigations on the web show that this mode also generates problems with some USB Keyboards too. Therefore, atm, we don't have any fix to provide but we will get back to you as soon as we have found anything that could help in fixing this issue.

Regards,
— Stéphane

Christian_
Posts: 5
Joined: Wed 24. Apr 2019, 14:59

Re: Full-speed usb

Post by Christian_ » Thu 2. May 2019, 15:38

Hi

Thanks a lot for your reply and taking time to look into this.

It is unclear to me if you consider this case closed for now or if you pursue other solutions? We would like to know if we should consider this a "dead-end" or can hope for a solution in the near future?

Thanks

Br
Christian

User avatar
S.Grosjean
Software Development
Software Development
Posts: 357
Joined: Wed 4. Jul 2012, 17:02

Re: Full-speed usb

Post by S.Grosjean » Mon 6. May 2019, 16:03

Hi,

After investigating, we haven't found any evidence that your specific issue comes from one of our drivers, nor from our USB to CAN interface. Unfortunately, we can't spend much more support effort in investigating now how the dwc_otg USB driver of the RPiZ works in full speed mode.

Regards,
— Stéphane

Christian_
Posts: 5
Joined: Wed 24. Apr 2019, 14:59

Re: Full-speed usb

Post by Christian_ » Tue 7. May 2019, 07:21

Hi

We understand that you cannot provide more support on this and appreciate the effort you already put into this.

Just for your information, we are able to connect other devices successfully to the PRiZ in full-speed mode.

Best regards
Christian

Post Reply