add kernel modules & dtbo's for Raspberry Pi3
I'm building an image for the Raspberry Pi 3 and I'm trying to add some modules to the kernel and I need to add some device tree overlays. The modules and overlays are part of the kernel, just not built by default.
For the kernel modules I've added a linux-raspberrypi_4.4.bbappend file in the path .../recipes-bsp/linux. The file consists of:
# Scribe additions to Kernel configuration
FILESEXTRAPATHS_prepend += "$(THISDIR)/files"SRC_URI += "file://Scribe.cfg"
Whether I use "+=" or ":=" as suggested in "Embedded Linux Systems withe the Yocto Project", I get an error that "file://0001-fix-dtbo-rules.patch" cannot be found. I don't get this error if my .bbappend file is not being used.
Also, if there are any quick tips on how to add dtbo's to the kernel build I would appreciate them.
Regards,
Greg
Quoted 9 lines · Greg Wilson-Lindberg
I'm building an image for the Raspberry Pi 3 and I'm trying to add some modules to the kernel and I need to add some device tree overlays. The modules and overlays are part of the kernel, just not built by default.
For the kernel modules I've added a linux-raspberrypi_4.4.bbappend file in the path .../recipes-bsp/linux. The file consists of:
# Scribe additions to Kernel configuration
Quoted 7 lines
FILESEXTRAPATHS_prepend+= "$(THISDIR)/files"SRC_URI+= "file://Scribe.cfg"Whether I use "+=" or ":=" as suggested in "Embedded Linux Systems withe the Yocto Project", I get an error that "file://0001-fix-dtbo-rules.patch" cannot be found. I don't get this error if my .bbappend file is not being used.
You're missing a colon at the end of the path definition, and you should use the ':=' operator:
FILESEXTRAPATHS_prepend := "$(THISDIR)/files:"
The path you're introducing is getting added to a bunch of other paths, and therefore needs the separator. The := operator causes your change to this variable to be immediately expanded by bitbake, which is what you want.
Quoted 2 lines
Also, if there are any quick tips on how to add dtbo's to the kernel build I would appreciate them.
If you look through the raspberry pi kernel sources
($TMPDIR/work/raspberrypi3-*/linux-raspberrypi/${VERSION}/linux-raspberrypi3-standard-build/source)at
arch/arm/boot/dts/overlays
and find an overlay you like (e.g. spi1-3cs-overlay.dts) then to have it added to your image and applied at boot time:
1. edit local.conf to add it to the kernel's device tree (but add it as a dtbo without the "-overlay"):
KERNEL_DEVICETREE_append = " overlays/spi1-3cs.dtbo"
2. extend rpi-config to include it in the image's config.txt file:
rpi-config_%.bbappend:
do_deploy_append() {
echo "dtoverlay=spi1-3cs" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt"
}Hi Trevor,
Other than the fact that I was using '()' instead of '{}' for the file name, your catch of the missing ':' got the file include fixed. And your suggestion for including the Device Tree Overlays was perfect. Thanks,
I seem to have something still messed up in the kernel configs though, it looks like my file is getting included, or at least the path is not blowing up, but the config elements are not being set.
Here is my Scribe.cfg file:
# Enable MAX9768CONFIG_SND_SOC_MAX9768=m
# Enable MAX11606CONFIG_MAX1363=m
The 'CONFIG_SND_SOC_MAX9768' is not showing up at all in the .config file, and the 'CONFIG_MAX1363' is not set. They both are found in the appropriate Kconfig files.
Is there something else that I'm missing?
Regards,
Greg
________________________________
From: Trevor Woerner <[email protected]>
Sent: Thursday, December 21, 2017 4:30:20 AM
To: Greg Wilson-Lindberg
Cc: [email protected]
Subject: Re: [yocto] add kernel modules & dtbo's for Raspberry Pi3
Quoted 9 lines · Greg Wilson-Lindberg
I'm building an image for the Raspberry Pi 3 and I'm trying to add some modules to the kernel and I need to add some device tree overlays. The modules and overlays are part of the kernel, just not built by default.
For the kernel modules I've added a linux-raspberrypi_4.4.bbappend file in the path .../recipes-bsp/linux. The file consists of:
# Scribe additions to Kernel configuration
Quoted 7 lines
FILESEXTRAPATHS_prepend+= "$(THISDIR)/files"SRC_URI+= "file://Scribe.cfg"Whether I use "+=" or ":=" as suggested in "Embedded Linux Systems withe the Yocto Project", I get an error that "file://0001-fix-dtbo-rules.patch" cannot be found. I don't get this error if my .bbappend file is not being used.
You're missing a colon at the end of the path definition, and you should use the ':=' operator:
FILESEXTRAPATHS_prepend := "$(THISDIR)/files:"
The path you're introducing is getting added to a bunch of other paths, and therefore needs the separator. The := operator causes your change to this variable to be immediately expanded by bitbake, which is what you want.
Quoted 2 lines
Also, if there are any quick tips on how to add dtbo's to the kernel build I would appreciate them.
If you look through the raspberry pi kernel sources
($TMPDIR/work/raspberrypi3-*/linux-raspberrypi/${VERSION}/linux-raspberrypi3-standard-build/source)at
arch/arm/boot/dts/overlays
and find an overlay you like (e.g. spi1-3cs-overlay.dts) then to have it added to your image and applied at boot time:
1. edit local.conf to add it to the kernel's device tree (but add it as a dtbo without the "-overlay"):
KERNEL_DEVICETREE_append = " overlays/spi1-3cs.dtbo"
2. extend rpi-config to include it in the image's config.txt file:
rpi-config_%.bbappend:
do_deploy_append() {
echo "dtoverlay=spi1-3cs" >>${DEPLOYDIR}/bcm2835-bootfiles/config.txt"
}