From: Patrick Menschel <menschel.p@posteo.de>
To: Paul Bongaerts <pauluzs@gmail.com>
Cc: linux-can <linux-can@vger.kernel.org>
Subject: Re: J1939 kernel for Raspberry Pi
Date: Wed, 10 May 2017 17:03:25 +0200 [thread overview]
Message-ID: <aa1bd3ba-96e7-e155-958f-1581d3bca008@posteo.de> (raw)
In-Reply-To: <CAGJdXcFRUB=xLSdFkwadTkdd=OAvgkGgrOYRAxy0RkjpHGoCDQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 4024 bytes --]
Hello Paul,
just for the record, socketcan itself works on your pi, yes?
Further question would be if the file can-j1939.ko really is in the
modules folder.
If yes, my first try would be "depmod -A" . See if the module is found then.
Regards,
Patrick
Am 10.05.2017 um 13:50 schrieb Paul Bongaerts:
> After struggling for the last 5 days i keep failing in building a
> working custom jessie lite based j1939 arm kernel. for a raspberrypi
> (b.t.w. i'm certainly no expert on kernel building)
>
> Tried local and crosscompiled builds with different setting
>
> Goal is to build a kernel according to the Raspberrypi kernel building guide
> https://www.raspberrypi.org/documentation/linux/kernel/building.md
>
> And merge this with a J1939 kernel according to this elinux j1939 guide.
> http://elinux.org/J1939
>
> Because this takes several hours per build and over a day on the pi i
> could use some help in the right direction
>
>
>
> Br, Paul
>
>
>
>
> Failed attempts summary :
>
> Compile a working kernel with no j1939 support on rpi locally
> (modprobe can-j1939 Fails)
> Crosscompile unbootable kernels with j1939 support on ubuntu (Fails to boot)
>
>
> #########################################################################
> Native compile
> rapsberry pi zero w 16 GB SD Card
> #########################################################################
>
>
> Setup the build environment
>
> sudo apt-get install git bc
> git clone --depth=1 https://github.com/raspberrypi/linux
> cd linux
> git remote add j1939 git://github.com/kurt-vd/linux
> git remote update j1939 |& tee -a ~/j1939update.log
>
>
> Merge j1939-v4.7 with rpi-master takes several hours
>
> git merge j1939/j1939d-v4.7 |& tee -a ~/j1939merge.log
> (jessie image uses uname -r 4.9.24+ so 4.7 is closest lower version)
>
> cd ~/linux
> KERNEL=kernel
> make bcmrpi_defconfig
>
> Build the kernel, modules and devicetree overlays. time ~ 24h
>
> make zImage modules dtbs
>
> Install the modules
>
> sudo make modules_install
>
> Copy the files to the right locations
>
> sudo cp arch/arm/boot/dts/*.dtb /boot/
> sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
> sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/
> sudo cp arch/arm/boot/zImage /boot/$KERNEL.img
> sudo reboot
> sudo modprobe can-j1939
> modprobe: FATAL: Module can-j1939 not found.
>
>
> #########################################################################
> Crosscompile j1939-v4.7 > rpi kernel
> ubuntu-16.04.2-server-amd64.iso
> #########################################################################
>
> cd /usr/src
>
> Get crosscompile Toolchain
>
> git clone git://github.com/raspberrypi/tools.git --depth=1
>
> Get j1939-v4.7 branch kernel sources
>
> git clone -b j1939d-v4.7 git://github.com/kurt-vd/linux --depth=1
>
> cd /usr/src/linux
>
> export PATH
>
> export PATH=$PATH:/usr/src/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin
>
> Clean the kernel source
>
> make mrproper
>
>
>
> Now login to a running rpi (Clean raspbian-jessie-lite, uname -a r 4.9.24+ )
>
> Create config.gz
>
> pi@raspberrypi:~ $ sudo modprobe configs
>
> Copy the config.gz to build server
>
> pi@raspberrypi:~ $ scp /proc/config.gz user@server.local:/usr/src/linux
>
>
>
> Back on Server
>
> gunzip -c config.gz > .config
>
> Set kernel varialble
>
> KERNEL=kernel
>
>
> Build Kernel Image, Modules and Devicetreeoverlays (select: SAE J1939
> as module, debug SAE J1939 yes, CAN_IFI_CANFD as module)
>
> make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage modules dtbs
>
>
> copy files to SD according to raspberry's kernelbuildingguide and boot
> (fails to boot)
> --
> To unsubscribe from this list: send the line "unsubscribe linux-can" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 3709 bytes --]
next prev parent reply other threads:[~2017-05-10 15:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-10 11:50 J1939 kernel for Raspberry Pi Paul Bongaerts
2017-05-10 15:03 ` Patrick Menschel [this message]
2017-05-11 19:29 ` Kurt Van Dijck
2017-05-14 17:57 ` Paul Bongaerts
2017-05-14 22:30 ` Paul Bongaerts
2017-05-15 7:14 ` Kurt Van Dijck
2017-05-15 10:50 ` Paul Bongaerts
2017-05-15 10:53 ` Paul Bongaerts
2017-05-15 12:43 ` Kurt Van Dijck
2017-05-16 13:02 ` Kurt Van Dijck
2017-05-16 13:13 ` Kurt Van Dijck
2017-05-16 17:22 ` Paul Bongaerts
2017-05-16 20:40 ` Paul Bongaerts
2017-05-15 16:52 ` Patrick Menschel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aa1bd3ba-96e7-e155-958f-1581d3bca008@posteo.de \
--to=menschel.p@posteo.de \
--cc=linux-can@vger.kernel.org \
--cc=pauluzs@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox