The SDK is designed for portability across embedded platforms and operating systems. To port the SDK to a new platform, follow these steps.
Use the Linux reference implementation in platform/linux/ as a working starting point. For RTOS-based platforms, map mutexes and events to your RTOS primitives (e.g., FreeRTOS SemaphoreHandle_t, Zephyr k_mutex).
Create a new directory under platform/ (e.g., platform/my_platform/) with two files:
Define the platform-specific types used by the SDK:
The Linux reference uses pthread_mutex_t for mutexes and a struct wrapping pthread_mutex_t + pthread_cond_t + bool flag for events. Adapt these to your platform’s RTOS or OS primitives.
Implement all functions declared in ecod_sdk_platform.h. They are grouped into these categories:
Initialization
Implement the startup function to allocate platform resources:
Clock & Timing
Implement these functions to provide the SDK with a monotonic clock and blocking delay:
Logging
Implement these functions to route SDK log output to your platform’s logging system:
Memory (only when EC_USE_HEAP is enabled)
Implement malloc and free wrappers when heap allocation is enabled:
Mutex
Implement these functions using your platform’s mutual-exclusion primitives:
Event
Waitable signal used for inter-thread synchronization:
Serial Communication
Implement these functions to handle raw serial or USB HID I/O:
Network (only if using the network bridge)
Implement these functions to give the SDK access to TCP sockets:
Update the Build System
Modify configure.ac and Makefile.am to include your platform:
Test the Integration
Use the demo application to verify functionality on your target platform:
For detailed porting guidance, see platform/ecod_sdk_platform.h.