I get the error mentioned in the title when attempting to read out any peripheral register. I suspect that this might be SVD dependent but I can reproduce this with the STM32L4x6.svd from cmsis-svd.
This error seems to be raised here as a result of the size field of a register being parsed as a string rather than an integer.
Here is a patch that fixes this for me. I'm not sure if that is the right solution though since it feels kinda hacky
diff --git a/cmdebug/svd.py b/cmdebug/svd.py
index fc5eb99..8364454 100755
--- a/cmdebug/svd.py
+++ b/cmdebug/svd.py
@@ -383,6 +383,9 @@ class SVDPeripheralRegister:
for f in fields:
self.fields[str(f.name)] = SVDPeripheralRegisterField(f, self)
+ if type(self.size) is not int:
+ self.size = int(str(self.size), 0)
+
def refactor_parent(self, parent: SVDPeripheral) -> None:
self.parent_base_address = parent.base_address
The strange thing about this is that I remember that I didn't have this issue before. I unfortunately don't really remember what I changed about my setup since then.
I get the error mentioned in the title when attempting to read out any peripheral register. I suspect that this might be SVD dependent but I can reproduce this with the STM32L4x6.svd from cmsis-svd.
This error seems to be raised here as a result of the size field of a register being parsed as a string rather than an integer.
Here is a patch that fixes this for me. I'm not sure if that is the right solution though since it feels kinda hacky
The strange thing about this is that I remember that I didn't have this issue before. I unfortunately don't really remember what I changed about my setup since then.