Trying to build a 3.8.13 kernel with seeeds BBG patches

I’m trying to build a 3.8.13 kernel with the BBG patches from http://www.seeedstudio.com/recipe/373-how-to-compile-beaglebone-green-linux-kernel.html.

I hit this error during the build:

make[1]: Leaving directory /home/keithconger/Projects/bbbandroid-bluez/kernel' make -C kernel ARCH=arm CROSS_COMPILE=/home/keithconger/Projects/bbbandroid-bluez/prebuilts/gcc/linux-x86/arm/arm-gnueabihf-4.7/bin/arm-linux-gnueabihf- dtbs make[1]: Entering directory /home/keithconger/Projects/bbbandroid-bluez/kernel’
DTC arch/arm/boot/dts/am335x-bone.dtb
DTC arch/arm/boot/dts/am335x-boneblack.dtb
DTC arch/arm/boot/dts/am335x-bonegreen.dtb
Error: arch/arm/boot/dts/am335x-bonegreen.dts:45.15-16 syntax error
FATAL ERROR: Unable to parse input tree
make[2]: *** [arch/arm/boot/dts/am335x-bonegreen.dtb] Error 1
make[2]: *** Waiting for unfinished jobs…
make[1]: *** [dtbs] Error 2
make[1]: Leaving directory `/home/keithconger/Projects/bbbandroid-bluez/kernel’
make: *** [kernel_build] Error 2

Line 45 and 46 are:
0x150 (PIN_INPUT | MUX_MODE1) /* spi0_sclk.uart2_rxd */

0x154 (PIN_OUTPUT | MUX_MODE1) /* spi0_d0.uart2_txd */

Anyone know how to resolve this?

Thanks

Your problem is very likely that you do not have the files

#include “am33xx.dtsi”
#include “am335x-bone-common.dtsi”

In your path. I get the same error here:

$ dtc -O dtb -o am335x-bonegreen.dtbo -b 0 -@ am335x-bonegreen.dts
Error: am335x-bonegreen.dts:10.1-9 syntax error
FATAL ERROR: Unable to parse input tree

So, you missed a step somewhere. Which kernel version will the target be using ? This should be trivial to fix, but the only option I can think of offhand is git cloning https://github.com/RobertCNelson/device-tree-rebasing, and then placing your bonegreen dts file into the /src/arm/ directory, and compiling manually. As I have no idea which instructions you are following, and what the steps are.

OR

Perhaps placing am33xx.dtsi and am335x-bone-common.dtsi in the same directory as am335x-bonegreen.dts, and try again. I’ve never done this personally, but it should work. In fact, I think it makes more sense than the first option I mention above. With one caveat: I do not recall if either of these include files have further dependencies in this git tree.

One additional note: That git has the bonegreen dts file in it already. So git cloning that git, and running dtc in the src/arm/ directory for that file should just work.

One additional note: That git has the bonegreen dts file in it already. So git cloning that git, and running dtc in the src/arm/ directory for that file should just work.

Following these line of reasoning, I get the same error. hmmm give me a minute.

strace output

http://pastebin.com/8ype90wD

I’m looking into it.

Well I was attempting to create a *.dtbo file from the source, but here this works:

$ git clone https://github.com/RobertCNelson/dtb-rebuilder.git
Cloning into ‘dtb-rebuilder’…
remote: Counting objects: 6357, done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 6357 (delta 3), reused 0 (delta 0), pack-reused 6343
Receiving objects: 100% (6357/6357), 4.38 MiB | 344 KiB/s, done.
Resolving deltas: 100% (2563/2563), done.

$ cd dtb-rebuilder/

$ make src/arm/am335x-bonegreen.dtb
DTC src/arm/am335x-bonegreen.dtb

$ cp src/arm/am335x-bonegreen.dtb .

$ ls
Bindings COPYING Makefile README am335x-bonegreen.dtb dtc-overlay.sh include scripts src

Doh, I just realized you’re working with a 3.8.x kernel . . . These instructions above I believe will only work with 4.x, as that’s what the sourced in this repo are meant for. However, I bet the device tree source files are exactly the same. But unsure if dt-bindings are different or not.

OK, wow those instructions are whack. First of all this is the proper way to use Robert’s bb-kernel repo:

https://eewiki.net/display/linuxonarm/BeagleBone+Black#BeagleBoneBlack-LinuxKernel

Secondly, this builds all the necessary BBG files as well( as far as I know ). So in short . . .

$ git clone https://github.com/RobertCNelson/bb-kernel
$ cd bb-kernel/

$ git checkout origin/am33x-v3.8 -b tmp

Now you can build with:
$ ./build_kernel.sh

OR

$ ./build_deb.sh

build_deb.sh will build a Debian package, that will allow you to install this new kernel over the top of an existing kernel( and including dependencies ) on an already working image. Extremely useful if you need to make kernel tweaks only to a system.

I am curious though. Any specific reason why you have to use a 3.8.x kernel ? the 4.x kernels are pretty good now days . . .and they seem to be noticeably faster too.

Hi William,

Thanks for looking at this for me.

I’m using 3.8 for video acceleration and Android. I have not been able to get more recent kernels to fully work with everything I need on BBB.

I copied the dts file from the am33x-v3.8 tree into my kernel and was able to build and boot the kernel. Now I’m trying to get the 4D LCD4 cape functioning.

Thanks,
Keith

I’m using 3.8 for video acceleration and Android. I have not been able to get more recent kernels to fully work with everything I need on BBB.

I copied the dts file from the am33x-v3.8 tree into my kernel and was able to build and boot the kernel. Now I’m trying to get the 4D LCD4 cape functioning.

Is that even possible ? With the HDMI framer not even existing on the BBG?

External video capes such as the lcd work fine with the BBG..

It's just missing the am335x_lcd_pins -> Nxp lcd-hdmi framer -> hdmi connector..

Regards,

I’ve got my LCD working but I’m struggling with enabling UART2 with it connected.

I’m getting a conflict between the two:
[ 1.749303] bone-capemgr bone_capemgr.9: slot #5: BB-UART2 conflict P9.21 (#3:BB-BONE-LCD4-01)

What’s weird is the LCD’s datasheet doesn’t show that pin being used.

http://www.4dsystems.com.au/productpages/4DCAPE-43/downloads/4DCAPE-43(T)_datasheet_R_1_9.pdf

Anyone come across this before?

Thanks,
Keith

I see no "P9.21" being used:

https://github.com/beagleboard/linux/blob/3.8/firmware/capes/BB-BONE-LCD4-01-00A1.dts

What source/kernel (uname -r) are you using?

Regards,

I’m using 3.8.13. In the kernel source I’m using BB-BONE-LCD4-01-00A1.dts does have that pin being used. I just found the article below. So I’ve removed the offending lines and I’m creating a new image to test.

https://accustrata.wordpress.com/2014/10/27/lcd4-cape-and-circuitco-adc-cape-working-together/

Thanks,
Keith

Well the reason i asked, this was fixed a year ago:

https://github.com/RobertCNelson/bb-kernel/commit/ad1d7afeb38137340a883576d6b6f582650c88f2

so: 3.8.13-bone69 ++

Regards,

Ah, figures. Sorry, should of confirmed I was using the latest.

Thanks again,
Keith

Shouldn’t git checkout origin/am33x-v3.8 -b tmp have pulled the latest sources ?

That is what's odd, he got a branch from over a year ago.. "git
checkout origin/xyz -b tmp" just creates a branch on the local value
of 'xyz', so without a 'git pull' before hand...

Yet still, a repo from over a year ago..

Regards,

That is what’s odd, he got a branch from over a year ago… "git
checkout origin/xyz -b tmp" just creates a branch on the local value
of ‘xyz’, so without a ‘git pull’ before hand…

Yet still, a repo from over a year ago…

I blame those whack seed “instructions” . . .heh. Never ceases to amaze though how people can take something perfectly good, then feel compelled to make it “better” .

Hi,

It did but I manually copied in what I thought I needed. The kernel I’m using has a few additional patches applied. So. I went the quick and dirty route.

Over the next two weeks I may try to get a newer kernel built. Does anyone know what the newest kernel with sgx support is? Is it still 3.14?

Thanks,
Keith