Skip to content

Commit a94e834

Browse files
authored
V1.0.0 (#101)
* Absolute calibration segment addressing mode * Changed signature of xcplib::CreateCalSeg * OPTION_ASYNC_EVENT * XCP_ENABLE_DAQ_PRESCALER option * no_a2l_demo * Experimental xcp-lite/xcp_client based A2L creator for no_a2l_demo * Addressing mode configuration and A2L project_no indicator * #define XCP_ENABLE_COPY_CAL_PAGE_WORKAROUND (see xcp_cfg.h) * Removed implicit epk calibration segment * Reference or working page persistency * Sync with xcp-lite * bintool * BPF demo, monitoring individidual syscalls * Platform defines restructured for QNX support * Variadic daq trigger functions * Auto addressing mode * Simplified registration of typedefs * Sync with xcp-lite * Single page mode * Changes for Rust xcp-lite V1.0.0 calibration segment management * Warning on calibration update timeout, when lock is hold too long * ApplXcpRegisterCallbacks removed * Windows compatibility, MSVC warnings and build breaks fixed
1 parent 80c6b31 commit a94e834

File tree

102 files changed

+43153
-6185
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+43153
-6185
lines changed

.gitignore

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,41 @@
11

2-
/build
3-
/build-*
2+
build
3+
build-*
44

55

66
# CANape artefacts
77
*.hex
88
*.mf4
99
*.cnaxml
1010
*.tmp
11+
CANapeTmpMea.ini
1112

12-
# Examples A2L files
13-
*.a2l
13+
14+
# Examples .a2l and .bin files
15+
/*.a2l
1416
*.bin
1517

1618
# Temporary files
19+
test_bintool
1720
conversions.a2l
1821
groups.a2l
1922
typedefs.a2l
2023
*.bak
24+
*.log
25+
*.txt
2126

2227

28+
# Other
2329
/run_remote.sh
2430
/run.sh
25-
/examples/bpf_demo/CANape/CANapeTmpMea.ini
31+
pi
32+
dwarf
33+
.vscode
34+
.DS_Store
35+
test_bpf_demo_pi.sh
36+
test_bin2hex_pi.sh
37+
CANape.aml
38+
tools/gimli_demo/
39+
tools/dwarf_reader/
40+
tools/bintool/USAGE_EXAMPLES.md
41+
/examples/hello_xcp/CANape/vCDMstudioUiConfiguration.xml

.vscode/launch.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
{
22
"version": "0.2.0",
33
"configurations": [
4+
{
5+
"name": "Debug hello_xcp_cpp",
6+
"type": "cppdbg",
7+
"request": "launch",
8+
"program": "${workspaceFolder}/build/hello_xcp_cpp.out",
9+
"args": [],
10+
"stopAtEntry": false,
11+
"cwd": "${workspaceFolder}",
12+
"environment": [],
13+
"externalConsole": false,
14+
"MIMode": "lldb",
15+
"setupCommands": [
16+
{
17+
"description": "Enable pretty-printing for gdb",
18+
"text": "-enable-pretty-printing",
19+
"ignoreFailures": true
20+
}
21+
],
22+
"preLaunchTask": "XCPlite: build hello_xcp_cpp"
23+
},
424
{
525
"name": "Debug cpp_demo",
626
"type": "cppdbg",

.vscode/tasks.json

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,29 @@
9696
"detail": "Build hello_xcp target using CMake",
9797
"dependsOn": "cmake configure"
9898
},
99+
{
100+
"type": "shell",
101+
"label": "XCPlite: build hello_xcp_cpp",
102+
"command": "cmake",
103+
"args": [
104+
"--build",
105+
"build",
106+
"--target",
107+
"hello_xcp_cpp"
108+
],
109+
"options": {
110+
"cwd": "${workspaceFolder}"
111+
},
112+
"group": {
113+
"kind": "build",
114+
"isDefault": false
115+
},
116+
"problemMatcher": [
117+
"$gcc"
118+
],
119+
"detail": "Build hello_xcp_cpp target using CMake",
120+
"dependsOn": "cmake configure"
121+
},
99122
{
100123
"type": "shell",
101124
"label": "XCPlite: build c_demo",
@@ -314,10 +337,10 @@
314337
"args": [
315338
"-avz",
316339
"--include=\"*.out\"",
317-
"--include=\"*.a\"",
340+
"--include=\"*.a2l\"",
318341
"--exclude=\"*\"",
319342
"[email protected]:~/XCPlite-RainerZ/build/",
320-
"./build/"
343+
"./pi/"
321344
],
322345
"options": {
323346
"cwd": "${workspaceFolder}"

CANape.aml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
// /begin A2ML
2+
/begin A2ML
33

44
block "IF_DATA" taggedunion if_data {
55

@@ -166,4 +166,4 @@ block "IF_DATA" taggedunion if_data {
166166

167167
}; // block "IF_DATA"
168168

169-
// /end A2ML
169+
/end A2ML

CHANGELOG.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Changelog
2+
3+
All notable changes to XCPlite are documented in this file.
4+
5+
## [V1.0.0]
6+
7+
### Breaking API Changes
8+
9+
10+
- XcpInit signature changed to
11+
```c
12+
void XcpInit(const char *name, const char *epk, bool activate);
13+
```
14+
15+
- A2lInit signature changed to
16+
```c
17+
bool A2lInit(const uint8_t addr[4], uint16_t port, bool use_tcp, uint32_t mode);
18+
```
19+
20+
- CalSeg constructor signature changed, takes a pointer to the default parameters
21+
```c
22+
CalSeg(const char *name, const T *default_params)
23+
```
24+
25+
- A2lTypedefBegin gets a pointer to any instance of the type.
26+
- A2lTypedefParameterComponent does not need the typename parameter anymore
27+
- A2lTypedefMeasurementComponent does not need the typename parameter anymore and has a comment parameter
28+
```c
29+
{
30+
A2lTypedefBegin(ParametersT, &kParameters, "A2L Typedef for ParametersT");
31+
A2lTypedefParameterComponent(min, "Minimum random number value", "Volt", -100.0, 100.0);
32+
A2lTypedefParameterComponent(max, "Maximum random number value", "Volt", -100.0, 100.0);
33+
A2lTypedefEnd();
34+
}
35+
36+
- DaqCreateEventInstance does not return the event id anymore, new function DaqGetEventInstanceId to get the event id from the name
37+
```c
38+
DaqCreateEventInstance("task");
39+
tXcpEventId task_event_id = DaqGetEventInstanceId("task");
40+
```
41+
42+
- BIN format changes to enable future feature extensions, old BIN files are not compatible anymore
43+
44+
45+
### Added
46+
- Absolute or relative calibration parameter segment addressing (`OPTION_CAL_SEGMENTS_ABS` in `main_cfg.h`)
47+
- More flexible addressing scheme configuration (see `xcp_cfg.h`)
48+
- Generated A2L file uses the `project_no` identifier to indicate the configured addressing schema (currently ACSDD or CASDD)
49+
- Support for more than one base address in relative address mode, variadic function to trigger event with multiple base addresses
50+
- Optional async event with 1ms cycle time and prescaler support (`OPTION_DAQ_ASYNC_EVENT` in `main_cfg.h`)
51+
- Different options to control the behavior of calibration segment persistence and freeze
52+
- Memory optimization for event/daq-list mapping
53+
- XCP_ENABLE_COPY_CAL_PAGE_WORKAROUND to enable workaround for CANape init calibration segments bug
54+
- Variadic macro to create, trigger, and register local and member variables in one call with automatic addressing mode deduction (see hello_xcp_cpp example)
55+
```c
56+
XcpDaqEventExt(avg_calc1, this, //
57+
(input, "Input value for floating average", "V", 0.0, 1000.0), //
58+
(average, "Current calculated average"), //
59+
(current_index_, "Current position in ring buffer"), //
60+
(sample_count_, "Number of samples collected"), //
61+
(sum_, "Running sum of all samples")
62+
63+
);
64+
```
65+
66+
### Changed
67+
- Signature of `xcplib::CreateCalSeg` changed, pointer to reference page
68+
- Automatic EPK segment is now optional (`OPTION_CAL_SEGMENT_EPK` in `main_cfg.h`)
69+
70+
### Experimental
71+
- Tool `bintool` to convert XCPlite-specific BIN files to Intel-HEX format and apply Intel-HEX files to BIN files
72+
- 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`)
73+
- New demo 'bpf_demo' to demonstrate usage of XCPlite together with eBPF programs for Linux kernel tracing (see README.md of `bpf_demo`)
74+
- Internal naming convention refactored to support A2L creation for dynamic objects from ELF/DWARF binaries
75+
- Rust xcp-lite V1.0.0 uses the calibration segment management of XCPlite instead of implementing its own
76+
77+
### Fixed
78+
- Various bug fixes
79+
80+
81+
82+
## [V0.9.2]
83+
84+
### Breaking Changes
85+
- Breaking changes from V0.6
86+
87+
### Added
88+
- Lockless transmit queue (works on x86-64 strong and ARM-64 weak memory models)
89+
- Measurement and read access to variables on stack
90+
- Calibration segments for lock-free and thread-safe calibration parameter access, consistent calibration changes, and page switches
91+
- Support for multiple segments with working and reference page and independent page switching
92+
- Build as a library
93+
- Used as FFI library for the Rust xcp-lite version
94+
95+
### Changed
96+
- Refactored A2L generation macros

CMakeLists.txt

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,32 @@ elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
9393
set(COMMON_WARNING_FLAGS /W3)
9494
endif()
9595

96+
# Custom build type configurations for debug symbols in release builds
97+
if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang")
98+
# For Release builds: use -O2 optimization and remove debug symbols and assertions
99+
set(CMAKE_C_FLAGS_RELEASE "-O2 -DNDEBUG")
100+
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
101+
# For RelWithDebInfo builds: release build with moderate optimization and with debug symbols, preserve stack frames
102+
# -fno-omit-frame-pointer: Always generate frame pointer for better stack traces
103+
# -fno-optimize-sibling-calls: Prevent tail call optimization that can confuse debuggers
104+
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O1 -g -fno-omit-frame-pointer -fno-optimize-sibling-calls -DNDEBUG")
105+
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O1 -g -fno-omit-frame-pointer -fno-optimize-sibling-calls -DNDEBUG")
106+
# For Debug builds: no optimization, full debug symbols
107+
set(CMAKE_C_FLAGS_DEBUG "-O0 -g")
108+
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
109+
message(STATUS "Custom compiler flags set")
110+
elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
111+
# MSVC equivalent settings
112+
set(CMAKE_C_FLAGS_RELEASE "/O2 /Zi /DNDEBUG")
113+
set(CMAKE_CXX_FLAGS_RELEASE "/O2 /Zi /DNDEBUG")
114+
# /Oy- disables frame pointer omission (equivalent to -fno-omit-frame-pointer)
115+
set(CMAKE_C_FLAGS_RELWITHDEBINFO "/O2 /Zi /Oy- /DNDEBUG")
116+
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/O2 /Zi /Oy- /DNDEBUG")
117+
message(STATUS "Custom MSVC flags set")
118+
endif()
96119

97120
# xcplib sources
98-
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)
121+
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)
99122

100123
set(PROJECT_ROOT ${CMAKE_CURRENT_LIST_DIR})
101124
message(STATUS "PROJECT_ROOT is: ${PROJECT_ROOT}")
@@ -134,6 +157,13 @@ add_executable(hello_xcp ${hello_xcp_SOURCES})
134157
target_include_directories(hello_xcp PUBLIC "${PROJECT_ROOT}/inc")
135158
target_link_libraries(hello_xcp PRIVATE xcplib)
136159

160+
# Example no_a2l_demo
161+
set(no_a2l_demo_SOURCES examples/no_a2l_demo/src/main.c)
162+
set_source_files_properties(${no_a2l_demo_SOURCES} PROPERTIES LANGUAGE C)
163+
add_executable(no_a2l_demo ${no_a2l_demo_SOURCES})
164+
target_include_directories(no_a2l_demo PUBLIC "${PROJECT_ROOT}/inc")
165+
target_link_libraries(no_a2l_demo PRIVATE xcplib)
166+
137167
# Example hello_xcp_cpp
138168
add_executable(hello_xcp_cpp examples/hello_xcp_cpp/src/main.cpp )
139169
target_include_directories(hello_xcp_cpp PUBLIC "${PROJECT_ROOT}/inc")
@@ -204,6 +234,11 @@ if(BUILD_TEST)
204234
add_executable(cal_test test/cal_test/src/main.cpp)
205235
target_include_directories(cal_test PUBLIC "${PROJECT_ROOT}/inc")
206236
target_link_libraries(cal_test PRIVATE xcplib)
237+
238+
# Data acquisition multi-threading test (C version)
239+
add_executable(daq_test test/daq_test/src/main.c)
240+
target_include_directories(daq_test PUBLIC "${PROJECT_ROOT}/inc")
241+
target_link_libraries(daq_test PRIVATE xcplib)
207242
endif()
208243

209244

@@ -219,6 +254,7 @@ else()
219254

220255
# Set .out suffix for executables on non-Windows platforms
221256
set_target_properties(hello_xcp PROPERTIES SUFFIX ".out")
257+
set_target_properties(no_a2l_demo PROPERTIES SUFFIX ".out")
222258
set_target_properties(hello_xcp_cpp PROPERTIES SUFFIX ".out")
223259
set_target_properties(c_demo PROPERTIES SUFFIX ".out")
224260
set_target_properties(cpp_demo PROPERTIES SUFFIX ".out")
@@ -231,6 +267,7 @@ else()
231267
set_target_properties(type_detection_test_cpp PROPERTIES SUFFIX ".out")
232268
set_target_properties(a2l_test PROPERTIES SUFFIX ".out")
233269
set_target_properties(cal_test PROPERTIES SUFFIX ".out")
270+
set_target_properties(daq_test PROPERTIES SUFFIX ".out")
234271
endif()
235272
endif()
236273

0 commit comments

Comments
 (0)