Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fails on #include #44

Closed
bmx666 opened this issue Nov 29, 2021 · 2 comments
Closed

fails on #include #44

bmx666 opened this issue Nov 29, 2021 · 2 comments

Comments

@bmx666
Copy link

bmx666 commented Nov 29, 2021

I used ovmerge from RPI to generate sorted dts, but pyparser throw exception on #include

Traceback (most recent call last):
  /// REMOVED ///
    dtsBaseObj = Devicetree.parseFile(baseFile, followIncludes=True)
  File "/home/USER/.local/lib/python3.9/site-packages/pydevicetree/ast/node.py", line 468, in parseFile
    return parseTree(contents, dirname, followIncludes)
  File "/home/USER/.local/lib/python3.9/site-packages/pydevicetree/source/parser.py", line 185, in parseTree
    return Devicetree(parseElements(dts, pwd, followIncludes))
  File "/home/USER/.local/lib/python3.9/site-packages/pydevicetree/source/parser.py", line 177, in parseElements
    elements = grammar.devicetree.parseString(dts, parseAll=True)
  File "/home/USER/.local/lib/python3.9/site-packages/pyparsing/core.py", line 1127, in parse_string
    raise exc.with_traceback(None)
pyparsing.exceptions.ParseException: Expected end of text, found '#'  (at char 11), (line:3, col:1)
/dts-v1/;

#include <dt-bindings/pinctrl/bcm2835.h>
#include <dt-bindings/clock/bcm2835.h>
#include <dt-bindings/clock/bcm2835-aux.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/soc/bcm2835-pm.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/power/raspberrypi-power.h>
#include <dt-bindings/reset/raspberrypi,firmware-reset.h>

/memreserve/ 0x00000000 0x00001000;

/ {
        #address-cells = <2>;
        #size-cells = <1>;
        ....
};
@Moneysac90
Copy link

This is mostly likely not caused by # in (line:3, col:1) indicated by the error message. I submitted a pull request (#53) that fixes some parsing issues. If parsing fails due to incomplete grammar definition the resulting error message is always the same.

For debugging we therefore need the complete .dts file.

@bmx666
Copy link
Author

bmx666 commented Jun 26, 2024

I switched on pyFDT long time ago and did few modification for my custom project Device Tree Visualizer.
I don't use this project anymore because it's not maintained and has a lot of issues.

@bmx666 bmx666 closed this as completed Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants