Hi, thanks for quick responses.
Im in my test set up i have a F28069m Launchpad microprocessor connected to a PCAN FD USB adapter that sends a periodic keep alive signal on the can bus.
I can see the messages fine apearing in windows 10 through a Pcan-View software. Im running 500kbits no problem and no issues.
I required to write some test code for software acknowledge im working on for the microprocessor so through its easy to write it in linux. So i tried installing the driver for my raspberry pi so can get things working.
I used a mcp2515 module in the past with raspberry pi. It was very straight forward to set up, but i dont have that anymore. It was just a case of typing a bitrate and everything was working " right outside the box".
I have tried the basic command with bitrate. I saw some other people in the forum recomended setting the sample point after bitrate so i though it was going to be straight forward. Sadly it didnt work for me. So i tried manually setting the registers so it started to work. But that is low level stuff and its bit complicated for me to use as I dont exactly know how it all works together inside.
This is not working
Code: Select all
pi@raspberrypi:~ $ sudo ip link set can0 up type can bitrate 500000 sample-point 0.875
pi@raspberrypi:~ $ ip -s -d link show can0
45: can0: <NOARP,UP,LOWER_UP> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
link/can promiscuity 0 minmtu 0 maxmtu 0
can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
bitrate 500000 sample-point 0.875
tq 12 prop-seg 69 phase-seg1 70 phase-seg2 20 sjw 1
pcan: tseg1 1..256 tseg2 1..128 sjw 1..128 brp 1..1024 brp-inc 1
dbitrate 2000000 dsample-point 0.750
dtq 12 dprop-seg 14 dphase-seg1 15 dphase-seg2 10 dsjw 1
pcan: 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 numrxqueues 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
0 0 0 0 0 0
this is working
Code: Select all
pi@raspberrypi:~ $ sudo ip link set can0 up type can tq 125 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
pi@raspberrypi:~ $ ip -s -d link show can0
45: can0: <NOARP,UP,LOWER_UP> mtu 16 qdisc pfifo_fast state UP mode DEFAULT group default qlen 10
link/can promiscuity 0 minmtu 0 maxmtu 0
can state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
bitrate 500000 sample-point 0.875
tq 125 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
pcan: tseg1 1..256 tseg2 1..128 sjw 1..128 brp 1..1024 brp-inc 1
dbitrate 2000000 dsample-point 0.750
dtq 12 dprop-seg 14 dphase-seg1 15 dphase-seg2 10 dsjw 1
pcan: 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 32 0 0 0 0 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535
RX: bytes packets errors dropped overrun mcast
256 32 32 0 0 0
TX: bytes packets errors dropped carrier collsns
0 0 0 0 0 0
I have confirmed this is working with the use of