Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
310c046
Bugfix in struct_demo, needs XCP_ADDR_EXT_DYN_MAX = 4
RainerZ Sep 28, 2025
a2ba9ea
Absolute calibration segment addressing mode
RainerZ Sep 28, 2025
d140c88
Changed signature of xcplib::CreateCalSeg
RainerZ Oct 1, 2025
654d61f
cpp demos tested and updated in absolute segment addressing mode
RainerZ Oct 1, 2025
eafb602
Option to enable/disable include xcp aml file
RainerZ Oct 1, 2025
d7ed339
OPTION_ASYNC_EVENT
RainerZ Oct 2, 2025
1ec3146
XCP_ENABLE_DAQ_PRESCALER option
RainerZ Oct 2, 2025
a125163
Bugfix DAQ_OVERLOAD_INDICATION_PID
RainerZ Oct 2, 2025
8d147d7
README.md updated
RainerZ Oct 2, 2025
4008e56
no_a2l_demo
RainerZ Oct 2, 2025
29c884a
no_a2l_demo
RainerZ Oct 2, 2025
431cdd2
Bugfix async event creation
RainerZ Oct 3, 2025
3e5ae63
Set A2L name anyway
RainerZ Oct 3, 2025
ced8a5a
Automated A2L generation process for remote targets
RainerZ Oct 3, 2025
e8e8407
Global and static variable naming conventions
RainerZ Oct 3, 2025
1e7a3f7
Experimental xcp-lite/xcp_client based A2L creator for no_a2l_demo
RainerZ Oct 4, 2025
7a0471e
Experimental xcp-lite/xcp_client based A2L creator for no_a2l_demo
RainerZ Oct 4, 2025
fa3fd36
CANape project for no_a2l_demo
RainerZ Oct 4, 2025
284a2eb
CANape project for no_a2l_demo
RainerZ Oct 4, 2025
f4c3ff6
CANape project updated
RainerZ Oct 5, 2025
b7cf13d
CANape project updated
RainerZ Oct 5, 2025
22c5eea
Added thread local test variables
RainerZ Oct 6, 2025
4b4f835
Renamed event trigger marker in all macros
RainerZ Oct 6, 2025
369d8bd
Script updated for latest xcp_client and a2ltool
RainerZ Oct 7, 2025
da7596e
xcp_client A2L creator for local variables
RainerZ Oct 7, 2025
6930c34
Use CFA instead of frame pointer
RainerZ Oct 8, 2025
c541393
AI generated tool to read CFA for functions in elf/dwarf files
RainerZ Oct 8, 2025
9c8c797
xcp_client CSA hack, no_a2l_demo a2l_creator for local variables work
RainerZ Oct 8, 2025
d907e93
gcc warnings fixed
RainerZ Oct 9, 2025
b9bc098
Unified const style to west
RainerZ Oct 9, 2025
2b791c9
CFA parser integrated
RainerZ Oct 9, 2025
e0c87bb
no_a2l_demo for -O1, variables marker as volatile
RainerZ Oct 9, 2025
4f03ce9
Macro for measurement variable attribute
RainerZ Oct 10, 2025
cce39c9
Addressing mode configuration and A2L project_no indicator
RainerZ Oct 11, 2025
8cbeb58
Experimental A2L creator script ECU_ONLINE/XCP_ONLINE mode
RainerZ Oct 11, 2025
408f737
Version changed to V0.9.3
RainerZ Oct 11, 2025
4423dc4
README.MD updated
RainerZ Oct 11, 2025
4777699
Demo
RainerZ Oct 14, 2025
54e4ab8
Optimization of ApplXcpGetBaseAddr()
RainerZ Oct 17, 2025
84c7ac5
More comprehensive XcpSetMta function with early returns
RainerZ Oct 19, 2025
1c717a4
#define XCP_ENABLE_COPY_CAL_PAGE_WORKAROUND (see xcp_cfg.h)
RainerZ Oct 20, 2025
2f1c463
#define XCP_ENABLE_COPY_CAL_PAGE_WORKAROUND (see xcp_cfg.h)
RainerZ Oct 20, 2025
645de99
Removed implicit epk calibration segment
RainerZ Oct 22, 2025
5dc9cb1
Reference or working page persistency
RainerZ Oct 22, 2025
61b8449
OPTION_CAL_REFERENCE_PAGE_PERSISTENCY
RainerZ Oct 22, 2025
ad6b1d4
Cleaner main_cfg.h
RainerZ Oct 23, 2025
628242c
Finally removed XCP_ENABLE_IMPLICIT_EPK_CALSEG_DEPRECATED
RainerZ Oct 23, 2025
b0c928b
Bugfixes
RainerZ Oct 23, 2025
664f9e5
Sync with xcp-lite
RainerZ Oct 23, 2025
0e23770
Sync with xcp-lite
RainerZ Oct 25, 2025
f2e6a7a
Autodetect addressing schema in xcp_client
RainerZ Oct 25, 2025
d6dab4d
New hello_xcp, added read/write variables
RainerZ Oct 26, 2025
1578fbc
no_a2l_demo updated
RainerZ Oct 26, 2025
a5b0962
Bugfixes calibration segment persistence
RainerZ Oct 26, 2025
d04dcfa
bin2hex renamed to bintool
RainerZ Oct 26, 2025
540d6d3
Experiments files removed
RainerZ Oct 27, 2025
24ccdd3
Default options changed to start on reference page and freeze to work…
RainerZ Oct 27, 2025
5d0c587
Bugfix and rename test_bintool.sh
RainerZ Oct 27, 2025
6a4288d
Minor changes
RainerZ Oct 28, 2025
f50abce
BPF demo, monitoring individidual syscalls
RainerZ Oct 28, 2025
fd5252a
Extended BIN format for absolute addressing and to simplify future ex…
RainerZ Oct 29, 2025
4eff3d5
README.md
RainerZ Oct 29, 2025
3a24ba4
README.md
RainerZ Oct 29, 2025
3ba8f57
README updated
RainerZ Oct 30, 2025
7f63807
@@@@ TODO comments cleanup
RainerZ Oct 31, 2025
e399656
cal_test fixed
RainerZ Oct 31, 2025
c5572a4
BIN format changes, max event name, segment name and epk is 128
RainerZ Nov 1, 2025
33ecf69
Bugfix: Improved handling of write_pending state, reduce unnecessary …
RainerZ Nov 2, 2025
a4741f4
Code review calseg RCU, 2 minor changes, more intensive testing
RainerZ Nov 2, 2025
4078fca
Platform defines restructured for QNX support
RainerZ Nov 3, 2025
f0d4822
Bugfix GET_DAQ_EVENT_INFO, XcpGetEventName with index postfix
RainerZ Nov 4, 2025
2193bff
daq_test
RainerZ Nov 5, 2025
5d2b20d
Variadic daq trigger macros
RainerZ Nov 5, 2025
da43703
Auto addressing mode
RainerZ Nov 6, 2025
019d24e
Bugfixes
RainerZ Nov 7, 2025
c8e6521
Simplified registration of typedefs
RainerZ Nov 7, 2025
1aec39b
Demos checked and updated
RainerZ Nov 7, 2025
c808bed
Variadic event trigger functions
RainerZ Nov 8, 2025
e57483c
Unique event trigger function names
RainerZ Nov 8, 2025
4c3067b
xcplib.md examples
RainerZ Nov 9, 2025
9981515
xcplib.md examples
RainerZ Nov 9, 2025
10c01f0
Connect callback with connect mode
RainerZ Nov 10, 2025
7be052d
test.sh
RainerZ Nov 10, 2025
e2f5b59
Delete A2L and BIN connect mode
RainerZ Nov 10, 2025
7786960
test.sh
RainerZ Nov 15, 2025
3bb6cb8
Sync with xcp-lite
RainerZ Nov 16, 2025
d41b510
Single page mode
RainerZ Nov 16, 2025
5c087d7
XCP_ENABLE_CAL_PERSISTENCE
RainerZ Nov 17, 2025
5ff9b5a
Changes for Rust xcp-lite V1.0.0 calibration segment management
RainerZ Nov 17, 2025
db5255b
Changes for Rust xcp-lite V1.0.0 test
RainerZ Nov 17, 2025
bd381af
Compatibility notes V1.0.0 to V0.9.3
RainerZ Nov 17, 2025
6e20cf5
Warning on calibration update timeout, when lock is hold too long
RainerZ Nov 18, 2025
4c2eab3
ApplXcpRegisterCallbacks removed
RainerZ Nov 18, 2025
1306720
Windows compatibility
RainerZ Nov 18, 2025
7afe141
MSVC warnings and build breaks fixed
RainerZ Nov 18, 2025
42f7e2b
MSVC warnings and build breaks fixed
RainerZ Nov 18, 2025
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
26 changes: 21 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,41 @@

/build
/build-*
build
build-*


# CANape artefacts
*.hex
*.mf4
*.cnaxml
*.tmp
CANapeTmpMea.ini

# Examples A2L files
*.a2l

# Examples .a2l and .bin files
/*.a2l
*.bin

# Temporary files
test_bintool
conversions.a2l
groups.a2l
typedefs.a2l
*.bak
*.log
*.txt


# Other
/run_remote.sh
/run.sh
/examples/bpf_demo/CANape/CANapeTmpMea.ini
pi
dwarf
.vscode
.DS_Store
test_bpf_demo_pi.sh
test_bin2hex_pi.sh
CANape.aml
tools/gimli_demo/
tools/dwarf_reader/
tools/bintool/USAGE_EXAMPLES.md
/examples/hello_xcp/CANape/vCDMstudioUiConfiguration.xml
20 changes: 20 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug hello_xcp_cpp",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/hello_xcp_cpp.out",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "lldb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "XCPlite: build hello_xcp_cpp"
},
{
"name": "Debug cpp_demo",
"type": "cppdbg",
Expand Down
27 changes: 25 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,29 @@
"detail": "Build hello_xcp target using CMake",
"dependsOn": "cmake configure"
},
{
"type": "shell",
"label": "XCPlite: build hello_xcp_cpp",
"command": "cmake",
"args": [
"--build",
"build",
"--target",
"hello_xcp_cpp"
],
"options": {
"cwd": "${workspaceFolder}"
},
"group": {
"kind": "build",
"isDefault": false
},
"problemMatcher": [
"$gcc"
],
"detail": "Build hello_xcp_cpp target using CMake",
"dependsOn": "cmake configure"
},
{
"type": "shell",
"label": "XCPlite: build c_demo",
Expand Down Expand Up @@ -314,10 +337,10 @@
"args": [
"-avz",
"--include=\"*.out\"",
"--include=\"*.a\"",
"--include=\"*.a2l\"",
"--exclude=\"*\"",
"[email protected]:~/XCPlite-RainerZ/build/",
"./build/"
"./pi/"
],
"options": {
"cwd": "${workspaceFolder}"
Expand Down
4 changes: 2 additions & 2 deletions CANape.aml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// /begin A2ML
/begin A2ML

block "IF_DATA" taggedunion if_data {

Expand Down Expand Up @@ -166,4 +166,4 @@ block "IF_DATA" taggedunion if_data {

}; // block "IF_DATA"

// /end A2ML
/end A2ML
96 changes: 96 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Changelog

All notable changes to XCPlite are documented in this file.

## [V1.0.0]

### Breaking API Changes


- XcpInit signature changed to
```c
void XcpInit(const char *name, const char *epk, bool activate);
```

- A2lInit signature changed to
```c
bool A2lInit(const uint8_t addr[4], uint16_t port, bool use_tcp, uint32_t mode);
```

- CalSeg constructor signature changed, takes a pointer to the default parameters
```c
CalSeg(const char *name, const T *default_params)
```

- A2lTypedefBegin gets a pointer to any instance of the type.
- A2lTypedefParameterComponent does not need the typename parameter anymore
- A2lTypedefMeasurementComponent does not need the typename parameter anymore and has a comment parameter
```c
{
A2lTypedefBegin(ParametersT, &kParameters, "A2L Typedef for ParametersT");
A2lTypedefParameterComponent(min, "Minimum random number value", "Volt", -100.0, 100.0);
A2lTypedefParameterComponent(max, "Maximum random number value", "Volt", -100.0, 100.0);
A2lTypedefEnd();
}

- DaqCreateEventInstance does not return the event id anymore, new function DaqGetEventInstanceId to get the event id from the name
```c
DaqCreateEventInstance("task");
tXcpEventId task_event_id = DaqGetEventInstanceId("task");
```

- BIN format changes to enable future feature extensions, old BIN files are not compatible anymore


### Added
- Absolute or relative calibration parameter segment addressing (`OPTION_CAL_SEGMENTS_ABS` in `main_cfg.h`)
- More flexible addressing scheme configuration (see `xcp_cfg.h`)
- Generated A2L file uses the `project_no` identifier to indicate the configured addressing schema (currently ACSDD or CASDD)
- Support for more than one base address in relative address mode, variadic function to trigger event with multiple base addresses
- Optional async event with 1ms cycle time and prescaler support (`OPTION_DAQ_ASYNC_EVENT` in `main_cfg.h`)
- Different options to control the behavior of calibration segment persistence and freeze
- Memory optimization for event/daq-list mapping
- XCP_ENABLE_COPY_CAL_PAGE_WORKAROUND to enable workaround for CANape init calibration segments bug
- Variadic macro to create, trigger, and register local and member variables in one call with automatic addressing mode deduction (see hello_xcp_cpp example)
```c
XcpDaqEventExt(avg_calc1, this, //
(input, "Input value for floating average", "V", 0.0, 1000.0), //
(average, "Current calculated average"), //
(current_index_, "Current position in ring buffer"), //
(sample_count_, "Number of samples collected"), //
(sum_, "Running sum of all samples")

);
```

### Changed
- Signature of `xcplib::CreateCalSeg` changed, pointer to reference page
- Automatic EPK segment is now optional (`OPTION_CAL_SEGMENT_EPK` in `main_cfg.h`)

### Experimental
- Tool `bintool` to convert XCPlite-specific BIN files to Intel-HEX format and apply Intel-HEX files to BIN files
- New demo `no_a2l_demo` to demonstrate workflows without runtime A2L generation (using a XCPlite-specific A2L creator, see README.md of `no_a2l_demo`)
- New demo 'bpf_demo' to demonstrate usage of XCPlite together with eBPF programs for Linux kernel tracing (see README.md of `bpf_demo`)
- Internal naming convention refactored to support A2L creation for dynamic objects from ELF/DWARF binaries
- Rust xcp-lite V1.0.0 uses the calibration segment management of XCPlite instead of implementing its own

### Fixed
- Various bug fixes



## [V0.9.2]

### Breaking Changes
- Breaking changes from V0.6

### Added
- Lockless transmit queue (works on x86-64 strong and ARM-64 weak memory models)
- Measurement and read access to variables on stack
- Calibration segments for lock-free and thread-safe calibration parameter access, consistent calibration changes, and page switches
- Support for multiple segments with working and reference page and independent page switching
- Build as a library
- Used as FFI library for the Rust xcp-lite version

### Changed
- Refactored A2L generation macros
39 changes: 38 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,32 @@ elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
set(COMMON_WARNING_FLAGS /W3)
endif()

# Custom build type configurations for debug symbols in release builds
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
# For Release builds: use -O2 optimization and remove debug symbols and assertions
set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
# For RelWithDebInfo builds: release build with moderate optimization and with debug symbols, preserve stack frames
# -fno-omit-frame-pointer: Always generate frame pointer for better stack traces
# -fno-optimize-sibling-calls: Prevent tail call optimization that can confuse debuggers
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O1 -g -fno-omit-frame-pointer -fno-optimize-sibling-calls -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O1 -g -fno-omit-frame-pointer -fno-optimize-sibling-calls -DNDEBUG")
# For Debug builds: no optimization, full debug symbols
set(CMAKE_C_FLAGS_DEBUG "-O0 -g")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
message(STATUS "Custom compiler flags set")
elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
# MSVC equivalent settings
set(CMAKE_C_FLAGS_RELEASE "/O2 /Zi /DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "/O2 /Zi /DNDEBUG")
# /Oy- disables frame pointer omission (equivalent to -fno-omit-frame-pointer)
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/O2 /Zi /Oy- /DNDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/O2 /Zi /Oy- /DNDEBUG")
message(STATUS "Custom MSVC flags set")
endif()

# xcplib sources
set(xcplib_SOURCES src/xcpAppl.c src/xcpLite.c src/xcpEthServer.c src/xcpEthTl.c src/xcpQueue32.c src/xcpQueue64.c src/a2l.c src/persistency.c src/platform.c)
set(xcplib_SOURCES src/xcpAppl.c src/xcpLite.c src/xcpEthServer.c src/xcpEthTl.c src/xcpQueue32.c src/xcpQueue64.c src/a2l.c src/persistence.c src/platform.c)

set(PROJECT_ROOT ${CMAKE_CURRENT_LIST_DIR})
message(STATUS "PROJECT_ROOT is: ${PROJECT_ROOT}")
Expand Down Expand Up @@ -134,6 +157,13 @@ add_executable(hello_xcp ${hello_xcp_SOURCES})
target_include_directories(hello_xcp PUBLIC "${PROJECT_ROOT}/inc")
target_link_libraries(hello_xcp PRIVATE xcplib)

# Example no_a2l_demo
set(no_a2l_demo_SOURCES examples/no_a2l_demo/src/main.c)
set_source_files_properties(${no_a2l_demo_SOURCES} PROPERTIES LANGUAGE C)
add_executable(no_a2l_demo ${no_a2l_demo_SOURCES})
target_include_directories(no_a2l_demo PUBLIC "${PROJECT_ROOT}/inc")
target_link_libraries(no_a2l_demo PRIVATE xcplib)

# Example hello_xcp_cpp
add_executable(hello_xcp_cpp examples/hello_xcp_cpp/src/main.cpp )
target_include_directories(hello_xcp_cpp PUBLIC "${PROJECT_ROOT}/inc")
Expand Down Expand Up @@ -204,6 +234,11 @@ if(BUILD_TEST)
add_executable(cal_test test/cal_test/src/main.cpp)
target_include_directories(cal_test PUBLIC "${PROJECT_ROOT}/inc")
target_link_libraries(cal_test PRIVATE xcplib)

# Data acquisition multi-threading test (C version)
add_executable(daq_test test/daq_test/src/main.c)
target_include_directories(daq_test PUBLIC "${PROJECT_ROOT}/inc")
target_link_libraries(daq_test PRIVATE xcplib)
endif()


Expand All @@ -219,6 +254,7 @@ else()

# Set .out suffix for executables on non-Windows platforms
set_target_properties(hello_xcp PROPERTIES SUFFIX ".out")
set_target_properties(no_a2l_demo PROPERTIES SUFFIX ".out")
set_target_properties(hello_xcp_cpp PROPERTIES SUFFIX ".out")
set_target_properties(c_demo PROPERTIES SUFFIX ".out")
set_target_properties(cpp_demo PROPERTIES SUFFIX ".out")
Expand All @@ -231,6 +267,7 @@ else()
set_target_properties(type_detection_test_cpp PROPERTIES SUFFIX ".out")
set_target_properties(a2l_test PROPERTIES SUFFIX ".out")
set_target_properties(cal_test PROPERTIES SUFFIX ".out")
set_target_properties(daq_test PROPERTIES SUFFIX ".out")
endif()
endif()

Loading