
Miro Samek (@QL)
Can an RTOS be really real-time?
Real-Time Operating Systems are meant for real-time applications. But with conventional shared-state concurrency and blocking, can you honestly know the worst-case execution time of an RTOS thread?
Blocking == Technical Debt
Blocking code in embedded systems trades quick development for long-term pain, effectively becoming technical debt. This post shows how blocking in Arduino examples and traditional RTOS threads hard-codes sequences and timing, making change and extension expensive. It contrasts blocking kernels with preemptive non-blocking approaches and recommends event-driven Active Objects and frameworks like QP as more scalable alternatives.
Are We Shooting Ourselves in the Foot with Stack Overflow?
Most traditional, beaten-path memory layouts allocate the stack space above the data sections in RAM, even though the stack grows “down” (towards the lower memory addresses) in most embedded processors. This arrangement puts your program data in the path of destruction of a stack overflow. In other words, you violate the first Gun Safety Rule (ALWAYS keep the gun pointed in a safe direction!) and you end up shooting yourself in the foot. This article shows how to locate the stack at the BEGINNING of RAM and thus point it in the "safe" direction.
NULL pointer protection with ARM Cortex-M MPU
This post explains how you can set up the ARM Cortex-M MPU (Memory Protection Unit) to protect thy code from dragons, demons, core dumps, and numberless other foul creatures awaiting thee after thou dereference the NULL pointer.
Patterns of Thinking: Metaphors in Programming
Why do some programming ideas click while others confuse engineers? This post shows that the metaphors you choose — from biological classification for inheritance to a “quantum” analogy for hierarchical state machines — shape how developers learn, design, and communicate. It also explains the surprising power of anthropomorphic (“naïve psychology”) language in team discussions and gives practical cautions about when metaphors help or mislead.
Embedded Programming Video Course Shows How OOP Works Under the Hood
Want to see how OOP actually maps to machine level code? This free video course walks through encapsulation, inheritance, and polymorphism with hands-on comparisons between C and C++. You will inspect C implementations, compiler-generated code, and debug traces, and learn how encapsulation relates to RTOS concurrency. The polymorphism lesson reverses the usual order to expose runtime costs and previews implementing polymorphism in C.
Embedded Programming Video Course Teaches RTOS
From basic foreground/background loops to priority-inheritance protocols, this free video course walks you through building and improving an RTOS step by step. Lessons cover manual context switching, round-robin and preemptive priority schedulers, efficient thread blocking, and synchronization primitives. The series finishes with a practical port to a professional RTOS in the QP/C ecosystem, showing semaphores, mutexes, and ways to prevent priority inversion.
Embedded Toolbox: Source Code Whitespace Cleanup
Trailing whitespace and mixed end-of-line conventions can silently break preprocessing or bloat diffs, yet they are invisible in editors. QClean is a tiny, blazingly fast CLI utility that removes trailing spaces, normalizes EOLs, replaces tabs with spaces, and optionally flags long lines. It runs cross-platform or as a native binary in qtools/bin and is easy to customize and rebuild for your workflow.
Embedded Toolbox: Windows GUI Prototyping Toolkit
You can prototype and debug complex embedded device user interfaces on Windows using the tiny, free QWin toolkit. It runs the same C code you compile for the target by implementing a Windows BSP, letting you develop UI code quickly with MinGW or Visual C++ and a visual resource editor. The result is far faster compile-run-debug cycles and a simpler path around flaky prototype hardware.
Embedded Toolbox: Programmer's Calculator
A tiny but powerful cross-platform tool, QCalc evaluates full C-syntax expressions so you can paste results straight into firmware. It handles bitwise ops, mixed hex/decimal/binary constants, and scientific math, and it automatically shows integer results in formatted hex and binary. The post explains key features, variable handling, error messages, and how to run qcalc.tcl with the wish Tk interpreter.
Modern Embedded Systems Programming: Beyond the RTOS
Blocking-based RTOS tasks make embedded systems brittle and hard to extend, this post argues, and presents a practical alternative: active objects organized as message pumps. It explains why one-blocking-call tasks and nonblocking event handlers improve responsiveness and reduce task proliferation, and recommends using frameworks plus hierarchical state machines and UML to enforce good architecture and make designs scalable.
Cutting Through the Confusion with ARM Cortex-M Interrupt Priorities
ARM Cortex-M interrupt priorities are famously confusing because numeric priority values are inverted relative to urgency and several different conventions coexist. This post cuts through the mess by explaining NVIC register bit placement, the CMSIS NVIC_SetPriority convention, preempt versus subpriority grouping, and when to use PRIMASK or BASEPRI. Read on for practical rules to avoid subtle priority bugs in real-time firmware.
Use this form to contact QL
Before you can contact a member of the *Related Sites:
- You must be logged in (register here)
- You must confirm you email address







