Building a custom kernel and navio-rgb-overlay.dtb for Navio

Greetings!

I own one of the original Navio boards and have been working on building a Gentoo-based system with a custom kernel based on EMLID rpi-4.4.y source as the emlid-raspbian-20160408 image doesn’t really meet all my requirements.

From the ‘/boot/config.txt’ in emlid-raspbian-20160408 image, I noticed the navio-rgb device tree overlay is enabled but I’ve not been able to successfully build it either by using $(KERNEL_SOURCE)/scripts/dtc/dtc (or any other version of dtc). I had no trouble building the kernel or the rcio modules including the associated rcio-overlay.dtb …it’s just building the navio-rgb-overlay.dtb that I’ve not been able to get past.

When I run the following command from root of <KERNEL_SOURCE> (e.g. /usr/src/linux):

/usr/src/linux/scripts/dtc/dtc -@ -I dts -O dtb arch/arm/boot/dts/overlays/navio-rgb-overlay.dts -o arch/arm/boot/dts/overlays/navio-rgb-overlay.dtb

…I get the following output:

ERROR (phandle_references): Reference to non-existent node or label “leds”
ERROR (phandle_references): Reference to non-existent node or label “gpio”
ERROR (phandle_references): Reference to non-existent node or label “leds”
ERROR (phandle_references): Reference to non-existent node or label “gpio”
ERROR (phandle_references): Reference to non-existent node or label “leds”
ERROR (phandle_references): Reference to non-existent node or label “gpio”
ERROR: Input tree has errors, aborting (use -f to force output)

Now, I can use the ‘-f’ option but the resultant navio-rgb-overlay.dtb file is different to the one in the emlid-raspbian-20160408 image. In contrast, my compiled version of rcio-overlay.dtb, it’s the same as the one in the emlid-raspbian-20160408 image …and so, I suspect my version of navio-rgb-overlay.dtb (that I’m force-compiling) may not be valid.

Is anyone at EMLID able to shed some light on how to successfully build the navio-rgb-overlay.dtb please?

Hello there!

This is quite an endeavour! May I ask what exactly do you want to accomplish? Why Gentoo?

Answering your initial question:
Version: DTC 1.4.0-gf345d9e4 is the version I used to build the overlay.

Either way, original Navio+ (if that is what you’re after) doesn’t really use this overlay at all. This is an overlay that is used only on Navio 2. Sorry for the naming!

Hello George!

Thank you for responding :slight_smile:

Regarding your question: “Why Gentoo?” …over many years (more than I care to count) I’ve used a number of (mostly package-based) Linux distributions but found them somewhat bloated (i.e. all package build/compile options enabled). As a build-from-source distribution, Gentoo allows quite a lot of control over build/compile options resulting in slimmer and (arguably) more efficient system, hence the name Gentoo - a small fast penguin.

As for navio-rgb-overlay.dts, my question wasn’t so much about the dtc version but rather how to get the overlay to successfully compile at all. I tried three versions of dtc including the one that is included with EMLID rpi-4.4.y-rpi source and one built from latest available dtc source - all with same results as mentioned in my post. I suspect that dtc is not the issue but rather something (knowledge?) I am missing or doing wrong.

I understand the overlay is only used for Navio2 but (theoretically) should be able to successfully compile the navio-rgb-overlay.dts in EMLID rpi-4.4.y-rpi source - it’s the only overlay that refuses to compile.

Since I am about to acquire a Navio2, I would like to solve this issue and am keen understand how you (as resident EMLID kernel guru) build the overlay in question when assembling the kernel for recent EMLID raspbian images?

@george.staroselskiy

Since I am about to acquire a Navio2, I would like to solve this issue
and am keen understand how you (as resident EMLID kernel guru) build the
overlay in question when assembling the kernel for recent EMLID
raspbian images?

@penguini

Sorry it took me so long to reply :frowning:

I reproduced your error. Thanks for noticing it. The fix is already on rpi-4.4.y-rpi-3-emlid-v7+ branch on Github!

No problem George …am sure you have plenty of things to keep you busy.

I appreciate the fix …all good, thank you!

:smiley:

1 Like