linux-can / can-utils

Linux-CAN / SocketCAN user space applications
2.29k stars 698 forks source link

j1939 on BeagleBone #171

Open GwenStouthuysen opened 4 years ago

GwenStouthuysen commented 4 years ago

I'm stuck with J1939 on Beaglebone. uname -a: Linux beaglebone 4.19.79-ti-r30 #1stretch SMP PREEMPT Mon Nov 4 20:48:10 UTC 2019 armv7l GNU/Linux

Installed the last status of can-utils from this repository (./autogen.sh till make install)

I have a functional CAN socket with J1939 equipment sending messages: debian@beaglebone:~/can-utils$ candump can0 can0 18EF3C33 [8] 20 54 F8 33 12 00 02 07 can0 18EF3C33 [8] 30 BF 74 67 EC 00 00 0E can0 18EF3C33 [8] 30 BF 74 67 EC 00 00 0D

Trying to review this with a J1939 enabled socket fails: debian@beaglebone:~/can-utils$ testj1939 -r -v can0

extra test: debian@beaglebone:~/can-utils$ modprobe can-j1939 modprobe: FATAL: Module can-j1939 not found in directory /lib/modules/4.19.79-ti-r30

What do I do wrong?

yegorich commented 4 years ago

You'll have to build/install at least kernel 5.4-rc8.

GwenStouthuysen commented 4 years ago

And can you explain how to do this?

I tried to upgrade the kernel, using the standard script and apt, when I go fro 4.x to 5.x the unit does not boot anymore. I didn't go that far yet to capture the boor process but simply said: it doesn't work.

Gwen

Op do 21 nov. 2019 om 17:36 schreef Yegor Yefremov <notifications@github.com

:

You'll have to build/install at least kernel 5.4-rc8.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/linux-can/can-utils/issues/171?email_source=notifications&email_token=AA3AHGWZPYORGDE64GOCI5TQU22HJA5CNFSM4JQENFRKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEE23FHA#issuecomment-557167260, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA3AHGRHYT32JJII3SZZCXDQU22HJANCNFSM4JQENFRA .

yegorich commented 4 years ago

You can try Buildroot. It already provides a defconfig for different BeagleBones (configs/beaglebone_defconfig).

git clone git://git.buildroot.net/buildroot
cd buildroot
make beaglebone_defconfig
make menuconfig

Once in menuconfig, change Kernel configuration to just use the upstream kernel and provide an URL to linux-5.4 and also select iproute2 and can-utils. Save & exit.

make
make linux-menuconfig

Check whether J1939 is enabled and repeat make.

Now you should have an SD card image with the right kernel and configuration.

Once you're satisfied with kernel configuration, you can copy kernel and modules to your Debian card and use it there.