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

do I misuse this package? #68

Open
jfongattw opened this issue Feb 24, 2019 · 0 comments
Open

do I misuse this package? #68

jfongattw opened this issue Feb 24, 2019 · 0 comments

Comments

@jfongattw
Copy link

After tring the latest version(Feb 17, 2019), I get the following two errors. Do I access them correctly?

Thank you:-)

Microsoft Windows [版本 6.0.6001]
Copyright (c) 2006 Microsoft Corporation. All rights reserved.

D:\Works\Python\cmsis-svd-master\python>py
Python 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

import cmsis_svd
from cmsis_svd.parser import SVDParser
parser = SVDParser.for_packaged_svd('Atmel', 'ATSAMV71J19B.svd')
for peripheral in parser.get_device().peripherals:
... for reg in peripheral.registers:
... print(reg.name, reg.address_offset)
...
ACC_CR 0
ACC_MR 4
ACC_IER 36
ACC_IDR 40
ACC_IMR 44
ACC_ISR 48
ACC_ACR 148
ACC_WPMR 228
ACC_WPSR 232
ACC_VER 252
Traceback (most recent call last):
File "", line 2, in
File "D:\Works\Python\cmsis-svd-master\python\cmsis_svd\model.py", line 505, in registers
regs.extend(arr.registers)
File "D:\Works\Python\cmsis-svd-master\python\cmsis_svd\model.py", line 207, in registers
name=self.name % self.dim_indices[i],
TypeError: not all arguments converted during string formatting

For device ('NXP', 'LPC178x_7x.svd'), there is another type of error:
...
...
RXBITRATE 44
TXMODE 48
RXMODE 52
Traceback (most recent call last):
File "", line 2, in
File "D:\Works\Python\cmsis-svd-master\python\cmsis_svd\model.py", line 502, in registers
for reg in self._lookup_possibly_derived_attribute('registers'):
TypeError: 'NoneType' object is not iterable

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

1 participant