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

xml.etree.ElementTree.ParseError: XML or text declaration not at start of entity: line 1, column 2 while resetting gd32f470zg #1655

Open
WangYihang opened this issue Dec 21, 2023 · 1 comment

Comments

@WangYihang
Copy link

Description

pyocd crashes while using the following command to reset a GD32F470ZG chip.

Command

# pyocd reset --target gd32f470zg
0000498 W Board ID 5V-I is not recognized [mbed_board]
Exception in thread load-svd:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/root/.local/share/pipx/venvs/pyocd/lib/python3.9/site-packages/pyocd/debug/svd/loader.py", line 72, in run
    self._svd_location.load()
  File "/root/.local/share/pipx/venvs/pyocd/lib/python3.9/site-packages/pyocd/debug/svd/loader.py", line 48, in load
    self.device = SVDParser.for_xml_file(self.filename).get_device()
  File "/root/.local/share/pipx/venvs/pyocd/lib/python3.9/site-packages/pyocd/debug/svd/parser.py", line 74, in for_xml_file
    return cls(ET.parse(path), remove_reserved)
  File "/usr/lib/python3.9/xml/etree/ElementTree.py", line 1229, in parse
    tree.parse(source, parser)
  File "/usr/lib/python3.9/xml/etree/ElementTree.py", line 580, in parse
    self._root = parser._parse_whole(source)
xml.etree.ElementTree.ParseError: XML or text declaration not at start of entity: line 1, column 2
0000848 W Invalid coresight component, cidr=0x0 [rom_table]

Environments

# uname -a
Linux pve 5.15.116-1-pve #1 SMP PVE 5.15.116-1 (2023-08-29T13:46Z) x86_64 GNU/Linux

# pyocd --version
0.36.0
@USTHzhanglu
Copy link

try to this

During the use of the script, an XML or text declaration not at start of entity error message will be reported, as \ cmsis pack manager \ cmsis pack manager \ GigaDevice \ GD32F4xx_ There is an issue with the XML format in the DFP \ 3.0.3. pack file, which contains an extra space; The solution is to open 3.0.3. pack in the format of a compressed file and rename the file with the suffix. svd in the SVD folder as<? XML version="1.0" encoding="utf-8" standalone="no" Remove the preceding space

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