PCAN-USB make fails

This forum covers PCAN-Linux and Linux development issues concerning our products
M.Maidhof
Support
Support
Posts: 1753
Joined: Wed 22. Sep 2010, 14:00

Re: PCAN-USB make fails

Post by M.Maidhof » Mon 8. Apr 2019, 14:16

Hi,

you only have builded the driver, not the libs and testtools. Simply don´t use that -c driver option, but build the package complete as written in my RPI post....

regards

Michael

Maker7
Posts: 8
Joined: Tue 2. Apr 2019, 13:15

Re: PCAN-USB make fails

Post by Maker7 » Mon 8. Apr 2019, 17:07

Hi Michael,
thank you.
I followed your instructions with:
make NET=NETDEV_SUPPORT PCI=NO PCIEC=NO PCC=NO DNG=NO PAR=NO ISA=NO

No errors reported after that. The "cat /proc/pcan" command displays "PEAK-System CAN interfaces" and after plugging it in it recognises 1 PCAN-USB interface.

Regards

M.Maidhof
Support
Support
Posts: 1753
Joined: Wed 22. Sep 2010, 14:00

Re: PCAN-USB make fails

Post by M.Maidhof » Mon 8. Apr 2019, 17:27

ok,

now you should be able to use PCAN-USB as can0 device with SocketCAN:

https://www.kernel.org/doc/Documentatio ... ng/can.txt

regards

Michael

Maker7
Posts: 8
Joined: Tue 2. Apr 2019, 13:15

Re: PCAN-USB make fails

Post by Maker7 » Sun 14. Apr 2019, 12:37

Michael, thank you.
Everything works now. It took me a while to implement python canopen package which connects nicely with socketcan. Now it works and I am very grateful for your support.

Just for the reference. Activating can0:
sudo ip link set can0 up type can bitrate 12500

Then test:

Code: Select all

pi@raspberrypi:~ $ ip -details link show can0
4: can0: <NOARP,UP,LOWER_UP> mtu 16 qdisc pfifo_fast state UNKNOWN mode DEFAULT group default qlen 10
    link/can  promiscuity 0 
    can state ERROR-ACTIVE restart-ms 0 
	  bitrate 125000 sample-point 0.875 
	  tq 500 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
	  pcan: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..64 brp-inc 1
	  clock 8000000numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 
Though everything works now and I can drive my motor controller from python, I wonder why I get can state ERROR-ACTIVE? I hope it won't backfire some day.
Last edited by K.Wagner on Mon 15. Apr 2019, 09:00, edited 1 time in total.
Reason: Format applied for better reading

Post Reply