You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maximum runtime adjustable debug level, higher level optimized out
OPTION_FIXED_DBG_LEVEL
Sets a fixed, not runtime adjustable logging level
2 · xcptl_cfg.h
This section describes the transport layer configuration parameters in xcptl_cfg.h.
Transport Layer Version
Parameter
Description
XCP_TRANSPORT_LAYER_VERSION
Defines the XCP transport layer version (0x0104)
Packet Size Configuration
Parameter
Description
XCPTL_MAX_CTO_SIZE
Maximum size of XCP command packets (CRO/CRM) in bytes. Must be divisible by 8 (default: 248)
XCPTL_MAX_DTO_SIZE
Maximum size of XCP data packets (DAQ/STIM) in bytes. Must be divisible by 8 (default: 1024)
XCPTL_MAX_SEGMENT_SIZE
Maximum data buffer size for socket send operations. For UDP, this is the UDP MTU. Calculated as OPTION_MTU - 32 (IP header)
XCPTL_PACKET_ALIGNMENT
Packet alignment for multiple XCP transport layer packets in a message (default: 4)
XCPTL_TRANSPORT_LAYER_HEADER_SIZE
Transport layer message header size in bytes (fixed: 4)
Multicast Configuration
Parameter
Description
XCPTL_ENABLE_MULTICAST
Enables multicast time synchronization for improved synchronization of multiple XCP slaves
XCLTL_RESTRICT_MULTICAST
Restricts multicast functionality (optional)
XCPTL_MULTICAST_PORT
Port number for multicast communication (default: 5557)
Note on Multicast: Multicast time synchronization is available since XCP V1.3 but requires an additional thread and socket. There's no benefit if PTP time synchronization is used or with only one XCP device. Older CANape versions may expect this option to be enabled by default.
3 · xcp_cfg.h
This section describes the XCP protocol layer configuration parameters in xcp_cfg.h.
Version Configuration
Parameter
Description
XCP_DRIVER_VERSION
XCP driver version for GET_COMM_MODE_INFO command (default: 0x01)
XCP_ENABLE_PROTOCOL_LAYER_ETH
Enables Ethernet-specific protocol layer commands
XCP_PROTOCOL_LAYER_VERSION
XCP protocol layer version (0x0104 - supports PACKED_MODE, CC_START_STOP_SYNCH)
Address and Address Extension Configuration
Parameter
Description
XCP_ENABLE_DAQ_ADDREXT
Enables individual address extensions for each ODT entry
XCP_ENABLE_REL_ADDRESSING
Enables event-based relative addressing modes without asynchronous access
XCP_ADDR_EXT_REL
Address extension code for relative address format (default: 0x03)
XCP_ENABLE_DYN_ADDRESSING
Enables event-based addressing modes with asynchronous access
XCP_ADDR_EXT_DYN
Address extension for dynamic addressing (default: 0x02)
XCP_ADDR_EXT_DYN_COUNT
Max number of DYN address extensions for dynamic addressing (default: 14)
XCP multicast cluster ID for time synchronization (default: 1)
Debug Configuration
Parameter
Description
XCP_ENABLE_TEST_CHECKS
Enables extended error checks with performance penalty
XCP_ENABLE_OVERRUN_INDICATION_PID
Enables overrun indication via PID (not needed for Ethernet)
4 · Transmit Queue Configuration
The 64-bit transmit queue has several parameters to further optimize DAQ measurement performance and data capture side effects.
Queue Implementation Selection
The queue implementation can be configured using one of three mutually exclusive defines that control the synchronization mechanism between producers and consumers:
Parameter
Description
QUEUE_MUTEX
Uses mutex-based producer locking. This is convenient and might be optimal for high throughput when worst-case producer latency is acceptable. No consumer lock, uses memory fences between producer and consumer
QUEUE_SEQ_LOCK
Uses sequence lock to protect against inconsistency during entry acquire. The queue is lock-free with minimal CAS spin wait in contention. The consumer may spin heavily to acquire a safe consistent head
QUEUE_NO_LOCK
No synchronization between producer and consumer. Producer uses CAS loop to increment head, consumer clears memory completely for consistent reservation state. Tradeoff between consumer spin activity and consumer cache activity - might be optimal for medium throughput
Default: QUEUE_NO_LOCK is enabled by default as it provides the best balance for medium throughput scenarios.
Queue Optimization Parameters
Parameter
Description
QUEUE_ACCUMULATE_PACKETS
Enables accumulation of multiple XCP packets into XCP messages within a segment obtained with QueuePeek(). This improves efficiency by reducing the number of network operations
QUEUE_PEEK_THRESHOLD
Minimum number of bytes that must be in the queue before QueuePeek() returns a segment. Set to XCPTL_MAX_SEGMENT_SIZE by default to optimize transmission efficiency
CACHE_LINE_SIZE
Cache line size used to align queue entries and queue header. Set to 128 bytes to accommodate most modern CPU architectures
MAX_ENTRY_SIZE
Maximum size of a single queue entry, calculated as XCPTL_MAX_DTO_SIZE + XCPTL_TRANSPORT_LAYER_HEADER_SIZE. Must be aligned to XCPTL_PACKET_ALIGNMENT
Queue Runtime Configuration
The queue size is configured at runtime when calling QueueInit(buffer_size). The buffer size determines:
Total memory allocated for the queue
Number of queue entries that can be stored
Maximum throughput capacity
Memory Calculation: Each queue entry requires MAX_ENTRY_SIZE bytes plus alignment overhead. The effective queue size is buffer_size - MAX_ENTRY_SIZE.