I get an error:
In file included from fdtdump.c:14:
fdtdump.c: In function ‘main’:
libfdt/libfdt.h:251:28: error: array subscript ‘struct fdt_header’ is partly outside array bounds of ‘unsigned char’ [-Werror=array-bounds]
251 | fdth->name = cpu_to_fdt32(val);
libfdt/libfdt.h:253:1: note: in expansion of macro ‘fdt_set_hdr_’
253 | fdt_set_hdr_(magic);
fdtdump.c:216:31: note: while referencing ‘smagic’
216 | unsigned char smagic[FDT_MAGIC_SIZE];
I can’t send you the overlay file. I had the compile error I reported when I tryed to build " Device Tree Compiler (DTC) Tool" with your procedure, following Build Device Tree Overlays from Source Code | Toradex Developer Center.
When I run: make inside the dtc directory, I get the error.
Consider that I run it on Ubuntu 22.04.2 LTC and that I installed the 32 bit host machine cross compilation.
I was able to reproduce this error on an Ubuntu 22.04 machine. On further investigation, I found that the cause behind this error has been fixed on version 1.6.1 of dtc. I could solve the issue by simply cloning to this branch on the dtc repository. So you will need to do the following:
$ git clone git://git.kernel.org/pub/scm/utils/dtc/dtc.git -b v1.6.1 ~/dtc
$ cd ~/dtc
$ export PATH=$HOME/dtc/:$PATH
Thanks for reporting this error. Please let me know if this solves your issue.
When I run:
scripts/Kconfig.include:39: C compiler ‘arm-none-linux-gnueabihf-gcc’ not found
make: *** [scripts/kconfig/Makefile:94: imx_v6_v7_defconfig] Errore 1
make: *** [Makefile:697: imx_v6_v7_defconfig] Errore 2
How can I set the compiler ? I haven’t found in your site.
This is because the environment variables are not set properly. Can you check the output of echo $CROSS_COMPILE ?
As it is mentioned on the linked article: The U-Boot and Linux makefiles use the environment variables ARCH/CROSS_COMPILE to configure and call the compiler correctly. Therefore, these environment variables must be exported in any shell instance that will run configure/compile commands to build U-Boot or Linux for the target module.
right now I can compile. There was a problem inside my export_compiler file.
Now, when a compile the dts, I get:
Skipping pylibfdt (install python dev and swig to build)”
So I installed:
sudo apt-get install python3-dev
sudo apt-get install swig
After that, running make, I get:
make: ingresso nella directory «/home/showroom/Dev/Toradex/ImageDev/DeviceTree/dtc»
/home/showroom/Dev/Toradex/ImageDev/DeviceTree/dtc/pylibfdt/setup.py:13: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
from distutils.core import setup, Extension
make: uscita dalla directory «/home/showroom/Dev/Toradex/ImageDev/DeviceTree/dtc»
Is it normal ?
Continuing, I built device tree.
Now, how can I load them in the i.MX6ULL ?
The error messages that you receive when executing the make are not normal. Could you please send me your export_compiler file?
Also have you exported the dtc path to the PATH variable?
Please send the absolute path to where you have installed your dtc tool, output of echo $PATH, absolute path to where you have created the symlink for gcc-linaro.
All your errors look like there is an error with the paths you have configured either in the export_compiler file or in the PATH variable.
Regarding your second question on loading the dtbo files onto the module:
First of all, you are using a NAND based module. They don’t support device tree overlays. Therefore you will have to modify the dts files, build them into dtb and load them to the module. For these modules, the device tree is stored in an ubifs partition. The reason for this is that originally U-Boot did not support ubifs (I think that changed in the meanwhile).
What you could do is, modify the device tree directly, then compile it to a dtb and afterwards update the ubi volume. This is documented here:
Also, you have to verify that the partition numbering for the dtb by checking the output of the following command:
The PATH variable and the export file look fine to me. You were receiving some warning messages while executing the make. I think these could be ignored for now as you were able to build the dtb files anyway.
About dtb file: where is created ?
Once you compile the dts files successfully, you should be able to see the corresponding dtb files in linux/arch/arm/boot/dts directory for your upstream kernel. Now you only need to update the ubi partition on the target to deploy the device tree.