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[0]’ is partly outside array bounds of ‘unsigned char[4]’ [-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];
Could you please send us some more information regarding the BSP or TorizonCore that you are using on the module? Could you please send us the output of tdx-info command (Getting Device Information with Tdx-Info | Toradex Developer Center) from which we will get all the hardware and software information?
Also, could you please share with us the overlay file you have written so that we could try to reproduce the issue?
Hello Rudhi,
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.
Could you please send me the output of echo $PATH command?
Also, please send the absolute path where gcc-linaro and dtc are installed.
Have you built the linux kernel as a mandatory requirement?
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
$ make
$ export PATH=$HOME/dtc/:$PATH
Thanks for reporting this error. Please let me know if this solves your issue.
When I run:
make imx_v6_v7_defconfig
I get:
scripts/Kconfig.include:39: C compiler ‘arm-none-linux-gnueabihf-gcc’ not found
make[1]: *** [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.
Thanks
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.
I tried to reproduce the error on the exact same setup as yours but unfortunately, I couldn’t.
I followed all the steps listed on our web page and it just worked fine. It looks like you are probably missing one or several of the steps. Could you please retry?
right now I can compile. There was a problem inside my export_compiler file.
Now, when a compile the dts, I get:
“CHK version_gen.h
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:
CHK version_gen.h
make[1]: ingresso nella directory «/home/showroom/Dev/Toradex/ImageDev/DeviceTree/dtc»
CHK version_gen.h
PYMOD pylibfdt/_libfdt.so
/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[1]: 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 ?
Hi,
I haven’t received answer about my last post, but I can produce the dtbo files.
I do another question: how can I do the dtb file ?
I only run the “make” command. There are some options to use ?
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.