Device tree compiler throws error dtc: invalid option — '@'

1,403 views
Skip to first unread message

Mrigendra Chaubey

unread,
Oct 5, 2017, 2:51:26 AM10/5/17
to BeagleBoard

Hi All,



I am trying to compile an overlay and use it for study purpose but I am not able to compile an overlay. For example I took an example device tree overlay from derek molloy blog

git clone git://github.com/derekmolloy/boneDeviceTree.git

and now I have a directory with a name overlay. In that a script build is there that have the compilation command for this overlay. this is the command inside build


#!/bin/bash

echo "Compiling the overlay from .dts to .dtbo"

dtc -O dtb -o DM-GPIO-Test-00A0.dtbo -b 0 -@ DM-GPIO-Test.dts
 

DM-GPIO-Test.dts file is the source overlay file and DM-GPIO-Test-00A0.dtbo is the output.

Now if I run this script I get this message


./build 
Compiling the overlay from .dts to .dtbo
dtc: invalid option -- '@'
Usage: dtc [options] <input file>

Options: -[qI:O:o:V:d:R:S:p:fb:i:H:sW:E:hv]
  -q, --quiet                
    Quiet: -q suppress warnings, -qq errors, -qqq all
  -I, --in-format <arg>      
    Input formats are:
        dts - device tree source text
        dtb - device tree blob
        fs  - /proc/device-tree style directory
  -o, --out <arg>            
    Output file
  -O, --out-format <arg>     
    Output formats are:
        dts - device tree source text
        dtb - device tree blob
        asm - assembler source
  -V, --out-version <arg>    
    Blob version to produce, defaults to %d (for dtb and asm output)
  -d, --out-dependency <arg> 
    Output dependency file
  -R, --reserve <arg>        
    tMake space for <number> reserve map entries (for dtb and asm output)
  -S, --space <arg>          
    Make the blob at least <bytes> long (extra space)
  -p, --pad <arg>            
    Add padding to the blob of <bytes> long (extra space)
  -b, --boot-cpu <arg>       
    Set the physical boot cpu
  -f, --force                
    Try to produce output even if the input tree has errors
  -i, --include <arg>        
    Add a path to search for include files
  -s, --sort                 
    Sort nodes and properties before outputting (useful for comparing trees)
  -H, --phandle <arg>        
    Valid phandle formats are:
        legacy - "linux,phandle" properties only
        epapr  - "phandle" properties only
        both   - Both "linux,phandle" and "phandle" properties
  -W, --warning <arg>        
    Enable/disable warnings (prefix with "no-")
  -E, --error <arg>          
    Enable/disable errors (prefix with "no-")
  -h, --help                 
    Print this help and exit
  -v, --version              
    Print version and exit

Error: unknown option

 

I did install device-tree-compiler before issuing this command.

My system is ubuntu 14.04, 64 bit.

What is wrong here?

Robert Nelson

unread,
Oct 5, 2017, 10:52:30 AM10/5/17
to Beagle Board, mrigendr...@gmail.com
The "-@" option was added after 14.04 was released.

Now to correctly build the correct version of dtc, are you using a
3.8.13 or a 4.4.x+ based kernel on your BeagleBone?

Regards,

--
Robert Nelson
https://rcn-ee.com/

Mrigendra Chaubey

unread,
Oct 5, 2017, 10:54:51 AM10/5/17
to BeagleBoard
Hi Robert,

I am using kernel 3.8.13.

Regards,
Mrigendra 

Mrigendra Chaubey

unread,
Oct 5, 2017, 10:57:38 AM10/5/17
to BeagleBoard
I am first trying to compile a device tree overlay, in my ubuntu 14.04.
The overlay I am compiling for, is beaglebone black kernel 3.8

Robert Nelson

unread,
Oct 5, 2017, 11:04:31 AM10/5/17
to Beagle Board, mrigendr...@gmail.com
Then you'll want to use this script:

wget https://raw.githubusercontent.com/RobertCNelson/boot-scripts/master/tools/dtc/dtc-3.8.x.sh
chmod +x dtc-3.8.x.sh
./dtc-3.8.x.sh

to build a compatible version of dtc.

Mrigendra Chaubey

unread,
Oct 5, 2017, 11:09:07 AM10/5/17
to BeagleBoard
Yes that works.
Many thanks. 

Dennis Lee Bieber

unread,
Oct 5, 2017, 11:22:30 AM10/5/17
to beagl...@googlegroups.com
On Wed, 4 Oct 2017 23:51:26 -0700 (PDT), Mrigendra Chaubey
<mrigendr...@gmail.com> declaimed the
following:


>Compiling the overlay from .dts to .dtbo
>dtc: invalid option -- '@'
>Usage: dtc [options] <input file>
>

<snip list of options that does not include @>
>Error: unknown option*
>
>I did install device-tree-compiler before issuing this command.
>
>My system is ubuntu 14.04, 64 bit.
>
>What is wrong here?

Off-hand -- nothing other than possibly not searching documentation...

dtc for current Debian (I just installed to check) does not have an @
option. A google search for dtc options shows dtc for QEMU has/had @
https://fossies.org/linux/qemu/dtc/Documentation/manual.txt -- which does
also seem to match the text found in a link from Wikipedia

"""
122 -@
123 Generates a __symbols__ node at the root node of the resulting blob
124 for any node labels used, and for any local references using
phandles
125 it also generates a __local_fixups__ node that tracks them.
126
127 When using the /plugin/ tag all unresolved label references to
128 be tracked in the __fixups__ node, making dynamic resolution
possible.
129
130 -A
131 Generate automatically aliases for all node labels. This is similar
to
132 the -@ option (the __symbols__ node contain identical information)
but
133 the semantics are slightly different since no phandles are
automatically
134 generated for labeled nodes.
"""

(Appears "A" is not supported anymore either).


So... Try editing the command line to remove the "-@" option

--
Wulfraed Dennis Lee Bieber AF6VN
wlf...@ix.netcom.com HTTP://wlfraed.home.netcom.com/

Robert Nelson

unread,
Oct 5, 2017, 11:30:38 AM10/5/17
to Beagle Board, wlf...@ix.netcom.com
Incorrect, as that won't work, the "-@" generates symbol information,
for use as an overlay.

In 3.8.13, we an early version of "dtc: Plugin and fixup support"

A later version went mainline as of dtc-1.4.3:

https://git.kernel.org/pub/scm/utils/dtc/dtc.git/commit/?id=20f29d8d41f6d1bd2fbe466aa5676026eb012832

Debian (and thus ubuntu) only has dtc-1.4.2 in the stable branches..

Sid recently got dtc-1.4.5

Dennis Lee Bieber

unread,
Oct 5, 2017, 1:47:12 PM10/5/17
to beagl...@googlegroups.com
On Thu, 5 Oct 2017 10:29:53 -0500, Robert Nelson
<robert...@gmail.com> declaimed the
following:

>Incorrect, as that won't work, the "-@" generates symbol information,
>for use as an overlay.
>
>In 3.8.13, we an early version of "dtc: Plugin and fixup support"
>
>A later version went mainline as of dtc-1.4.3:
>
>https://git.kernel.org/pub/scm/utils/dtc/dtc.git/commit/?id=20f29d8d41f6d1bd2fbe466aa5676026eb012832
>
>Debian (and thus ubuntu) only has dtc-1.4.2 in the stable branches..
>
>Sid recently got dtc-1.4.5
>

<sigh> And people complain about Windows DLL matches...

Robert Nelson

unread,
Oct 5, 2017, 2:27:41 PM10/5/17
to Beagle Board
On Thu, Oct 5, 2017 at 12:46 PM, Dennis Lee Bieber
<wlf...@ix.netcom.com> wrote:
> On Thu, 5 Oct 2017 10:29:53 -0500, Robert Nelson
> <robert...@gmail.com> declaimed the
> following:
>
>>Incorrect, as that won't work, the "-@" generates symbol information,
>>for use as an overlay.
>>
>>In 3.8.13, we an early version of "dtc: Plugin and fixup support"
>>
>>A later version went mainline as of dtc-1.4.3:
>>
>>https://git.kernel.org/pub/scm/utils/dtc/dtc.git/commit/?id=20f29d8d41f6d1bd2fbe466aa5676026eb012832
>>
>>Debian (and thus ubuntu) only has dtc-1.4.2 in the stable branches..
>>
>>Sid recently got dtc-1.4.5
>>
>
> <sigh> And people complain about Windows DLL matches...

how do you figure?

news at 11, "stable" distro's don't package "in-development" code...

Mrigendra Chaubey

unread,
Oct 5, 2017, 2:34:09 PM10/5/17
to BeagleBoard
One small question that is not related to upper discussion.
On beaglebone, i2c-2 instance,that  is on pins p9_19 and p9_20. Is this mapped as i2c1?
If this is already mapped, why do I(or people) need to create an overlay file?Its already there.
Also if I do create an overlay file and compile it and put it into /lib/firmware, and invoke slot mechanism of bonmgr, it gets a slot. But it is not discover able on reboot again. Is it?
So how do I add an i2c device permanently whenever my bbb boots up?How is device tree better than previous board file concept?

Robert Nelson

unread,
Oct 5, 2017, 2:50:44 PM10/5/17
to Beagle Board, mrigendr...@gmail.com
On Thu, Oct 5, 2017 at 1:34 PM, Mrigendra Chaubey
<mrigendr...@gmail.com> wrote:
>> One small question that is not related to upper discussion.
>
> On beaglebone, i2c-2 instance,that is on pins p9_19 and p9_20. Is this
> mapped as i2c1?

i2c-2/i2c-1 is a bug in 3.8.13

> If this is already mapped, why do I(or people) need to create an overlay
> file?Its already there.

Usually we just define the hardware at the i2c location..

> Also if I do create an overlay file and compile it and put it into
> /lib/firmware, and invoke slot mechanism of bonmgr, it gets a slot. But it
> is not discover able on reboot again. Is it?

Not unless you tell it to load it..

> So how do I add an i2c device permanently whenever my bbb boots up?

There's a few ways, since your using 3.8.13, stick the name in:

/etc/default/capemgr

or write an init scrip to do it..

> How is
> device tree better than previous board file concept?

if you just "booted" supported devices no difference.

If your working on new designs, modifcations, etc... it's a whole lot easer..

Roberts Maria

unread,
Oct 5, 2017, 6:04:41 PM10/5/17
to beagl...@googlegroups.com

--------------------------------------------
On Thu, 10/5/17, Robert Nelson <robert...@gmail.com> wrote:

Subject: Re: [beagleboard] Device tree compiler throws error dtc: invalid option — '@'
To: "Beagle Board" <beagl...@googlegroups.com>, mrigendr...@gmail.com
Date: Thursday, October 5, 2017, 9:49 PM
--
For more options, visit http://beagleboard.org/discuss
---
You received this message
because you are subscribed to the Google Groups
"BeagleBoard" group.
To
unsubscribe from this group and stop receiving emails from
it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/beagleboard/CAOCHtYhTfnZvm4RkuuEeezN-b5OCxX_7-UXJ_rtj8rj_gzb9vw%40mail.gmail.com.
For
more options, visit https://groups.google.com/d/optout.
rasatura esentiala a revolutiei trecand peste o bogata mostenire culturala si ideologica a fost deplina solidaritate nationala reliefata de programele revolutionare si marile r adunari populare. Conjunctura inter-nationala raporturile de forte intre marile imperii interesele lor specifice fata de Principate ca si situatia politica si sociala la nivelul fiecarei provincii romanesti au imprimat anumite trasaturi procesului revolutionar

phwo...@gmail.com

unread,
May 6, 2019, 7:58:10 AM5/6/19
to BeagleBoard
Thanks for posting solution. where is the new version of dtc reside? I ran the dtc again but it's still showing the old version (1.4.0) and dtc does not support the -@.    I also tried looking through the directory where i ran that script, but dtc no where to be found. 
thanks.
-Peter

Robert Nelson

unread,
May 7, 2019, 10:17:07 AM5/7/19
to Beagle Board, phwo...@gmail.com
On Mon, May 6, 2019 at 6:58 AM <phwo...@gmail.com> wrote:
>
> Thanks for posting solution. where is the new version of dtc reside? I ran the dtc again but it's still showing the old version (1.4.0) and dtc does not support the -@. I also tried looking through the directory where i ran that script, but dtc no where to be found.

Use "any" one of these official dtc release:

v1.4.4
v1.4.6
v1.4.7
v1.5.0

https://git.kernel.org/pub/scm/utils/dtc/dtc.git/

tolliug

unread,
Apr 1, 2020, 2:36:24 PM4/1/20
to BeagleBoard
Hello Does this mean the dtc v1.4.5 is buggy? I am using a ubuntu 18.04 OS with dtc 1.4.5 and do not succeed to compile unless using your script. May you provide a link that describe the issue? Is it due to a bad syntax of the dts?

Regards

Robert Nelson

unread,
Apr 1, 2020, 2:40:52 PM4/1/20
to Beagle Board, jeremie...@madintec.com
On Wed, Apr 1, 2020 at 1:36 PM tolliug <jeremie...@madintec.com> wrote:
>
> Hello Does this mean the dtc v1.4.5 is buggy? I am using a ubuntu 18.04 OS with dtc 1.4.5 and do not succeed to compile unless using your script. May you provide a link that describe the issue? Is it due to a bad syntax of the dts?

Correct, dtc v1.4.5 is buggy.

Last i looked, ubuntu 18.04 had back-ported a few fixes into their
version of dtc 1.4.5, so it 'should' be fine..

What issue are you actually having?
Reply all
Reply to author
Forward
0 new messages