ebroecker / canmatrix

Converting Can (Controller Area Network) Database Formats .arxml .dbc .dbf .kcd ...
BSD 2-Clause "Simplified" License
924 stars 399 forks source link

Error converting from arxml (to anything) using dev-0.6 #70

Closed nostar closed 7 years ago

nostar commented 7 years ago
INFO - convert - Importing ASR.arxml ...
DEBUG - arxml - Read arxml ...
DEBUG - arxml -  Done

DEBUG - arxml - Build arTree ...
DEBUG - arxml -  Done

DEBUG - arxml - DEBUG 0 frames in arxml...
DEBUG - arxml - DEBUG 181 can-frame-triggering in arxml...
DEBUG - arxml - DEBUG 0 SIGNAL-TO-PDU-MAPPINGS in arxml...
DEBUG - arxml - DEBUG 808 I-SIGNAL-TO-I-PDU-MAPPING in arxml...
DEBUG - arxml - Busname: CAN_2_Cluster
DEBUG - arxml -  Speed: 500
DEBUG - arxml -  Speed: 500
DEBUG - arxml - 181 frames found in arxml
...
...
Traceback (most recent call last):
  File "/usr/bin/canconvert", line 9, in <module>
    load_entry_point('canmatrix==0.5', 'console_scripts', 'canconvert')()
  File "build/bdist.cygwin-2.4.1-i686/egg/canmatrix/convert.py", line 294, in main
  File "build/bdist.cygwin-2.4.1-i686/egg/canmatrix/convert.py", line 41, in convert
  File "build/bdist.cygwin-2.4.1-i686/egg/canmatrix/formats.py", line 54, in loadp
  File "build/bdist.cygwin-2.4.1-i686/egg/canmatrix/formats.py", line 63, in load
  File "build/bdist.cygwin-2.4.1-i686/egg/canmatrix/arxml.py", line 1558, in load
IndexError: list index out of range
nostar commented 7 years ago

I have 4 arxml files. The smallest of the four converts successfully. This file contains 85 frames. The other 3 that fail with the same error contain 143, 181, and 249.

ebroecker commented 7 years ago

Hi nostar,

do you have CAN-FD frames in your ARXML? There is currently a restriction of max 8 bytes per frame in the code. (https://github.com/ebroecker/canmatrix/blob/35d37af702b10be5dfaaeccf7c390f0b10751b2d/canmatrix/arxml.py#L1545)

I'll fix this soon.

nostar commented 7 years ago

these arxml files are used on a can-fd bus (higher data rate than nominal) but there should not be any frames > 8 bytes. Is there a way to output which frame or line in the arxml is causing the issue?

EDIT: "should not be" but in fact there are frames > 8 in the files in question. Strange thing is that those frames do not appear in vector autosar explorer at all. I had to find them by parsing thru all the tags manually.

ebroecker commented 7 years ago

I just added a quickfix for this issue - hope it works

EDIT: any success with the patch?

nostar commented 7 years ago

Yes that works, thanks!

ebroecker commented 7 years ago

ok, I close this issue