{"id":21112489,"url":"https://github.com/dmitrykos/stk","last_synced_at":"2025-12-29T08:06:22.806Z","repository":{"id":162184350,"uuid":"548286749","full_name":"dmitrykos/stk","owner":"dmitrykos","description":"Minimalistic C++ thread scheduling kernel for Embedded systems. Supports ARM Cortex-M and RISC-V MCUs with debugging possibility on conventional x86. Compiles with GCC. Comes with examples for Eclipse. Can be used on any embedded system with limited RAM and FLASH resources.","archived":false,"fork":false,"pushed_at":"2025-02-09T18:41:10.000Z","size":4213,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-09T19:25:24.510Z","etag":null,"topics":["arm","cortex-m","embedded-systems","real-time-scheduling","real-time-systems","risc-v","thread-scheduling","threading"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmitrykos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-09T08:59:22.000Z","updated_at":"2025-02-09T18:41:14.000Z","dependencies_parsed_at":"2023-10-12T22:27:31.003Z","dependency_job_id":null,"html_url":"https://github.com/dmitrykos/stk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmitrykos%2Fstk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmitrykos%2Fstk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmitrykos%2Fstk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmitrykos%2Fstk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmitrykos","download_url":"https://codeload.github.com/dmitrykos/stk/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243558477,"owners_count":20310573,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arm","cortex-m","embedded-systems","real-time-scheduling","real-time-systems","risc-v","thread-scheduling","threading"],"created_at":"2024-11-20T01:29:26.314Z","updated_at":"2025-12-29T08:06:22.800Z","avatar_url":"https://github.com/dmitrykos.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Logo](docs/img/stk_logo_200px.png)\n# SuperTinyKernel (STK)\n\nMinimalistic C++/C Thread Scheduler for Embedded Systems.\n\n---\n\n[![MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/dmitrykos/stk/blob/main/LICENSE)\n[![Build Status](https://img.shields.io/github/actions/workflow/status/dmitrykos/stk/cmake-test-generic-stm32.yml)](https://github.com/dmitrykos/stk/actions)\n[![Test Coverage](https://img.shields.io/badge/coverage-100%25-brightgreen)](https://github.com/dmitrykos/stk)\n\n---\n\n## Overview\n\n**SuperTinyKernel (STK)** provides a lightweight, preemptive, as well as deterministic thread scheduling layer for bare-metal embedded applications.\n\nSTK is implemented in C++ with a clean **object-oriented design**, while remaining friendly to C developers:\n* No aggressive namespace usage\n* No dependency on modern C++ features or STL\n* Transparent and readable implementation\n* Dedicated C interface\n\nSTK delivers RTOS-like concurrency without the overhead (lower run-time performance, bloated binary and code base) of a full RTOS.\n\nIt is an [open-source project](https://github.com/dmitrykos/stk), navigate its code for more details.\n\n---\n\n## Key Features\n\n| Feature                               | Description                                                                                  |\n|---------------------------------------|----------------------------------------------------------------------------------------------|\n| Soft real-time                        | No strict time slots, mixed cooperative (by tasks) and preemptive (by kernel) scheduling     |\n| Hard real-time (`KERNEL_HRT`)         | Guaranteed execution window, deadline monitoring                                             |\n| Static task model (`KERNEL_STATIC`)   | Tasks created once at startup                                                                |\n| Dynamic task model (`KERNEL_DYNAMIC`) | Tasks can be created and exit at runtime                                                     |\n| Extensible via interfaces             | Kernel functionality can be extended by implementing STK’s interfaces                        |\n| Multi-core support (AMP)              | One STK instance per physical core for optimal, lock-free performance                        |\n| Low-power aware                       | MCU enters sleep when no task is runnable (sleeping)                                         |\n| Critical section API                  | Basic synchronization primitive                                                              |\n| Tiny footprint                        | Minimal code unrelated to scheduling                                                         |\n| Safety-critical systems ready         | No dynamic heap memory allocation (satisfies MISRA C++:2008 Rule 18-4-1)                     |\n| C++ and C API                         | Can be used easily in C++ and C projects                                                     |\n| Easy porting                          | Requires very small BSP surface                                                              |\n| Traceable                             | Scheduling is fully traceable with SEGGER SystemView GUI application                         |\n| Development mode (x86)                | Run the same threaded application on Windows                                                 |\n| 100% test coverage                    | Every source-code line of scheduler logic is covered by unit tests                           |\n| QEMU test coverage                    | All repository commits are automatically covered by unit tests executed on QEMU for Cortex-M |\n\n---\n\n## Modes of Operation\n\n### Soft Real-Time (Default)\n\n* Tasks cooperate using `Sleep()` or `Yield()`\n* Timing is a best-effort\n* Tasks can not block execution of other tasks (preemptive scheduling, see **Built-in Scheduling Strategies**)\n\n### Hard Real-Time (HRT)\n\n* Separate kernel mode of operation set by `KERNEL_HRT` flag\n* Periodic tasks with strict execution windows\n* Tasks must notify kernel when the work is done by using `Yield()`\n* Kernel enforces deadlines\n* Any violation fails the application deterministically (`ITask::OnDeadlineMissed` callback is called)\n* Dedicated HRT task switching strategies (`SwitchStrategyRoundRobin`, `SwitchStrategyRM`, `SwitchStrategyDM`, `SwitchStrategyEDF`)\n\n\u003e HRT use cases: motor control, power electronics, aerospace systems.\n\n### Static vs Dynamic\n\n* `KERNEL_STATIC` – tasks created once at startup, kernel never returns to `main()`\n* `KERNEL_DYNAMIC` – tasks may exit, kernel returns to `main()` when all tasks exit\n\n### Built-in Scheduling Strategies\n\n| Strategy Name                            | Mode        | Description                                                                                                                     |\n|------------------------------------------|-------------|---------------------------------------------------------------------------------------------------------------------------------|\n| `SwitchStrategyRoundRobin`               | Soft / HRT  | Round-Robin scheduling strategy (Default). Allows 100% CPU utilization by tasks.                                                |\n| `SwitchStrategySmoothWeightedRoundRobin` | Soft / HRT  | Smooth Weighted Round-Robin (SWRR). Distributes CPU time proportionally to task weights and avoids execution bursts.            |\n| `SwitchStrategyRM`                       | HRT         | Rate-Monotonic (RM). Prioritizes tasks based on their periodicity (rate).                                                       |\n| `SwitchStrategyDM`                       | HRT         | Deadline-Monotonic (DM). Prioritizes tasks based on their deadlines.                                                            |\n| `SwitchStrategyEDF`                      | HRT         | Earliest Deadline First (EDF). Allows 100% CPU utilization by tasks with less context switches than `SwitchStrategyRoundRobin`. |\n| Custom                                   | Soft / HRT  | Custom algorithm implemented via the `ITaskSwitchStrategy` interface.                                                           |\n\n\n### Task Privilege Separation\n\nStarting with ARM Cortex-M3 and all newer cores (M3/M4/M7/M33/M55/...) that implement the Armv7-M or Armv8-M architecture with the **Memory Protection Unit (MPU)**, STK supports explicit privilege separation between tasks.\n\n| Access Mode                                                                      | Privileged (`ACCESS_PRIVILEGED`)                            | Unprivileged (`ACCESS_USER`)                                       |\n|----------------------------------------------------------------------------------|-------------------------------------------------------------|--------------------------------------------------------------------|\n| CPU privilege level                                                              | Runs in **Privileged Thread Mode**                          | Runs in **Unprivileged Thread Mode**                               |\n| Direct peripheral access                                                         | Allowed (normal register/bit-band access)                   | Blocked by the hardware (BusFault on any peripheral access)        |\n| Ability to call SVC / trigger PendSV                                             | Yes                                                         | No (but STK services allow Sleep, Delay, Yield, CS, ...)           |\n| Ability to execute privileged instructions (CPS, MRS/MSR for control regs, etc.) | Yes                                                         | No                                                                 |\n| Typical use case                                                                 | Drivers, hardware abstraction, critical infrastructure code | Application logic, protocol parsers, third-party or untrusted code |\n\n#### Why this matters\n\nModern embedded systems increasingly process **untrusted or complex data** (network/USB packets, sensor data, firmware updates, etc.). A single bug in data parsing code can corrupt peripheral registers, disable interrupts, or even brick the device.\n\nBy marking tasks that parse potentially attacker-controlled data as `ACCESS_USER`, you get **hardware-enforced isolation**:\n- An erroneous or malicious write to a peripheral register immediately triggers a **hard BusFault** instead of silently corrupting hardware state.\n- Only explicitly trusted tasks (marked `ACCESS_PRIVILEGED`) are allowed to touch GPIO, UART, SPI, DMA, timers, etc.\n- The kernel itself and all STK services remain fully functional for unprivileged tasks (sleep, yield, critical sections, TLS, etc.).\n\n#### Example\n\n```cpp\n// Trusted driver task – needs direct hardware access\nclass DriverTask : public stk::Task\u003c256, ACCESS_PRIVILEGED\u003e { ... };\n\n// Application task that parses USB or network data – runs unprivileged\nclass ParserTask : public stk::Task\u003c512, ACCESS_USER\u003e { ... };\n```\n\n### Multi-Core Support\n\nSTK fully supports multicore embedded microcontrollers (e.g., ARM Cortex-M55, dual-core Cortex-M33/M7/M0, or multicore RISC-V devices) through a **per-core instance model** (Asymmetric Multi-Processing). This design delivers maximum performance while keeping the kernel extremely lightweight.\n\n#### Design Philosophy\n\n- **One independent STK instance per physical CPU core**\n- **No global scheduler or intercore orchestration**\n- Each core manages only its own tasks/threads → zero contention inside the kernel\n- Fully **asynchronous operation** between instances → **no locks, no spinlocks, no cache-line bouncing**\n- Highest possible performance and deterministic timing on each individual core\n\n#### Key Advantages\n\n| Benefit                          | Explanation                                                                              |\n|----------------------------------|------------------------------------------------------------------------------------------|\n| Zero intercore overhead          | No cross-core communication inside STK itself                                            |\n| Minimal latency                  | Scheduling decisions are local to the core                                               |\n| Full cache efficiency            | All kernel data structures stay in the local core’s L1 cache                             |\n| Independent timing domains       | One core can run hard real-time tasks while another runs soft real-time or dynamic tasks |\n| Simple \u0026 predictable             | No complex SMP synchronization logic required in the kernel                              |\n\n#### Inter-Task Cooperation Across Cores\n\nTasks running on different cores can safely communicate and synchronize using standard, well-established primitives:\n\n- Atomic operations (`__atomic_*`, `__ATOMIC_*`, LDREX/STREX, RISC-V A-extension)\n- Hardware semaphores or event flags (often provided by the MCU vendor)\n- Message queues or mailboxes in shared (cache-coherent) memory\n- Interrupt-based signaling (core A triggers an inter-processor interrupt on core B)\n- Ring buffers with volatile/head-tail pointers protected by memory barriers\n\nThese mechanisms are already part of virtually every multicore embedded SDK.\n\n#### Usage Example (Dual-Core System)\n\n```cpp\nvoid start_core0()\n{\n    // Core 0 – Real-time control tasks\n    static stk::Kernel\u003cKERNEL_STATIC, 8, stk::SwitchStrategyRoundRobin, PlatformDefault\u003e kernel_core0;\n\n    kernel_core0.Initialize(PERIODICITY_1MS); // Hard real-time tick\n    kernel_core0.AddTask(\u0026motor_control_task);\n    kernel_core0.AddTask(\u0026sensor_task);\n    // ...\n    kernel_core0.Start();\n}\n\nvoid start_core1()\n{\n    // Core 1 – Communication \u0026 logging tasks\n    static stk::Kernel\u003cKERNEL_DYNAMIC, 6, stk::SwitchStrategyRoundRobin, PlatformDefault\u003e kernel_core1;\n\n    kernel_core1.Initialize(PERIODICITY_10MS); // Softer timing\n    kernel_core1.AddTask(\u0026ethernet_task);\n    kernel_core1.AddTask(\u0026logging_task);\n    // ...\n    kernel_core1.Start();\n}\n```\n\nThere is a dual-core example for Raspberry Pico 2 W board with RSP2350 MCU in `build/example/project/eclipse/rpi/blinky-smp-rp2350w` folder.\n\n---\n\n## Hardware Support\n\n### CPU Architectures\n\n* ARM Cortex-M (ARMv6-M, ARMv7-M, ARMv7E-M, ARMv8-M, ARMv8.1-M)\n* RISC-V RV32I (RV32IMA_ZICSR)\n* RISC-V RV32E (RV32EMA_ZICSR) — including very small RAM devices\n\n### Floating-point\n\n* Soft\n* Hard\n\n---\n\n## Dependencies\n\n* CMSIS (ARM platforms only)\n* MCU vendor BSP (NXP, STM, RPI, etc.)\n\nNo other libraries required.\n\n---\n\n## Dedicated C interface\n\nFor easier integration with C projects STK provides dedicated C interface, see [interop/c](https://github.com/dmitrykos/stk/tree/main/interop/c) folder.\n\n---\n\n## Traceable by SEGGER SystemView\n\nScheduling process is fully traceable with [SEGGER SystemView](https://www.segger.com/products/development-tools/systemview) GUI application.\n\nThere is a ready to use Blinky example with tracing enabled: `build\\example\\project\\eclipse\\stm\\blinky-stm32f407g-disc1-segger`\n\n![SEGGER SystemView](docs/img/SEGGER_SystemView_STK_tasks_screenshot.png)\n\n---\n\n## Development Mode (x86)\n\nSTK includes a **full scheduling emulator** for Windows:\n\n* Run the same embedded application on x86\n* Debug threads using Visual Studio or Eclipse\n* Perform unit testing without hardware\n* Mock or simulate peripherals\n\n---\n\n## Test Boards\n\nSTK has been tested on the following development boards:\n\n* STM STM32F0DISCOVERY (Cortex-M0)\n* STM NUCLEO-F103RB (Cortex-M3)\n* NXP FRDM-K66F (Cortex-M4F)\n* STM STM32F4DISCOVERY (Cortex-M4F)\n* NXP MIMXRT1050 EVKB (Cortex-M7)\n* Raspberry Pi Pico 2 W (Cortex-M33 / RISC-V variant)\n\n\u003e **Note:** The list of tested boards does **not** limit STK’s compatibility. STK **does not depend on a specific board** and relies only on the underlying CPU architecture. As long as the target CPU is supported, STK can be integrated with your hardware platform.\n\n---\n\n## Quick Start (1 minute)\n\n### 1. Clone repository\n\n```bash\ngit clone https://github.com/dmitrykos/stk.git\ncd stk\n```\n\n### 2. Build example for x86 development mode\n\nYou can build and run examples **without any hardware** on Windows.\n\nwith Visual Studio:\n\n```bash\ncd build/example/project/msvc\n```\n* `blinky` – emulates toggling of Red, Green, Blue LEDs\n* `critical_section` – demonstrates support for Critical Section synchronization primitive\n* `tls` - demonstrates the use of Thread-local storage (TLS)\n\nwith Eclipse CDT:\n\n```bash\ncd build/example/project/eclipse\n```\n* `blinky-mingw32` – emulates toggling of Red, Green, Blue LEDs\n\nTo import project into Eclipse workspace:\n\n```\nFile → Import... → Existing Projects into Workspace → Select root directory → Browse... → build/example/project/eclipse/blinky-mingw32\n```\n\n### 3. Run on a hardware\n\n* Import the STM32, RPI (Raspberry Pico) or NXP example in Eclipse CDT IDE or MCUXpresso IDE\n* Example folders provide Eclipse `.launch` files for launching on QEMU, Segger J-Link, OpenOCD \n* Build and flash your target MCU\n\n---\n\n## Building and Running Examples\n\n\u003e You can use your own tools, below specified tools are just for a quick evaluation of STK's functionality using the provided examples.\n\n### Required tools for building examples\n\nFor STM32, RPI platforms:\n* Eclipse Embedded CDT\n* xPack GNU ARM Embedded GCC\n* xPack QEMU ARM emulator\n\nFor NXP platforms:\n* MCUXpresso IDE (includes GCC)\n\nFor RISC-V platforms:\n* xPack GNU RISC-V Embedded GCC\n* xPack QEMU RISC-V\n\n\u003e If you are targeting only ARM, RISC-V tools are not required.\n\n### Examples\n\nAll examples are located in `build/example/project/eclipse` folder.\n\nExamples are grouped by platform:\n* `stm` – STM32, for QEMU or hardware\n* `rpi` – Raspberry Pico\n* `risc-v` - RISC-V, for QEMU or hardware\n* `x86` – Windows emulator\n\n#### Import into Eclipse CDT\n\n```\nFile → Import... → Existing Projects into Workspace → Select root directory → build/example/project/eclipse\n```\n\nSTM32 and Raspberry Pico examples include SDK files located in `deps/target` folder.\n\n#### NXP Examples\n\nLocated in `build/example/project/nxp-mcuxpresso` folder.\n\nCompatible with:\n* Kinetis K66/K26\n* i.MX RT1050\n* other compatible NXP MCUs with ARM Cortex-M0/M3/M4/M7/M33/...\n\n---\n\n#### Example Code\n\nBelow example toggles RGB LEDs on a development board. Each LED is controlled by its own thread, switching at 1s intervals:\n\n```cpp\n#include \u003cstk_config.h\u003e\n#include \u003cstk.h\u003e\n#include \"example.h\"\n\nstatic volatile uint8_t g_TaskSwitch = 0;\n\ntemplate \u003cstk::EAccessMode _AccessMode\u003e\nclass MyTask : public stk::Task\u003c256, _AccessMode\u003e\n{\n    uint8_t m_taskId;\n\npublic:\n    MyTask(uint8_t taskId) : m_taskId(taskId) {}\n    stk::RunFuncType GetFunc() { return \u0026Run; }\n    void *GetFuncUserData() { return this; }\n\nprivate:\n    static void Run(void *user_data)\n    {\n        ((MyTask *)user_data)-\u003eRunInner();\n    }\n\n    void RunInner()\n    {\n        uint8_t task_id = m_taskId;\n\n        while (true)\n        {\n            if (g_TaskSwitch != task_id)\n            {\n                stk::Sleep(10);\n                continue;\n            }\n\n            switch (task_id)\n            {\n            case 0:\n                LED_SET_STATE(LED_RED, true);\n                LED_SET_STATE(LED_GREEN, false);\n                LED_SET_STATE(LED_BLUE, false);\n                break;\n            case 1:\n                LED_SET_STATE(LED_RED, false);\n                LED_SET_STATE(LED_GREEN, true);\n                LED_SET_STATE(LED_BLUE, false);\n                break;\n            case 2:\n                LED_SET_STATE(LED_RED, false);\n                LED_SET_STATE(LED_GREEN, false);\n                LED_SET_STATE(LED_BLUE, true);\n                break;\n            }\n\n            stk::Sleep(1000);\n            g_TaskSwitch = (task_id + 1) % 3;\n        }\n    }\n};\n\nstatic void InitLeds()\n{\n    LED_INIT(LED_RED, false);\n    LED_INIT(LED_GREEN, false);\n    LED_INIT(LED_BLUE, false);\n}\n\nvoid RunExample()\n{\n    using namespace stk;\n\n    InitLeds();\n\n    static Kernel\u003cKERNEL_STATIC, 3, SwitchStrategyRoundRobin, PlatformDefault\u003e kernel;\n    static MyTask\u003cACCESS_PRIVILEGED\u003e task1(0), task2(1), task3(2);\n\n    kernel.Initialize();\n\n    kernel.AddTask(\u0026task1);\n    kernel.AddTask(\u0026task2);\n    kernel.AddTask(\u0026task3);\n\n    kernel.Start(PERIODICITY_DEFAULT);\n\n    assert(false);\n    while (true);\n}\n```\n\n---\n\n## Adding STK to your project\n\n### Add using Git \u0026 CMake:\n\n#### 1. Add STK to your project using Git \u0026 CMake\n\nYou can include STK in your project using `git submodule` or by copying the source into a `libs/` or `third_party/` folder:\n```bash\n# Example: using git submodule\ncd your-project\ngit submodule add https://github.com/dmitrykos/stk.git libs/stk_scheduler\ngit submodule update --init\n```\n\n#### 2. Modify your `CMakeLists.txt`\n\nAdd the STK directory and link against STK:\n```cmake\n# In your project CMakeLists.txt\n\n# 1. Add STK as a subdirectory\nadd_subdirectory(libs/stk_scheduler/stk)\n\n# 2. Link STK into your executable or firmware target\ntarget_link_libraries(your_firmware_target PUBLIC stk)\n\n# 3. Include STK headers\ntarget_include_directories(your_firmware_target\n    PUBLIC\n    ${CMAKE_SOURCE_DIR}/libs/stk_scheduler/stk/include\n)\n```\n\n#### 3. Build\n\nRun your normal build procedure. STK will now be compiled and linked with your project.\n\n#### 4. Initialize STK in your code\n\n```cpp\n#include \"stk.h\"\n// ...\nstatic Kernel\u003cKERNEL_STATIC, 3, SwitchStrategyRoundRobin, PlatformDefault\u003e kernel;\n// add tasks, start scheduling …\n```\n\n#### 5. Testing \u0026 Simulation\n\n- Use STK’s x86 development mode for rapid development\n- Deploy to MCU when ready\n\n### Alternative Method: Copy STK directly into project files:\n\nSTK can be integrated by simply copying its source files from `stk/` folder.\n\nThis method is suitable for:\n- vendor-delivered projects (MCUXpresso, STM32CubeIDE, Keil, IAR, ...)\n- closed-source or isolated environments\n- projects without CMake or external dependency management\n\n#### 1. Copy STK folders\n\nFrom the root of STK repository, copy:\n```\nstk/\n```\n\ninto your project's source tree, for example:\n```\nyour_project/\n  src/\n  drivers/\n  libs/\n    stk/   ← copied here\n```\n\n#### 2. Add STK include paths\n\nAdd the following include path to your project configuration:\n```\nyour_project/libs/stk/include\n```\n\nIn CMake:\n```cmake\ntarget_include_directories(your_firmware_target\n    PUBLIC\n    ${CMAKE_SOURCE_DIR}/libs/stk/include\n)\n```\n\nIn GCC/Makefile:\n```make\n-Ilibs/stk/include\n```\n\n#### 4. Create stk_config.h and add it to includes\n\nFor example, for ARM Cortex-M4 project:\n```cpp\n#ifndef STK_CONFIG_H_\n#define STK_CONFIG_H_\n\n#include \"cmsis_device.h\"\n#include \"core_cm4.h\"\n\n// Undefine if MCU is Arm Cortex-M4\n#define _STK_ARCH_ARM_CORTEX_M\n\n#ifdef _STK_ARCH_ARM_CORTEX_M\n    // Redefine if SysTick handler name is different from SysTick_Handler\n    //#define _STK_SYSTICK_HANDLER SysTick_Handler\n\n    // Redefine if PendSv handler name is different from PendSV_Handler\n    //#define _STK_PENDSV_HANDLER PendSV_Handler\n\n    // Redefine if SVC handler name is different from SVC_Handler\n    //#define _STK_SVC_HANDLER SVC_Handler\n#endif\n\n#endif /* STK_CONFIG_H_ */\n```\n\n#### 5. Add STK source files to build\n\nYou must compile STK core sources from:\n```\nstk/src\n```\n\nMinimum required sources:\n```\nstk/src/stk.cpp\nstk/src/arch/\u003cyour-platform\u003e/...\n```\n\nExample (GCC, ARM Cortex-M MCU):\n```make\nSRCS += \\\n  libs/stk/src/stk.cpp \\\n  libs/stk/src/arch/arm/cortex-m/stk_arch_arm-cortex-m.cpp\n```\n\n#### 4. Build\n\nBuild your project normally — STK will now be compiled together with it.\n\n---\n\n## Test Coverage\n\n| Coverage                  | Description                                       |\n|---------------------------|---------------------------------------------------|\n| Platform-independent code | **100% unit test coverage**                       |\n| Platform-dependent code   | tested under QEMU for each supported architecture |\n\n---\n\n## Porting \u0026 Extending\n\nPorting STK to a new platform is straightforward. Platform-dependent files are located in:\n\n```\nstk/src/arch\nstk/include/arch\n```\n\nSTK's C++ OOP design allows easy extension of its functionality, for example you can develop and attach your own scheduling algorithm by inheriting `ITaskSwitchStrategy` interface.\n\n[Contributions and patches](https://github.com/dmitrykos/stk) are welcome.\n\n---\n\n## License\n\nSTK is released under the **MIT License**. \n\nYou may freely use it in:\n* commercial\n* closed-source\n* open-source\n* academic\n\nprojects.\n\n---\n\n## Additional Services\n\nContact `stk@neutroncode.com` for additional requests and services:\n\n* Dedicated license (warranty of title, perpetual usage rights)\n* Integration and consulting\n* Technical support\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmitrykos%2Fstk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmitrykos%2Fstk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmitrykos%2Fstk/lists"}