Riko
May 2, 2017, 11:39pm
1
Hello everyone,
I have question regarding compiling overlay for cape,
I got the example from :
https://github.com/beagleboard/bb.org-overlays/tree/master/src/arm
Some information that I can collect,
I tried to compile with on these lines :
#include <dt-bindings/board/am335x-bbw-bbb-base.h> #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/pinctrl/am33xx.h>
`
debian@beaglebone:~/test$ dtc --version
Version: DTC 1.4.4
debian@beaglebone:~/test$ uname -a
Linux beaglebone 4.4.54-ti-r93 #1 SMP Fri Mar 17 13:08:22 UTC 2017 armv7l GNU/Linux
`
the error :
dtc EBB-GPIO-Example.dts -O dtb -o EBB-GPIO-Example-00A0.dtbo Error: EBB-GPIO-Example.dts:17.1-9 syntax error FATAL ERROR: Unable to parse input tree
Does anyone know how to fix it ? or experience the same thing ?
Thanks
Without the source, no one will be able to give you a correct answer. That is, the source file EXACTLY how it is when you got that error.
Additionally. This is an error that one typically gets, when trying to compile one of those overlays without compiling it from the bb-overlay git project. e.g. downloading one file, and trying ot compile it manually through dtc. Instead of putting your source file into the src/arm directory, and moving into the git root directory and issuing “make”. Two ways to go about that, but we can get to that later.
So, knowing what command you used EXACTLY what command when you attempted to build your file would be necessary.
Riko
May 3, 2017, 2:10am
4
Yes I only use the “include” for a test on GPIO,
how can I use one of the overlay and modify it ? thanks
The complete code :
/*
Copyright © 2012 Texas Instruments Incorporated - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Purpose License Version 2 as * published by the Free Software Foundation * * Original from: github.com/jadonk/validation-scripts/blob/master/test-capemgr/ * * / /dts-v1/; /plugin/; #include <dt-bindings/board/am335x-bbw-bbb-base.h> #include <dt-bindings/gpio/gpio.h> #include <dt-bindings/pinctrl/am33xx.h> /{ compatible = “ti,beaglebone”, “ti,beaglebone-black”; part-number = “EBB-GPIO-Example”; version = “00A0”; fragment@0 { target = <&am33xx_pinmux>; overlay { ebb_example: EBB_GPIO_Example { pinctrl-single,pins = < 0x070 0x07 // P9_11 PINS$28 GPIO0_30 = 30 Output Mode7 pulldown 0x074 0x37 // P9_13 PINS$29 GPIO0_31 = 31 Input Mode7 pullup / OUTPUT GPIO(mode7) 0x07 pulldown, 0x17 pullup, 0x?f no pullup/down / / INPUT GPIO(mode7) 0x27 pulldown, 0x37 pullup, 0x?f no pullup/down */ >; }; }; }; fragment@1 { target = <&ocp>; overlay { gpio_helper { compatible = “gpio-of-helper”; status = “okay”; pinctrl-names = “default”; pinctrl-0 = <&ebb_example>; }; }; }; };
You want a definitive answer ? Learn how device tree overlays work. Modify
an overlay that is closest to fitting your needs. Then compile it.
Which is to say the question you pose it something like "My car won;t
start, how do I fix it ?" . . .
Dont call "dtc" directly.. you have "#include "'s dtc doesn't know how
to deal with that..
run:
make arm/EBB-GPIO-Example.dtbo
so the gcc preprocessor which is defined in the makefile runs..
Regards,
Riko
May 3, 2017, 3:01am
7
@William Hermans
not a problem, learning is my part, ask to someone who knows better than me, making it easier.
#include <dt-bindings/board/am335x-bbw-bbb-base.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/pinctrl/am33xx.h>
/{
compatible = "ti,beaglebone", "ti,beaglebone-black";
part-number = "EBB-GPIO-Example";
version = "00A0";
fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {
ebb_example: EBB_GPIO_Example {
pinctrl-single,pins = <
0x070 0x07 // P9_11 PINS$28 GPIO0_30 = 30
Output Mode7 pulldown
0x074 0x37 // P9_13 PINS$29 GPIO0_31 = 31
Input Mode7 pullup
no reason for the 3 includes if your just going to hard code ^...
Regards,
easy like i sad..(adjusted for the ./src/ path)
make src/arm/EBB-GPIO-Example.dtbo
Here's the full step by step:
voodoo@hestia:/opt/git_repo$ git clone
https://github.com/beagleboard/bb.org-overlays
voodoo@hestia:/opt/git_repo$ cd ./bb.org-overlays/
voodoo@hestia:/opt/git_repo/bb.org-overlays$ gedit src/arm/EBB-GPIO-Example.dts
<copy your code block in>
voodoo@hestia:/opt/git_repo/bb.org-overlays$ make src/arm/EBB-GPIO-Example.dtbo
DTC src/arm/EBB-GPIO-Example.dtbo
voodoo@hestia:/opt/git_repo/bb.org-overlays$ ls -lh src/arm/EBB-GPIO-Example.dt*
-rw-r--r-- 1 voodoo voodoo 881 May 2 22:22 src/arm/EBB-GPIO-Example.dtbo
-rw-r--r-- 1 voodoo voodoo 1.6K May 2 22:21 src/arm/EBB-GPIO-Example.dts
Regards,
Riko
May 3, 2017, 3:25am
10
Wow, thank you very much for that, I’ll try and return to you later on.
Just remember to use the repo
https://github.com/beagleboard/bb.org-overlays
The "examples" aren't just there to look pretty..
The repo is used in production, and everything is abstracted out to
the makefile to make developers lives easier.
Regards,
No, you're right, it's not a problem. But it helps if you ask a question.
But your part includes asking a question that has a definitive answer. You
can't just give people your kernel version, and dtc version then ask a
question that could be answered by a whole book. Then expect to get any
answer at all . . .
I messed that answer all up., Anyhow the point is you need to ask specific
questions. Robert pretty much came back with things I already mentioned in
my post, then you thank him and fsck all to me I guess. But, thats not the
point I don't care about who you thank. The point is, you need to learn how
to ask a question. Otherwise, I'll just come back with "the sky is blue,
and fsck you. . . ."
Riko
May 3, 2017, 4:47am
15
hehehe, fsck yourself if you don’t know how to answer…yes it is the sky is blue…and don’t worry to answer if you don’t know…as simple as that.
Done mate
Riko
May 3, 2017, 5:41am
16
Almost get there but there is error?
make src/arm/EBB-GPIO-Example.dtbo DTC src/arm/EBB-GPIO-Example.dtbo /bin/sh: 1: scripts/basic/fixdep: Permission denied Makefile:136: recipe for target ‘src/arm/EBB-GPIO-Example.dtbo’ failed make[1]: *** [src/arm/EBB-GPIO-Example.dtbo] Error 126 Makefile:100: recipe for target ‘src/arm/EBB-GPIO-Example.dtbo’ failed make: *** [src/arm/EBB-GPIO-Example.dtbo] Error 2
Riko
May 3, 2017, 5:46am
17
Fix it, thanks a lot for the clues
ls -alh total 12K drwxr-xr-x 2 debian debian 4.0K May 2 11:02 . drwxr-xr-x 3 debian debian 4.0K May 2 11:02 … -rw-r–r-- 1 debian debian 656 May 1 17:23 fixdep chmod +x fixdep cd … cd … make src/arm/EBB-GPIO-Example.dtbo DTC src/arm/EBB-GPIO-Example.dtbo
Except, I had a really good idea what your problem was, just that you were
being obtuse with your answers. All I needed was one question answered form
you, and the problem would have been solved. But hey, got a problem with me
helping you ? fine. I will remember.