You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+83-3Lines changed: 83 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,7 @@ It is an [open-source project](https://github.com/SuperTinyKernel-RTOS), navigat
51
51
| Safety-critical systems ready | No dynamic heap memory allocation |
52
52
| C++ and C API | Can be used easily in C++ and C projects |
53
53
| CMSIS-RTOS2 compatible | Full CMSIS-RTOS2 wrapper (`cmsis_os2_stk.cpp`) maps the standard ARM CMSIS-RTOS2 C API onto STK, enabling drop-in compatibility with STM32CubeMX, MCUXpresso, and other CMSIS-aware middleware |
54
+
| FreeRTOS compatible | Full FreeRTOS wrapper (`freertos_stk.cpp`) maps the standard FreeRTOS C API onto STK, enabling drop-in migration of existing FreeRTOS codebases with minimal or no application changes |
54
55
| Easy porting | Requires very small to none BSP surface |
55
56
| Traceable | Scheduling is fully traceable with a SEGGER SystemView |
56
57
| Development mode (x86) | Run the same threaded application on Windows |
@@ -257,12 +258,91 @@ For a seamless integration with C projects STK provides a dedicated, fully-featu
257
258
258
259
---
259
260
260
-
## CMSIS-RTOS2 Wrapper (`interop/cmsis/rtos2`)
261
+
## Migrating from CMSIS-RTOS2 or FreeRTOS
261
262
262
-
STK provides a complete **CMSIS-RTOS2** compatibility layer (`cmsis_os2_stk.cpp`) that maps standard ARM [CMSIS-RTOS2 C API](https://arm-software.github.io/CMSIS_6/latest/RTOS2/group__CMSIS__RTOS.html) (`cmsis_os2.h`**v2.3.0**) onto the STK C++ kernel. This allows you to use STK as a drop-in RTOS backend in any project that targets the CMSIS-RTOS2 interface, including code generated by STM32CubeMX, MCUXpresso, or any other CMSIS-aware IDE or middleware stack. See [interop/cmsis/rtos2](https://github.com/SuperTinyKernel-RTOS/stk/tree/main/interop/cmsis/rtos2) for more details and example.
263
+
STK ships two ready-made compatibility wrappers that let you swap out your existing RTOS backend and replace it with STK without rewriting application code. Both wrappers live under `interop/` and share the same design principles: thin translation of the source API onto STK primitives, ISR-safe where the original API requires it, and zero heap usage when the caller supplies static memory.
263
264
264
-
CMSIS-RTOS2 API works as documented in the CMSIS-RTOS2 specification.
265
+
### CMSIS-RTOS2 Wrapper (`interop/cmsis/rtos2`)
265
266
267
+
STK provides a complete **CMSIS-RTOS2** compatibility layer (`cmsis_os2_stk.cpp`) that maps the standard ARM [CMSIS-RTOS2 C API](https://arm-software.github.io/CMSIS_6/latest/RTOS2/group__CMSIS__RTOS.html) (`cmsis_os2.h`**v2.3.0**) onto the STK C++ kernel. This allows you to use STK as a drop-in RTOS backend in any project that targets the CMSIS-RTOS2 interface, including code generated by STM32CubeMX, MCUXpresso, or any other CMSIS-aware IDE or middleware stack.
268
+
269
+
**Covered API groups:** Kernel Management, Thread Management, Thread Flags, Event Flags, Mutex, Semaphore, Timer, Message Queue, Memory Pool.
INCLUDES += -Ilibs/stk/interop/cmsis/rtos2/include
280
+
```
281
+
282
+
```c
283
+
// 3. No application changes required — existing CMSIS-RTOS2 calls work as-is
284
+
#include"cmsis_os2.h"
285
+
286
+
intmain(void)
287
+
{
288
+
osKernelInitialize();
289
+
osThreadNew(app_thread, NULL, NULL);
290
+
osKernelStart(); // never returns
291
+
}
292
+
```
293
+
294
+
See [interop/cmsis/rtos2](https://github.com/SuperTinyKernel-RTOS/stk/tree/main/interop/cmsis/rtos2) for the full API coverage table, design notes, and configuration macros.
295
+
296
+
---
297
+
298
+
### FreeRTOS Wrapper (`interop/freertos`)
299
+
300
+
STK provides a complete **FreeRTOS** compatibility layer (`freertos_stk.cpp`) that maps the standard FreeRTOS C API onto the STK C++ kernel. Existing FreeRTOS projects can migrate to STK with minimal or no changes to application code, while immediately gaining STK's lower scheduling overhead, reduced jitter, and smaller RAM footprint (see [Benchmark](#benchmark) above).
// 3. No application changes required — existing FreeRTOS calls work as-is
317
+
#include"FreeRTOS.h"
318
+
#include"task.h"
319
+
320
+
intmain(void)
321
+
{
322
+
xTaskCreate(app_task, "app", 256, NULL, 2, NULL);
323
+
vTaskStartScheduler(); // never returns
324
+
}
325
+
```
326
+
327
+
See [interop/freertos](https://github.com/SuperTinyKernel-RTOS/stk/tree/main/interop/freertos) for the full API coverage table, design notes, known limitations, and `FreeRTOSConfig.h` requirements.
| Tickless support | `STK_TICKLESS_IDLE=1` | `STK_TICKLESS_IDLE=1` |
343
+
344
+
345
+
> **Note:** Wrapper is missing important API your project is using? Contact with inquiry: [contact@supertinykernel.org](mailto:contact@supertinykernel.org)
0 commit comments