Read error
MYAN65536 opened this issue · comments
Could you run xcphello.py with -l DEBUG
option and post the trace or at least confirm that you are using MAX_DLC_REQUIRED=true
option?
Looks much like padded CAN frames -- shortUpload
currently just returns the raw response, which would be an explanation for this behaviour, even correct if address granularity == 1 ...
But anyways, I'll fix it.
probably fixed by latest commit
This is my other GitHub account. I will try it out tomorrow. Thank you very much
Note regarding UPLOAD
and SHORT_UPLOAD
:
Parameter length
requests a number of elements NOT bytes!
That is length multiplied by address granularity (1, 2, or 4 bytes); you get this information by inspecting/printing slaveProperties, as you did in your first screenshot (unfortunately AG isn't visible...).
An AG of 4 would fit in the picture:
- maxCto is 8 bytes (obviously CAN classic).
- max. payload is maxCto minus one byte result code (0xff) ==> 7 bytes.
- 2 elements ==> 8 bytes, one off, ERR_OUT_OF_RANGE.
One thing I forgot to mention:
the addressGranularity
member of slaveProperties
is more or less decorative in the first place;
since the last commit there's a new property bytesPerElement
which could directly used in calculations.
Hmm, really strange.
You may try some tests:
ADDR=0x20003bfc
# Should work, if there is no access protection in this range.
for addr in range(ADDR-4, ADDR+4):
x.shortUpload(1, addr, 0)
# same, with two elements/bytes.
for addr in range(ADDR-4, ADDR+4):
x.shortUpload(2, addr, 0)
# you should also test other known-good addresses from your A2L.
x.setMta(ADDR-8, 0)
data = x.fetch(16) # calls UPLOAD not SHORT_UPLOAD under the hood.
OK.Thank you very much