I received the rock pi 4b+, it’s a very fine board.
performance are great.
Connection to the lcd is oke,
But I have a problem with CANBUS, ( I have tried Debian,and Ubuntu) with the same results…
please help.
The Setup is.
Machine main board running on stm32(arm) with canbus.
Rock pi4+ running Ubuntu Canbus hat( Waveshare 485 CAN HAT )
configurations on Ubuntu
sudo nano /etc/network/interfaces
Add the following lines
auto can0
iface can0 inet manual
pre-up /sbin/ip link set can0 type can bitrate 250000
up /sbin/ifconfig can0 up
down /sbin/ifconfig can0 down
this brings the CAN0 online at boot time…
after boot tested with
rock@rockpi4b:~$ ifconfig -a
can0: flags=193<UP,RUNNING,NOARP> mtu 16
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
canbus is up and running.
if I do… candump and on stm32 mainboard request a send data 20 msg are sent,
the ID’s are oke 14 to 27
but the data is wrong (many line’s show 15 0B 15 0B 15 0B 15 0B) this is wrong data.
rock@rockpi4b:~$ candump can0
can0 014 [8] 15 0B 15 0B 15 0B 15 0B
can0 015 [8] 53 6F 6C 75 74 69 6F 6E
can0 016 [8] 15 0B 15 0B 15 0B 15 0B
can0 017 [8] 15 0B 15 0B 15 0B 15 0B
can0 018 [8] 15 0B 15 0B 15 0B 15 0B
can0 019 [8] 73 6F 6C 75 74 69 6F 6E
can0 01A [8] 15 0B 15 0B 15 0B 15 0B
can0 01B [8] 15 0B 15 0B 15 0B 15 0B
can0 01C [8] 15 0B 15 0B 15 0B 15 0B
can0 01D [8] 15 0B 15 0B 15 0B 15 0B
can0 01E [8] 15 0B 15 0B 15 0B 15 0B
can0 01F [8] 15 0B 15 0B 15 0B 15 0B
can0 020 [8] 15 0B 15 0B 15 0B 15 0B
can0 021 [8] 15 0B 15 0B 15 0B 15 0B
can0 022 [8] 15 0B 15 0B 15 0B 15 0B
can0 023 [8] 15 0B 15 0B 15 0B 15 0B
can0 024 [8] 15 0B 15 0B 15 0B 15 0B
can0 025 [8] 15 0B 15 0B 15 0B 15 0B
can0 026 [8] 15 0B 15 0B 15 0B 15 0B
can0 027 [8] 15 0B 15 0B 15 0B 15 0B
rock@rockpi4b:~$ ifconfig -a
can0: flags=193<UP,RUNNING,NOARP> mtu 16
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 10 (UNSPEC)
RX packets 40 bytes 320 (320.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
no error of problems reported here…
test2 ( canbus with loop back on )
setup:
$ sudo ip link set can0 down
$ sudo ip link set can0 type can loopback on
$ sudo ip link set can0 up type can bitrate 250000
terminal2
rock@rockpi4b:~$ cansend can0 001#1122334455667788
rock@rockpi4b:~$ cansend can0 001#1122334455667788
rock@rockpi4b:~$ cansend can0 001#1122334455667788
rock@rockpi4b:~$ cansend can0 001#1122334455667788
rock@rockpi4b:~$
terminal1
rock@rockpi4b:~$ candump can0
can0 001 [5] 0B 15 0B 15 0B
can0 001 [8] 11 22 33 44 55 66 77 88
can0 001 [5] 0B 15 0B 15 0B
can0 001 [8] 11 22 33 44 55 66 77 88
can0 001 [5] 0B 15 0B 15 0B
can0 001 [8] 11 22 33 44 55 66 77 88
can0 001 [5] 0B 15 0B 15 0B
can0 001 [8] 11 22 33 44 55 66 77 88
can0 001 [5] 0B 15 0B 15 0B
can0 001 [8] 11 22 33 44 55 66 77 88
The same error “0B 15 0B 15 0B”
please help me with this one, it is driving me nuts for over 5 days in a row
both side are 120ohm terminated
STM32 mainboard is running fine,
tested al signals with scope
stm32 mainbord and (raspberry with the can hat, works without a problem)