pyxcp - Universal Calibration Protocol for Python

raw JSON →
0.29.7 verified Fri May 01 auth: no python

Python implementation of the XCP (Universal Measurement and Calibration Protocol) for ECU access via CAN, Ethernet, USB, etc. Current version 0.29.7, regular releases with critical bugfixes. Requires Python >=3.10.

pip install pyxcp
error ERR_OUT_OF_RANGE when configuring DAQ with interleavedMode=True
cause Sequence counter byte not included in overhead calculation (fixed in v0.28.0)
fix
Upgrade to pyxcp >=0.28.0 or disable interleavedMode
error ImportError: cannot import name 'Master' from 'pyxcp'
cause Older pyxcp version or wrong installation (Master is only available from pyxcp package top-level)
fix
pip install --upgrade pyxcp
error pyxcp.transport.can.CanCCPSlave is deprecated: use CanCcpslaveInterface instead
cause Class renamed in v0.27.0; old name still works but triggers deprecation warning
fix
Use CanCcpslaveInterface instead (case-sensitive)
breaking DAQ InterleavedMode calculation bug: setting interleavedMode=True could cause ERR_OUT_OF_RANGE. Fixed in v0.28.0.
fix Upgrade to pyxcp >=0.28.0
breaking CAN-FD padding corruption: variable-length CAN FD frames could have corrupted padding bytes. Fixed in v0.27.1.
fix Upgrade to pyxcp >=0.27.1
gotcha Import path changed: SlaveProperties no longer available from pyxcp.slave. Import from pyxcp directly.
fix Use 'from pyxcp import SlaveProperties'

Connect to an XCP slave over CAN and read slave properties.

from pyxcp import Master, SlaveProperties
import pyxcp.transport.can as can

master = Master(can.CanCCPSlave(channel='can0', baudrate=500000))
props = master.getSlaveProperties()
print(f"Slave ID: {props.slaveId}, Protocol: {props.protocolVersion}")
master.disconnect()