How to build dts file?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to build dts file?

ソリューションへジャンプ
16,352件の閲覧回数
yunbaekim
Contributor II


Hello

I complete build full source.

#MACHINE='imx6dlsabreauto'

#source setup-environment build

#bitbake fsl-image-machine-test

And then I was modify '.dts' file.

How to build dts file simply ?

: imx6, sabreauto

ラベル(1)
1 解決策
6,080件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi yunbaekim

utility called device tree compiler (DTC) is used to compile the DTS file into a

DTB file. DTC is part of the Linux source directory. Examples of usage one can find

on web, like :

http://stackoverflow.com/questions/21670967/compiling-source-device-tree-file

http://xillybus.com/tutorials/device-tree-zynq-1

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

元の投稿で解決策を見る

0 件の賞賛
6 返答(返信)
5,967件の閲覧回数
et0
Contributor II

[posted in error, deleted]

0 件の賞賛
6,080件の閲覧回数
Yuri
NXP Employee
NXP Employee

Hello,

Please take a look at page 20 of the Massimo's presentation

Device Tree Made Easy

Also, the following helps.

Basic Device Tree for the Udoo Board

Regards,

Yuri.

0 件の賞賛
6,081件の閲覧回数
igorpadykov
NXP Employee
NXP Employee

Hi yunbaekim

utility called device tree compiler (DTC) is used to compile the DTS file into a

DTB file. DTC is part of the Linux source directory. Examples of usage one can find

on web, like :

http://stackoverflow.com/questions/21670967/compiling-source-device-tree-file

http://xillybus.com/tutorials/device-tree-zynq-1

Best regards

igor

-----------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
6,080件の閲覧回数
yunbaekim
Contributor II

hello igorpadykov

I installed dtc

#sudo apt-get install device-tree-compiler

and moved to arch/arm/boot/dts folder.

#dtc -O dtb -o imx6dl-sabreauto-gpmi-weim.dtb imx6dl-sabreauto-gpmi-weim.dts

DTC: dts->dtb  on file "imx6dl-sabreauto-gpmi-weim.dts"

Error: imx6dl-sabreauto-gpmi-weim.dts:9.1-2 syntax error

FATAL ERROR: Unable to parse input tree

what is wrong?

0 件の賞賛
6,080件の閲覧回数
robertberringto
Contributor II

yunbaekim,

I had the same issue. I found out that the Yocto DTS files do not strictly follow the Device-Tree syntax as they include c/c++ pre-processors. The file(s) must first be "scrubbed", then run through the dtc compiler.

I found this to be useful:

https://linux-sunxi.org/Device_Tree#Compiling_the_Device_Tree

In case the link doesn't work, here's the gist:

```

$ IDE=<your-device-name>

$ SRC=$IDE.dts

$ TMP=$IDE.tmp.dts

$ DST=$IDE.dtb

$ cpp -nostdinc -I include -undef -x assembler-with-cpp $SRC > $TMP

$ dtc -O dtb -b 0 -o $DST $TMP

$ rm $TMP

```

6,080件の閲覧回数
danmacdonald
Contributor III

This is very helpful. For my case of building the device tree, my procedure was as follows:

$ cd ...../arch/arm/boot/dts/

$ sh compileDeviceTree.sh 

where I simply put those commands into a script

#!/bin/sh
echo "----compiling test device tree------"
# replace abc with your file name
IDE=abc
SRC=$IDE.dts
TMP=$IDE.tmp.dts
DST=$IDE.dtb
cpp -nostdinc -I include -undef -x assembler-with-cpp $SRC > $TMP
~/bsp-root/...../tmp/sysroots/x86_64-linux/usr/bin/dtc -O dtb -b 0 -o $DST $TMP
rm $TMP