PCAN-USB Pro FD failed to transmit at baud below 1Mbit/s

This forum covers PCAN-Linux and Linux development issues concerning our products
Post Reply
cheeyw
Posts: 3
Joined: Mon 28. Aug 2017, 15:41

PCAN-USB Pro FD failed to transmit at baud below 1Mbit/s

Post by cheeyw » Mon 28. Aug 2017, 15:55

Setup Environment:
OS: Ubuntu 14.04 (64bit)
Driver: peak-linux-driver-8.4.0

I have used the test program that comes with the peak driver.

I have setup two running programs:
>>./receivetest -f=/dev/pcan33 -b=0x0014 -e
>>./transmitest -f=/dev/pcan32 –b=0x0014 -e hello.txt

hello.txt contains:
m e 0x1FFFFFFB 8 0x88 0x99 0xAa 0xbB 0xCc 0xdD 0xEe 0xfF

It is fine when both programs uses baud rate 1Mbit/s (-b=0x0014)

However if i tried to set the baud rate for both programs to be 500kbit/s (0x001C) or 250kbit/s (0x011C), the receivetest will not receive any messages, and the transmitest will have an error:
transmitest: CAN_Write(): Network is down

Please advice how to resolve this issue? Thanks!

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

Re: PCAN-USB Pro FD failed to transmit at baud below 1Mbit/s

Post by S.Grosjean » Mon 28. Aug 2017, 17:00

Hello,

Can you redo your test but with the more recent test tool "pcanfdtst" please, that is:

Rx side:

Code: Select all

% pcanfdtst rx -b 500k /dev/pcan33
Tx side:

Code: Select all

$ pcanfdtst tx -b 500k -n 10 -ie 0x1FFFFFFB -I 8 /dev/pcan32
Can you also give us the output of:

Code: Select all

$ cat /proc/pcan
Thanks,

Stéphane
— Stéphane

cheeyw
Posts: 3
Joined: Mon 28. Aug 2017, 15:41

Re: PCAN-USB Pro FD failed to transmit at baud below 1Mbit/s

Post by cheeyw » Mon 28. Aug 2017, 17:59

Hello Stéphane,

It worked with the suggestions you gave.

BTW, does the pcanfdtst.c source codes able to work on other PCAN products (PCAN-USB, PCAN-PCI, PCAN-miniPCI, etc)? Or does it only work on PCAN-USB Pro FD?

Also which sample codes do you recommend for coding in c++ Linux that is supports PCAN-USB, PCAN-USB-FD and PCAN-PCI products?

cat /proc/pcan

Code: Select all

*------------- PEAK-System CAN interfaces (www.peak-system.com) -------------
*------------- Release_20170613_n (8.4.0) Aug 28 2017 15:05:03 --------------
*------------- [mod] [isa] [pci] [pec] [dng] [par] [usb] [pcc] --------------
*--------------------- 2 interfaces @ major 248 found -----------------------
*n -type- -ndev- --base-- irq --btr- --read-- --write- --irqs-- -errors- status
32  usbfd   -NA- ffffffff 255 0x001c 00000001 00000064 00000065 00000000 0x0000
33  usbfd   -NA- ffffffff 255 0x001c 00000065 00000000 00000065 00000000 0x0000

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

Re: PCAN-USB Pro FD failed to transmit at baud below 1Mbit/s

Post by S.Grosjean » Tue 29. Aug 2017, 09:42

Hi,

pcanfdtst is a more powerful and flexible tool than the two older ones. It is obviously compatible with all of our CAN devices, while the older ones are (for example) not CAN-FD capable (Both of these are kept for historical reason only. Anyway, we will have a look to the issue you have found with...).

We actually encourage new users to use the (new) libpcanfd library which is a super set if the old one libpcan. It is more efficient and offers very much more possibilities to user applications. That's the reason why I would strongly suggest you to get inspiration from pcanfdtst.c, regardless of which PEAK CAN product you want to use. Documentation folder contains a User Guide PDF that describes this API.

Regards,

Stéphane
— Stéphane

Post Reply