can-utils icon indicating copy to clipboard operation
can-utils copied to clipboard

j1939 on BeagleBone

Open GwenStouthuysen opened this issue 5 years ago • 3 comments

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

  • socket(PF_CAN, SOCK_DGRAM, CAN_J1939); testj1939: socket(j1939): Invalid argument

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?

GwenStouthuysen avatar Nov 21 '19 15:11 GwenStouthuysen

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

yegorich avatar Nov 21 '19 16:11 yegorich

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 <[email protected]

:

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 .

GwenStouthuysen avatar Nov 28 '19 12:11 GwenStouthuysen

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.

yegorich avatar Nov 28 '19 15:11 yegorich