XCP SDK
The QFW XCP SDK adds a complete XCP slave to the MCU firmware, so QInsight connects to the device with the XCP on TCP protocol:
- polling and DAQ measurement — the device samples the values in
its own cycle, with 1 µs resolution timestamps from the device clock
(QInsight with the default
daqTimestamps=slaveuses them directly for the time axis), - calibration writes from QInsight controls,
- STIM — smooth stimulation of firmware variables streamed from the PC.
What the package contains
- The static library
libqfw_xcp.a— the protocol engine. A single headerqfw_xcp.h(C11 and C++), no other dependencies. - The source glue layer — a reference binding to FreeRTOS + lwIP (a TCP server task).
- A complete integration example for a NUCLEO board (STM32H7) — from creating events to live measurement in QInsight.
- The core license text (the engine builds on Vector XCPlite, MIT license).
The integration model
The engine has no OS, threads, or heap — you supply everything it needs through callbacks:
| The integrator provides | The engine does |
|---|---|
received transport bytes → qfw_xcp_rx() | frame parsing, XCP commands |
a cyclic call of qfw_xcp_poll() (1–10 ms) | transmits measurements and responses via your transmit callback |
a monotonic clock in µs (get_clock) | DAQ timestamps |
a critical section (crit_enter/crit_leave) | data consistency even when called from interrupts |
qfw_xcp_config_t cfg = QFW_XCP_CONFIG_DEFAULT;
cfg.project_name = "MyEcu";
cfg.epk = "V1.0.0";
cfg.transmit = my_transmit; // writes to the TCP stream
cfg.get_clock = my_clock_us; // monotonic time in µs
cfg.crit_enter = my_lock;
cfg.crit_leave = my_unlock;
cfg.queue_mem = queue_memory; // static memory, no allocations
cfg.queue_mem_size = sizeof(queue_memory);
qfw_xcp_init(&cfg);
uint16_t ev10ms = qfw_xcp_create_event("task10ms", 10000);
// in the 10 ms task / timer:
qfw_xcp_trigger_event(ev10ms); // samples DAQ lists, applies STIM
Events created with qfw_xcp_create_event are the event channels
that DAQ and STIM events bind to in QInsight (daqId). The variable
addresses come from your firmware's map/ELF file — enter them into
address in the Comm params (see
XCP polling, DAQ, and STIM).
Evaluation and licensing
Without an activation key the engine runs in evaluation mode (60
minutes per device start, see the
introduction); the version and license
state are reported by qfw_xcp_version() and qfw_xcp_is_licensed().
Next
The QInsight side is described in the XCP protocol reference.

