SuperTinyKernel (STK) - lightweight embedded multi/single-core multithreading for NXP Cortex-M MCUs

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SuperTinyKernel (STK) - lightweight embedded multi/single-core multithreading for NXP Cortex-M MCUs

826 Views
neutroncode
Contributor I

Hi NXP Devs!

Not really a question here. I would like to introduce a thread scheduling library - SuperTinyKernel (STK).

Its GitHub repo: https://github.com/dmitrykos/stk

You can check capabilities in detail on GitHub but briefly STK can:

  • Soft and hard real-time support: STK supports cooperative scheduling for “soft real-time” tasks, you can also enable hard real-time mode (KERNEL_HRT) for periodic tasks with guaranteed deadlines.
  • Static and dynamic tasks: Define all tasks at startup (KERNEL_STATIC) or allow tasks to be created and destroyed at runtime (KERNEL_DYNAMIC).
  • Low-power friendliness: STK puts MCU into a low-power mode when there are no runnable tasks (task calls Sleep).
  • Tiny footprint: Minimal C++ abstractions (no STL, no heavy namespaces) keep the kernel small and simple.
  • Portability: Supports any ARM Cortex-M MCU.
  • Multi-core support: Fully implemented for Cortex-M and RISC-V.
  • x86 development mode: Compile & debug your code on a PC before flashing to the MCU, which helps with early testing and unit tests.
  • Open-source License: MIT: Open for commercial, closed-source, open-source - your choice.

There are ready to use MCUXpresso examples for NXP K26/K66 MCU (FRDM-K66F dev board) and i.MX RT105 (IMXRT1050-EVKB dev board): https://github.com/dmitrykos/stk/tree/main/build/example/project/nxp-mcuxpresso

Any questions? Please ask, also you are welcome to participate in STK's GitHub repository.

0 Kudos
Reply
1 Reply

343 Views
neutroncode
Contributor I

Since the initial post there was an active development happening on STK and it has grown to a more convenient tool for embedded development, so wanted to highlight the progress:

  • Scheduling strategies: Besides existing Round-Robin (RR) new scheduling strategies were added: Fixed-Priority (FP, similar to FreeRTOS), Smooth Weighted Round-Robin (SWRR), Rate-Monotonic (RM), Deadline-Monotonic (DM), including Worst Case Reaction Time (WCRT) analysis, Earliest Deadline First (EDF), custom (via ITaskSwitchStrategy). It is probably the only open-source scheduler that has such a rich set of scheduling strategies.

  • Synchronization API: Besides CriticalSection there is a set of synchronization primitives now: SpinLock, Mutex, Event, ConditionVariable, Semaphore, Pipe primitives for inter-task, inter-core synchronization. Synchronization is optional via KERNEL_SYNC kernel mode, so it does not bloat FLASH/RAM.

  • Traceability: STK now supports tracing of tasks scheduling with a SEGGER SystemView.

  • C interface: For C-only projects STK got a fully-featured C interface.

If there are any questions, please ask!

0 Kudos
Reply