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

pyxcp == 0.22.23 , shortUpload function often gets the Shortupload value as feedback from other messages, resulting in incorrect values returned #205

Open
XuHaobang opened this issue Jan 17, 2025 · 1 comment

Comments

@XuHaobang
Copy link

Image

Image

@christoph2 pyxcp == 0.22.23 , shortUpload function often gets the Shortupload value as feedback from other messages, resulting in incorrect values returned. Can I fix this? The version of pyxcp-0.21.11 I used before is OK, I hope you can help me, thank you very much ~

my pyxcp_conf.py is :
c = get_config() # noqa

c.Transport.Can.Vector.serial = 529423 #CAN serial

c.Transport.Can.poll_interval = 0.001
c.Transport.Can.Vector.serial = 32634 #CAN serial
c.Transport.layer = 'CAN'
c.Transport.Can.padding_value = 0xAA
c.Transport.Can.use_default_listener = True
c.Transport.create_daq_timestamps = False
c.Transport.Can.Vector.rx_queue_size = 16384
c.Transport.Can.can_id_broadcast = 256
c.Transport.Can.interface = 'vector'
c.Transport.Can.max_dlc_required = True
c.Transport.Can.use_default_listener = True
c.Transport.Can.can_id_master = 0x580 # Master CAN ID
c.Transport.Can.can_id_slave = 0x581 # Slave CAN ID
c.Transport.Can.channel = 0 # CAN channel (e.g., 0 for Kvaser channel 0)
c.Transport.Can.bitrate = 500000 # CAN bitrate
c.Transport.Can.fd = True # CAN bitrate
c.Transport.Can.receive_own_messages = True # CAN bitrate
c.Transport.Can.data_bitrate = 2000000 # CAN bitrate
c.Transport.Can.sjw_abr = 8 # CAN bitrate
c.Transport.Can.tseg1_abr = 31 # CAN bitrate
c.Transport.Can.tseg2_abr = 8 # CAN bitrate
c.Transport.Can.sjw_dbr = 8 # CAN bitrate
c.Transport.Can.tseg1_dbr = 31 # CAN bitrate
c.Transport.Can.tseg2_dbr = 8 # CAN bitrate

@christoph2
Copy link
Owner

The interesting thing here is the -1:
The variable in question Master.slaveProperties.maxCto is set after a CONNECT service and one can expect a reasonable value for MAX_CTO, like 8 on CAN classic, but it seems to be zero here. A correct value is vital for block transfer, DAQ allocation and other things.

Could you run xcp-info and look for maxCto?

{'addressGranularity': EnumIntegerString.new(0, 'BYTE'),
 'byteOrder': EnumIntegerString.new(0, 'INTEL'),
 'bytesPerElement': 1,
 'interleavedMode': False,
 'masterBlockMode': False,
 'maxBs': 255,
 'maxCto': 8,
 'maxDto': 8,
 'maxWriteDaqMultipleElements': 0,
 'minSt': 0,
 'optionalCommMode': True,
 'pgmProcessor': {},
 'protocolLayerVersion': 1,
 'queueSize': 0,
 'slaveBlockMode': True,
 'supportsCalpag': True,
 'supportsDaq': True,
 'supportsPgm': True,
 'supportsStim': False,
 'transportLayerVersion': 1,
 'transport_layer': 'CAN',
 'xcpDriverVersionNumber': 10}

And could you also put a print statement in your code?

print(x.slaveProperties)

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

2 participants