Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
b854348
Made definition of _GNU_SOURCE in CMakeLists.txt public
RainerZ Jul 8, 2026
18dcf67
Fixed 'static const' warnings
RainerZ Jul 8, 2026
a6fa6df
Corrected wrong ticks usage in md files
RainerZ Jul 8, 2026
86b55e5
Added a enum metadata declaration to no_a2l_demo
RainerZ Jul 8, 2026
61c0761
Added enum support to xcpclient tool ELF->A2L generator
RainerZ Jul 9, 2026
4103e28
Windows build break fixed
RainerZ Jul 12, 2026
80adea1
Windows bugfix
RainerZ Jul 12, 2026
832a771
Added no_a2l_demo_cpp
RainerZ Jul 17, 2026
46ef24a
cpp_demo shutdown issue fixed
RainerZ Jul 17, 2026
0ab953b
Conditionally removed the A2L generator declarations from the public …
RainerZ Jul 17, 2026
4836deb
Removed the namespace alias xcplib
RainerZ Jul 17, 2026
cb67eb0
Updated the A2L generator Linux remote test scripts for no_a2l_demo a…
RainerZ Jul 17, 2026
694a0c4
Documentation updated
RainerZ Jul 18, 2026
d3e9c12
Demonstrate using class instances with parameters in no_a2l_demo_cpp
RainerZ Jul 19, 2026
d80431a
README.md updated
RainerZ Jul 19, 2026
261a311
Fixed calibration segment name length
RainerZ Jul 20, 2026
d100a78
CANape project for no_a2l_demo_cpp
RainerZ Jul 20, 2026
5493eb3
Fixed C++ meta data problem
RainerZ Jul 21, 2026
7c6b423
Updated gimli and object
RainerZ Jul 21, 2026
9c81079
XcpSetA2lName and XcpGetA2lName is independant from enaling the A2L g…
RainerZ Jul 22, 2026
8335216
Added command line option skip_vars_without_metadata
RainerZ Jul 22, 2026
9e165d3
README.md updated
RainerZ Jul 22, 2026
0afab89
Explicit read_write qualifier
RainerZ Jul 23, 2026
bbf253f
xcpclient option --skip_vars_without_metadata
RainerZ Jul 23, 2026
f591dd4
Added config file support
RainerZ Jul 25, 2026
ec7df9f
Implemented option XCP_ENABLE_DAQ_EVENT_INFO for section registered e…
RainerZ Jul 25, 2026
cb28196
Warning fixed
RainerZ Jul 28, 2026
e2ee381
Bugfix
RainerZ Jul 28, 2026
eec8aae
Bugfix
RainerZ Jul 28, 2026
be5f217
Bugfix
RainerZ Jul 28, 2026
38cf70d
Add CLAUDE.md with build system and architecture guidance
RainerZ Aug 4, 2026
8d6cfbe
Test
RainerZ Jul 28, 2026
971d8c4
Documentation improvements in the public library header files
RainerZ Aug 4, 2026
8d22428
CHANGELOG updated
RainerZ Jul 30, 2026
5c83865
Documentation improvements in the public library header files
RainerZ Aug 4, 2026
82a1b8d
Minor changes
RainerZ Aug 5, 2026
b841483
V2.1.10
RainerZ Aug 5, 2026
6da290d
Fixed free_rtos_esp32_demo linker map section based event detection w…
RainerZ Aug 17, 2026
6d9f84b
Added support for a analog converter with calibration parameters (2-p…
RainerZ Aug 17, 2026
294c525
Added a display line for the analog reading
RainerZ Aug 17, 2026
ebdedee
Fix ESP32 image containing multiple DROM segments
RainerZ Aug 18, 2026
d233d6e
Only include shm.h and persistence.h where their contents are enabled
RainerZ Aug 18, 2026
1d9ce69
xcpclient: check the A2L EPK against the EPK reported by the target
RainerZ Aug 18, 2026
2275075
xcpclient tool dependency to mc_registry switched to public RainerZ/x…
RainerZ Aug 18, 2026
4b12f22
Versions and CHANGELOG updated
RainerZ Aug 20, 2026
1913c14
EPK mismatch will be prompted on terminal and give a hard error if not
RainerZ Aug 19, 2026
828c18c
Versions and CHANGELOG updated
RainerZ Aug 24, 2026
537d184
Improved xcpclient error message when AML is not found
RainerZ Aug 19, 2026
857ef34
fix: link type_detection_test against xcplite for XCPLITE_CONFIGURATI…
RainerZ Aug 24, 2026
63ff061
xcpclient: handle C++ class types and fix empty typedefs for template…
RainerZ Sep 2, 2026
aaddf3b
Fixed metadata macros XCP_LIMITS (missing ;) and XCP_READ_WRITE ([])
RainerZ Aug 31, 2026
5b406c7
xcpclient: merge the DWARF type reader from a2ltool 3.4.1
RainerZ Sep 2, 2026
602f643
Merge remote-tracking branch 'origin/V2.1.10' into V2.1.10
RainerZ Sep 2, 2026
2eab752
CHANGELOG.md updated
RainerZ Sep 2, 2026
7b74137
xcpclient: update xcp_registry to e9da7e9 (unique field typedef names)
RainerZ Sep 2, 2026
69e65b3
xcpclient: document supported types and limitations, fix pointer memb…
RainerZ Sep 2, 2026
9a75a3a
xcpclient: no panic on events without descriptor section or duplicate…
RainerZ Sep 2, 2026
2ae3719
CHANGELOG.md updated
RainerZ Sep 2, 2026
9e762ee
build.sh uses ´cargo install --path . --locked´ to avoid surprises wi…
RainerZ Sep 2, 2026
ef84fed
Split platform.c into platform.c and socket.c
RainerZ Aug 24, 2026
3759210
Documentation updated
RainerZ Aug 24, 2026
f585d20
feat: split platform into platform+sockets, add OPTION_ENABLE_UDP_RAW…
RainerZ Aug 24, 2026
d4b7026
OPTION_ENABLE_UDP_RAW
RainerZ Aug 26, 2026
6ced2c7
Prevent IPv4 fragmentation, report oversized segments at runtime
RainerZ Aug 26, 2026
29c7ddc
Fixed some stale comments about raw max frame size and socket_raw_tes…
RainerZ Aug 27, 2026
1ec5bb4
Add optional zero copy transmit, harden queue payload alignment
RainerZ Aug 27, 2026
92824f5
Test script for udp_raw_demo
RainerZ Aug 27, 2026
244bceb
Add an out-of-tree extension point for the raw Ethernet HAL
RainerZ Aug 28, 2026
4dbb619
Correct the sRxBuf alignment comment in socket_raw.c
RainerZ Aug 28, 2026
d25fa7e
Added cmp_demo, CMP as UDP RAW HAL, CMP not implemented yet
RainerZ Aug 28, 2026
e9824b4
Implemented CMP over UDP in cmp_demo
RainerZ Aug 28, 2026
3046a9d
cmp_demo test.sh
RainerZ Aug 28, 2026
bd0ed01
Reduce OPTION_MTU to 1424 to leave headroom for encapsulating HAL bac…
RainerZ Aug 28, 2026
121d5ca
Minor changes
RainerZ Aug 30, 2026
8a1ffbc
Document XCP discovery: what XCPlite has today and the options
RainerZ Aug 30, 2026
da24404
Implement CMP_CM_DISCOVERY in cmp_demo
RainerZ Aug 30, 2026
03465d0
Use the platform.h thread abstraction in cmp_demo, document what stay…
RainerZ Aug 31, 2026
ceca122
Changed local_test.SH pcap location to invocation folder
RainerZ Aug 31, 2026
faa3bd6
xcpclient: mc_registry dependency swithed to VectorGrp master
RainerZ Sep 3, 2026
c2695e6
xcpclient: added a measurement ticker
RainerZ Sep 3, 2026
d783836
xcpclient A2L generation improvements:
RainerZ Sep 4, 2026
164d2ba
xcpclient: unique typedef names for same-named C++ types in different…
RainerZ Sep 4, 2026
272701b
xcpclient: type name qualification moved into the DWARF reader, more …
RainerZ Sep 5, 2026
a9de161
docs/OFFLINE_A2L.md describes offline A2L generation in detail
RainerZ Sep 5, 2026
4dc2d73
Merge remote-tracking branch 'origin/V2.2.0' into V2.1.12
RainerZ Sep 6, 2026
bbacffb
xcpclient: mc_registry dependency swithed to VectorGrp master
RainerZ Sep 3, 2026
330ddd8
xcpclient: added a measurement ticker
RainerZ Sep 3, 2026
d0c0004
xcpclient A2L generation improvements:
RainerZ Sep 4, 2026
fb81dc4
xcpclient: unique typedef names for same-named C++ types in different…
RainerZ Sep 4, 2026
d228078
xcpclient: type name qualification moved into the DWARF reader, more …
RainerZ Sep 5, 2026
14343e4
docs/OFFLINE_A2L.md describes offline A2L generation in detail
RainerZ Sep 5, 2026
4a1c931
V2.1.13
RainerZ Sep 6, 2026
8e20716
V2.1.14
RainerZ Sep 6, 2026
a7b27b0
Merge remote-tracking branch 'origin/V2.1.14' into V2.2.1
RainerZ Sep 6, 2026
d6f14b3
Fixed Windows build
RainerZ Sep 6, 2026
4f63399
Restore changes lost in the merges
RainerZ Sep 7, 2026
da991fd
xcpclient: call frame information of 32 bit targets parsed with the a…
RainerZ Sep 7, 2026
5f1fc0a
freertos_esp32_demo: build with sockets.c after the platform split, s…
RainerZ Sep 7, 2026
0c0564e
xcpclient: --default-event for the measurement of variables without a…
RainerZ Sep 7, 2026
545f411
xcpclient: --default-event assigns the event to global and static var…
RainerZ Sep 7, 2026
fd1251c
Using xcpclient option --default-event in freertos_emu_demo and freer…
RainerZ Sep 8, 2026
ca2df25
xcpclient: Improved handling of inlined functions with an event trigger
RainerZ Sep 8, 2026
14abdaa
xcpclient: DWARF 5 location lists, XCP_NOINLINE for functions with an…
RainerZ Sep 8, 2026
008256a
xcpclient: --default-event accepts an event name as an alternative to…
RainerZ Sep 8, 2026
cade926
xcpclient: Fix metadata markers of local static variables in C++ func…
RainerZ Sep 8, 2026
66f129d
xcpclient: Resolve DWARF 5 indexed address and string forms in the CF…
RainerZ Sep 8, 2026
cb1bfe3
xcpclient: Code comments for the elf_reader module
RainerZ Sep 8, 2026
abbc9fe
xcpclient: version 4.0.0: frame address convention of the trigger mac…
RainerZ Sep 9, 2026
84e2235
xcpclient: Fixed matching of metadata markers for local variables
RainerZ Sep 9, 2026
0ff0f39
xcpclient: Target signature from the symbol table, compiler logged
RainerZ Sep 9, 2026
cfc19a6
Capture of local variables for measurement, DaqTriggerEventCapture
RainerZ Sep 9, 2026
240c64d
Capture of local variables in C++, capture of struct variables in C f…
RainerZ Sep 9, 2026
9b5655e
xcpclient: split the elf_reader test module into its own file
RainerZ Sep 9, 2026
fc6780d
- The pointer to a captured variable is built by the overloaded helpe…
RainerZ Sep 9, 2026
e35ad85
xcpclient: Replaced the over engineered pointer solution in the captu…
RainerZ Sep 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ RecycleBin.ini
test_bintool
*.bak
*.log
*.pcap

# Other
.vscode
Expand All @@ -36,3 +37,4 @@ test_bintool
/docs/SUBMODULE_GUIDE.md
/shm_*.sh
wlan.h
/TODO_old.md
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,9 @@
"cmake.configureOnOpen": false,
"rust-analyzer.linkedProjects": [
"${workspaceFolder}/tools/xcpclient/Cargo.toml"
]
],
"[rust]": {
"editor.defaultFormatter": "rust-lang.rust-analyzer",
"editor.formatOnSave": true
}
}
98 changes: 91 additions & 7 deletions CHANGELOG.md

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ src/queue*.c Lock-free/mutex transmit queue implementations (
src/cal.c/.h Calibration segment RCU implementation (page switching, locks)
src/a2l.c, src/a2l_writer.c Runtime A2L file generation
src/persistence.c/.h Binary (.bin) parameter/event persistence across restarts
src/platform.c/.h OS abstraction (threads, sockets, clock, atomics) — Linux/macOS/QNX/Windows/FreeRTOS
src/platform.c/.h OS abstraction (threads, clock, mutex, atomics) — Linux/macOS/QNX/Windows/FreeRTOS
src/sockets.c/.h Socket abstraction over the OS socket API (all standard platforms)
src/socket_raw.c Raw-Ethernet UDP/IPv4 transport (OPTION_ENABLE_UDP_RAW), see docs/SOCKET_RAW.md
src/socket_raw_hal.h Raw Ethernet HAL interface; socket_raw_hal_linux.c is the AF_PACKET backend
src/util.c/.h Shared helpers
```

Expand Down Expand Up @@ -119,7 +122,9 @@ XCPlite encodes *where* a measured/calibrated variable lives (global, stack, hea
- `xcp_evts` section — `tXcpEventDescriptor` constants emitted by `DaqCreateEvent`/`DaqCreateAndTriggerEvent`
- `xcp_cals` section — `tXcpCalSegDescriptor` constants emitted by `CalSegDecl`+`CalSegCreate`

and DWARF scope anchors named `trg__<mode-letters>__<event-name>` (e.g. `trg__AAS__foo`, letter position = address-extension value [0..]: `A`=absolute, `C`=cal-segment-relative, `S`=stack-relative, `D`=dynamic/heap) emitted by the trigger macros, to reconstruct addressing without any runtime A2L calls. Full details, including what changes if you modify the trigger macros, are in `docs/TECHNICAL.md`.
and DWARF scope anchors named `trg__<mode-letters>__<event-name>` (e.g. `trg__AAS__foo`, letter position = address-extension value [0..]: `A`=absolute, `C`=cal-segment-relative, `S`=stack-relative, `D`=dynamic/heap) emitted by the trigger macros, to reconstruct addressing without any runtime A2L calls. The marker contract (sections, marker names, trigger anchor naming) is in `docs/TECHNICAL.md`, the tool side (workflow, naming rules, symbol resolution, supported types) in `docs/OFFLINE_A2L.md`.

The generator reads ELF files only. Executables built on macOS are Mach-O and carry no DWARF (the linker leaves it in the `.o` files / `.dSYM`), so `xcpclient` rejects them with an explicit "macOS is not supported" error and exit status 1 — A2L files for `no_a2l`/`rtos` builds must be generated from a Linux build, which is what the examples' `create_a2l.sh` scripts do via a remote build on a Linux target.

### Shared-memory (SHM) multi-application mode (`docs/SHM.md`)

Expand Down
54 changes: 48 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

cmake_minimum_required(VERSION 3.14)

project(xcplite VERSION 2.1.2 LANGUAGES C CXX)
project(xcplite VERSION 2.2.1 LANGUAGES C CXX)



Expand All @@ -16,22 +16,24 @@ project(xcplite VERSION 2.1.2 LANGUAGES C CXX)
# cmake -B build-ptp -S . -DXCPLITE_CONFIGURATION=ptp
# cmake -B build-shm -S . -DXCPLITE_CONFIGURATION=shm
# cmake -B build-rtos -S . -DXCPLITE_CONFIGURATION=rtos
# cmake -B build-raw -S . -DXCPLITE_CONFIGURATION=raw
#
# Configuration descriptions (see src/xcplib_<name>_cfg.h for details):
# default - 64-bit, on-target A2L generation, filesystem, Ethernet UDP/TCP
# no_a2l - Like default without on-target A2L; A2L generated from ELF by xcpclient
# ptp - Like default with socket hardware timestamps (ptptool, Linux only)
# shm - Shared-memory multi-application mode (shmtool, xcpdaemon)
# rtos - Embedded RTOS targets (FreeRTOS), reduced footprint, no filesystem
# raw - Raw Ethernet transport, UDP/IPv4 inside xcplib, no TCP/IP stack (Linux only)
# =============================================================================
set(XCPLITE_CONFIGURATION "default" CACHE STRING
"Library build configuration: default | no_a2l | ptp | shm | rtos")
set_property(CACHE XCPLITE_CONFIGURATION PROPERTY STRINGS default no_a2l ptp shm rtos)
"Library build configuration: default | no_a2l | ptp | shm | rtos | raw")
set_property(CACHE XCPLITE_CONFIGURATION PROPERTY STRINGS default no_a2l ptp shm rtos raw)

if(NOT XCPLITE_CONFIGURATION MATCHES "^(default|no_a2l|ptp|shm|rtos)$")
if(NOT XCPLITE_CONFIGURATION MATCHES "^(default|no_a2l|ptp|shm|rtos|raw)$")
message(FATAL_ERROR
"Invalid XCPLITE_CONFIGURATION='${XCPLITE_CONFIGURATION}'. "
"Must be one of: default, no_a2l, ptp, shm, rtos")
"Must be one of: default, no_a2l, ptp, shm, rtos, raw")
endif()

# Resolve configuration override header (empty = use default xcplib_cfg.h)
Expand All @@ -43,6 +45,8 @@ elseif(XCPLITE_CONFIGURATION STREQUAL "shm")
set(_xcplib_cfg_override "xcplib_shm_cfg.h")
elseif(XCPLITE_CONFIGURATION STREQUAL "rtos")
set(_xcplib_cfg_override "xcplib_rtos_cfg.h")
elseif(XCPLITE_CONFIGURATION STREQUAL "raw")
set(_xcplib_cfg_override "xcplib_raw_cfg.h")
else()
set(_xcplib_cfg_override "")
endif()
Expand Down Expand Up @@ -176,7 +180,7 @@ elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
endif()

# xcplite sources
set(xcplite_SOURCES src/xcpappl.c src/xcplite.c src/xcpethserver.c src/xcpethtl.c src/queue32m.c src/queue32.c src/queue64v.c src/queue64f.c src/shm.c src/cal.c src/a2l.c src/a2l_writer.c src/persistence.c src/platform.c src/util.c )
set(xcplite_SOURCES src/xcpappl.c src/xcplite.c src/xcpethserver.c src/xcpethtl.c src/queue32m.c src/queue32.c src/queue64v.c src/queue64f.c src/shm.c src/cal.c src/a2l.c src/a2l_writer.c src/persistence.c src/platform.c src/sockets.c src/socket_raw.c src/socket_raw_hal_linux.c src/util.c )

# Create xcplite library
add_library(xcplite ${xcplite_SOURCES})
Expand Down Expand Up @@ -314,6 +318,19 @@ if(XCPLITE_BUILD_EXAMPLES)
# Build it separately: cd examples/silkit_demo && cmake -B build -DSilKit_DIR=... -Dxcplite_DIR=...
message(STATUS "silkit_demo: not built from root (standalone project, see examples/silkit_demo/)")

elseif(XCPLITE_CONFIGURATION STREQUAL "raw")

# udp_raw_demo: XCP over the raw Ethernet transport (UDP/IPv4 inside xcplib).
# Linux only - the HAL backend uses AF_PACKET and needs CAP_NET_RAW.
# See docs/SOCKET_RAW.md for the network setup used to test it.
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
add_executable(udp_raw_demo examples/udp_raw_demo/src/main.c)
target_link_libraries(udp_raw_demo PRIVATE xcplite)
message(STATUS "udp_raw_demo: building for raw configuration (Linux)")
else()
message(STATUS "udp_raw_demo: skipped (Linux only, raw Ethernet HAL uses AF_PACKET)")
endif()

elseif(XCPLITE_CONFIGURATION STREQUAL "rtos")

# freertos_demo: FreeRTOS POSIX simulator for testing FreeRTOS xcplite support on the host.
Expand Down Expand Up @@ -373,6 +390,27 @@ if(XCPLITE_BUILD_TESTS)
target_link_libraries(clock_test PRIVATE xcplite)
message(STATUS "clock_test: building for ptp configuration")

elseif(XCPLITE_CONFIGURATION STREQUAL "raw")

# Unit tests for the raw Ethernet transport: checksums, wire layout, frame build,
# receive filter, ARP and ICMP responders. No network and no HAL involved -
# src/socket_raw.c is compiled into the test with a fake Ethernet HAL (src/stubs.c),
# so this does not link against xcplite and needs no privileges.
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
add_executable(socket_raw_test test/socket_raw_test/src/main.c test/socket_raw_test/src/stubs.c)
target_include_directories(socket_raw_test PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src" "${CMAKE_CURRENT_SOURCE_DIR}/inc")
# This target deliberately does not link xcplite (it supplies its own fake
# Ethernet HAL), so it does not inherit the PUBLIC _GNU_SOURCE from that target
target_compile_definitions(socket_raw_test PRIVATE
"XCPLITE_CONFIGURATION=\"raw\""
"XCPLIB_CFG_OVERRIDE=\"xcplib_raw_cfg.h\""
$<$<PLATFORM_ID:Linux>:_GNU_SOURCE>
)
message(STATUS "socket_raw_test: building for raw configuration")
else()
message(STATUS "socket_raw_test: skipped (Linux only, raw Ethernet HAL uses AF_PACKET)")
endif()

else()
message(STATUS "XCPLITE_BUILD_TESTS=ON: no test targets defined for configuration '${XCPLITE_CONFIGURATION}'")
endif()
Expand Down Expand Up @@ -483,6 +521,10 @@ install(DIRECTORY inc/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PA
# Install xcplib_cfg.h (default configuration) and platform.h
install(FILES src/xcplib_cfg.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(FILES src/platform.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
install(FILES src/sockets.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
# Raw Ethernet HAL interface, needed by applications which provide their own backend
# (OPTION_UDP_RAW_HAL_EXTERNAL), e.g. an ASAM CMP implementation
install(FILES src/socket_raw_hal.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

# Install the active configuration override header (if not default)
# This documents which configuration was compiled into the installed library.
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ For save operation, the client tool must respect fixed event definitions and han

If a tool understands ABI details of complex data instances, it may still perform the usual address calculations to access individual fields of composite types, array elements, or merge memory ranges to optimize upload, download, and data acquisition.

General-purpose A2L editors/creators typically cannot reconstruct XCPlite-specific relative address encoding automatically. In this case, you are limited to use only global memory objects. For full featured offline A2L generation, you may use the XCPlite-aware xcpclient tool workflow described in the [technical documentation](docs/TECHNICAL.md).
General-purpose A2L editors/creators typically cannot reconstruct XCPlite-specific relative address encoding automatically. In this case, you are limited to use only global memory objects. For full featured offline A2L generation, use the XCPlite-aware xcpclient tool, see [Offline A2L Generation](docs/OFFLINE_A2L.md).

Support for A2L TYPEDEF and shared axis references with `this.` is beneficial, but not strictly required.

Expand Down Expand Up @@ -105,7 +105,8 @@ Details how to build for Linux, QNX, macOS, and Windows are in the [building doc
- **[API Reference](docs/xcplib.md)** - XCP instrumentation API
- **[Configuration](docs/xcplib_cfg.md)** - Configuration options
- **[Examples](examples/README.md)** - Example applications and CANape setup
- **[Technical Details](docs/TECHNICAL.md)** - Addressing modes, A2L generation, instrumentation costs
- **[Technical Details](docs/TECHNICAL.md)** - Addressing modes, on-target A2L generation, instrumentation costs and markers
- **[Offline A2L Generation](docs/OFFLINE_A2L.md)** - A2L generation from the ELF file with xcpclient
- **[Building](docs/BUILDING.md)** - Detailed build instructions
- **[XCP Introduction](docs/XCP_INTRODUCTION.md)** - What is XCP?

Expand Down
19 changes: 15 additions & 4 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ show_usage() {
echo " ptp build-ptp/ Hardware socket timestamps for PTP (Linux, PTP-capable NIC)"
echo " shm build-shm/ Shared-memory multi-application mode"
echo " rtos build-rtos/ FreeRTOS POSIX simulator (Linux/macOS only)"
echo " raw build-raw/ Raw Ethernet transport, UDP/IPv4 inside xcplib (Linux only)"
echo ""
echo "Target (default: examples) — what to build within the configuration:"
echo " lib Library only"
Expand Down Expand Up @@ -64,6 +65,7 @@ show_usage() {
echo " $0 shm tools # shm config: shmtool + xcpdaemon"
echo " $0 ptp tools # ptp config: ptptool (Linux only)"
echo " $0 no_a2l examples # no_a2l config: no_a2l_demo, no_a2l_demo_cpp"
echo " $0 raw examples # raw config: udp_raw_demo (Linux only)"
echo " $0 rtos examples # rtos config: freertos_demo (Linux/macOS only)"
echo " $0 lib install # Library only, install to build/install"
echo " $0 release lib install=/usr/local # Release build, install to /usr/local"
Expand Down Expand Up @@ -98,7 +100,7 @@ for arg in "$@"; do
relwithdebinfo) BUILD_TYPE="RelWithDebInfo" ;;

# Configuration
default|no_a2l|ptp|shm|rtos) CONFIGURATION="$arg_lower" ;;
default|no_a2l|ptp|shm|rtos|raw) CONFIGURATION="$arg_lower" ;;

# Target (multiple targets may be combined, e.g. "tools examples")
lib) _ANY_TARGET=true ;; # library only: all extras remain false
Expand All @@ -113,7 +115,7 @@ for arg in "$@"; do
clean) CLEAN_BUILD=true ;;
cleanall)
echo "Cleaning all build directories..."
rm -rf build build-no_a2l build-ptp build-shm build-rtos
rm -rf build build-no_a2l build-ptp build-shm build-rtos build-raw
# Also clean legacy directory names from older builds
rm -rf build_no_a2l_demo build_freertos build_ptptool build_shm
rm -f ./*.bin ./*.hex ./*.log ./*.mf4 ./*.a2l
Expand Down Expand Up @@ -262,10 +264,12 @@ if [[ "$RUN_CLANG_TIDY" == true && "$BUILD_SUCCESS" == true ]]; then
if [[ ! -f "$BUILD_DIR/compile_commands.json" ]]; then
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -S . -B "$BUILD_DIR"
fi
# Keep in sync with xcplite_SOURCES in CMakeLists.txt
XCPLITE_SOURCES=(
src/xcpappl.c src/xcplite.c src/xcpethserver.c src/xcpethtl.c
src/queue32.c src/queue64v.c src/queue64f.c src/shm.c
src/cal.c src/a2l.c src/a2l_writer.c src/persistence.c src/platform.c src/util.c
src/queue32.c src/queue32m.c src/queue64v.c src/queue64f.c src/shm.c
src/cal.c src/a2l.c src/a2l_writer.c src/persistence.c src/platform.c
src/sockets.c src/socket_raw.c src/socket_raw_hal_linux.c src/util.c
)
for src in "${XCPLITE_SOURCES[@]}"; do
[[ -f "$SCRIPT_DIR/$src" ]] || { echo "Warning: not found: $src"; continue; }
Expand Down Expand Up @@ -324,6 +328,13 @@ case "$CONFIGURATION" in
echo " Tests : (none for rtos configuration)"
echo " Tools : (none for rtos configuration)"
;;
raw)
[[ "$CMAKE_BUILD_EXAMPLES" == "ON" ]] && echo " Examples : udp_raw_demo (Linux only, needs CAP_NET_RAW)" \
|| echo " Examples : (not built)"
[[ "$CMAKE_BUILD_TESTS" == "ON" ]] && echo " Tests : socket_raw_test" \
|| echo " Tests : (not built)"
echo " Tools : (none for raw configuration)"
;;
esac

[[ "$CMAKE_BUILD_RUST" == "ON" ]] && echo " Rust tools : xcpclient, bintool" \
Expand Down
12 changes: 11 additions & 1 deletion docs/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ The library has **mutually exclusive build configurations** selected via `XCPLIT
| `ptp` | `build-ptp/` | `xcplib_ptp_cfg.h` | Like default with socket hardware timestamps; requires Linux and a PTP-capable NIC |
| `shm` | `build-shm/` | `xcplib_shm_cfg.h` | Shared-memory multi-application mode (shmtool, xcpdaemon) |
| `rtos` | `build-rtos/` | `xcplib_rtos_cfg.h` | FreeRTOS embedded targets: reduced footprint, no filesystem, 32-bit |
| `raw` | `build-raw/` | `xcplib_raw_cfg.h` | Raw Ethernet transport: UDP/IPv4 inside xcplib, no TCP/IP stack (Linux only) |

Each `src/xcplib_<name>_cfg.h` header documents the exact overrides applied on top of the defaults in `src/xcplib_cfg.h`.

Expand All @@ -45,6 +46,7 @@ Within a chosen configuration, the following options control what gets built:
| `ptp` | ptp4l_demo¹ | clock_test | ptptool¹ |
| `shm` | hello_xcp (SHM), hello_xcp_cpp (SHM) | *(none)* | shmtool, xcpdaemon³ |
| `rtos` | freertos_emu_demo³ (downloads FreeRTOS-Kernel) | *(none)* | *(none)* |
| `raw` | udp_raw_demo (Linux only) | socket_raw_test | *(none)* |

¹ Linux only ² requires libbpf ³ not supported on Windows

Expand All @@ -71,7 +73,7 @@ These examples have their own `CMakeLists.txt` and use `find_package(xcplite)` a
| Argument group | Values | Default |
|----------------|--------|---------|
| Build type | `debug` \| `release` \| `relwithdebinfo` | `debug` |
| Configuration | `default` \| `no_a2l` \| `ptp` \| `shm` \| `rtos` | `default` |
| Configuration | `default` \| `no_a2l` \| `ptp` \| `shm` \| `rtos` \| `raw` | `default` |
| Target | `lib` \| `examples` \| `tests` \| `tools` \| `rust_tools` \| `all` | `examples` |
| Options | `clean` `cleanall` `install` `install=<path>` `cargo_install` `tidy` | — |

Expand Down Expand Up @@ -111,6 +113,9 @@ Examples:
# rtos config: freertos_demo (Linux/macOS only)
./build.sh rtos examples

# raw config: udp_raw_demo, raw Ethernet transport (Linux only, needs CAP_NET_RAW)
./build.sh raw examples

# Library only, install to build/install
./build.sh lib install

Expand Down Expand Up @@ -173,6 +178,10 @@ cmake --build build-shm --parallel
cmake -B build-rtos -S . -DXCPLITE_CONFIGURATION=rtos -DXCPLITE_BUILD_EXAMPLES=ON
cmake --build build-rtos --parallel

# raw configuration — udp_raw_demo, raw Ethernet transport (Linux only)
cmake -B build-raw -S . -DXCPLITE_CONFIGURATION=raw -DXCPLITE_BUILD_EXAMPLES=ON
cmake --build build-raw --parallel

# Build a specific target
cmake --build build --target hello_xcp

Expand Down Expand Up @@ -341,5 +350,6 @@ To test all configurations:
./build.sh ptp tools # ptp config, tools (Linux only)
./build.sh no_a2l examples # no_a2l config
./build.sh rtos examples # rtos config (Linux/macOS only)
./build.sh raw examples # raw config (Linux only, see docs/SOCKET_RAW.md)
```

Loading