I wanted to patch the SVDs to make some registers RW instead of RO, but could not test my changes as update.sh would only give me the following output, where svd patch
crashes - note that this is WITHOUT any changes to the .yaml:
+ cargo install --version 0.19.0 svd2rust
Ignored package `svd2rust v0.19.0` is already installed, use --force to override
+ cargo install --version 0.7.0 form
Ignored package `form v0.7.0` is already installed, use --force to override
+ rustup component add rustfmt
info: component 'rustfmt' for target 'x86_64-unknown-linux-gnu' is up to date
+ pip3 install --upgrade --user 'svdtools>=0.1.15'
Requirement already satisfied: svdtools>=0.1.15 in /home/gottsch/.local/lib/python3.9/site-packages (0.1.18)
WARNING: Keyring is skipped due to an exception: Failed to unlock the keyring!
Requirement already satisfied: lxml~=4.6 in /usr/lib64/python3.9/site-packages (from svdtools>=0.1.15) (4.6.3)
Requirement already satisfied: click~=8.0 in /home/gottsch/.local/lib/python3.9/site-packages (from svdtools>=0.1.15) (8.0.1)
Requirement already satisfied: braceexpand~=0.1.7 in /home/gottsch/.local/lib/python3.9/site-packages (from svdtools>=0.1.15) (0.1.7)
Requirement already satisfied: PyYAML~=5.3 in /usr/lib64/python3.9/site-packages (from svdtools>=0.1.15) (5.4.1)
+ rm -rf src
+ mkdir src
+ svd patch svd/rp2040.yaml
Traceback (most recent call last):
File "/home/gottsch/.local/bin/svd", line 8, in <module>
sys.exit(svdtools_cli())
File "/home/gottsch/.local/lib/python3.9/site-packages/click/core.py", line 1137, in __call__
return self.main(*args, **kwargs)
File "/home/gottsch/.local/lib/python3.9/site-packages/click/core.py", line 1062, in main
rv = self.invoke(ctx)
File "/home/gottsch/.local/lib/python3.9/site-packages/click/core.py", line 1668, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/gottsch/.local/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/gottsch/.local/lib/python3.9/site-packages/click/core.py", line 763, in invoke
return __callback(*args, **kwargs)
File "/home/gottsch/.local/lib/python3.9/site-packages/svdtools/cli.py", line 16, in patch
svdtools.patch.main(yaml_file)
File "/home/gottsch/.local/lib/python3.9/site-packages/svdtools/patch.py", line 1472, in main
process_device(svd, root)
File "/home/gottsch/.local/lib/python3.9/site-packages/svdtools/patch.py", line 1449, in process_device
d.process_peripheral(periphspec, device[periphspec], update_fields)
File "/home/gottsch/.local/lib/python3.9/site-packages/svdtools/patch.py", line 670, in process_peripheral
p.process_register(rspec, register, update_fields)
File "/home/gottsch/.local/lib/python3.9/site-packages/svdtools/patch.py", line 1050, in process_register
r.process_field(pname, fspec, field)
File "/home/gottsch/.local/lib/python3.9/site-packages/svdtools/patch.py", line 1298, in process_field
self.process_field_enum(pname, fspec, field)
File "/home/gottsch/.local/lib/python3.9/site-packages/svdtools/patch.py", line 1316, in process_field_enum
for ftag in sorted_fields(list(self.iter_fields(fspec))):
File "/home/gottsch/.local/lib/python3.9/site-packages/svdtools/patch.py", line 1060, in sorted_fields
return sorted(fields, key=lambda ftag: int(ftag.find("bitOffset").text, 0))
File "/home/gottsch/.local/lib/python3.9/site-packages/svdtools/patch.py", line 1060, in <lambda>
return sorted(fields, key=lambda ftag: int(ftag.find("bitOffset").text, 0))
AttributeError: 'NoneType' object has no attribute 'text'
Note that the keyring error early in the script does not really make sense given that pip purely installs dependencies in my home directory, but it should not have any negative impact, either.
Given that there are no modifications reported by git except those caused by update.sh, I would have expected the script to execute correctly.