DTB issues - Building DTB directly has different SIZE to Yocto built DTB

Hi, I’ve spent days going down this rabbit hole and our project is on-hold waiting for answer - hopefully someone can clear this up asap.

I’m simply trying to modify the device-tree on our module - by building a new dtb from Kernel sources and loading it through TEZI. Initially I’m just trying to enable general SPI (rather than MCP2515 SPI CAN controller). link text

From Kernel sources I’ve built the dtb blob using “make dtbs” and a new imx6ull-colibri-eval-v3.dtb is generated (which see in u-boot env that its the device tree we are loading) by following this link text

As a check I first just compile the unmodified imx6ull-colibri-eval-v3.dts into dtb BUT find that the file size is much larger (54kB) compared to the Yocto generated dtb of the same name (~32kB). Strip does not change the file size.

Why is the file size different and how do I fix this issue?

Thanks in advance!

That might be due to them symbols being included or not (e.g. the -@ in the DTC_FLAGS) which would only be relevant if using device tree overlays.

Hi Marcel, thanks but unfortunately “make DTC_FLAGS=”-@" imx6ull-colibri-eval-v3.dtb" still generates the same sized dtb (around 54k). ( also unless.overlays we being used by default I wasn’t intending on using.) Any other ideas why size could be different with Yocto build? Is there some patching applied to dts/dti or?

Thanks again

And I assume you are using the proper Linux kernel sources for BSP 3.0.4, right?

http://git.toradex.com/cgit/linux-toradex.git/tree/?h=Colibri-iMX6ULL_Console-Image_3.0b4.254-20200421

Yes I’m on that tag. A few observations:

When I use DTC_FLAGS I do get a bunch of warnings about symbols which I’ve ignored for now assuming that is normal.

If I use the larger built DTB is does seem to load even though it is larger… although we don’t want to proceed with this until we know root cause of this.

Could there be some compression on the reference DTB? Any other ideas? Maybe I could track down in Yocto process what is happening - no idea how to do that though.