Your Watchdog Is Being Fed by the Wrong Thread

One configuration mistake keeps causing incidents in sidelink microkernels: the hardware watchdog is fed by a periodic timer callback, when it should be fed by the health monitor that can see whether messages are being processed. It passes review because the feed call sits in a tidy, well-named function, and the priority that makes it dangerous lives in a board overlay nobody diffed. When the sidelink receive path spins, the timer keeps firing and the watchdog stays satisfied. The node keeps broadcasting stale awareness messages while its heartbeat stays green.

Why review never sees it

Embedded build systems stack their configuration in layers: a base file, then SoC defaults, a board fragment and finally a product overlay, and the last layer to set a value wins. The diff a reviewer reads shows the health monitor at a sensible priority in the base file. The product overlay was written months earlier as a thermal workaround. It raised the sidelink decode thread above the monitor and turned off budget enforcement to recover a little jitter. Neither file is wrong on its own, and each passed review. The defect exists only in the merged result, which no human reads.

What should survive when the decoder spins

In a well-partitioned microkernel, a runaway decoder should be a contained event. Its partition uses up its CPU budget, the kernel preempts it, and the health monitor runs. The monitor sees that the progress counter on the decoded message queue has stopped advancing and restarts that partition. Meanwhile security, positioning and the vehicle bus gateway keep their time slots. That chain depends on three things: budget enforcement, a monitor priority strictly above the partition it supervises, and liveness based on observed progress rather than elapsed time. The timer-fed watchdog is the worst failure of the three, because it hides the other two: even a blunt reset would at least have left a log entry. Road vehicle functional safety standards such as ISO 26262 ask for exactly this independence of the monitoring channel, and configuration is where it quietly gets lost.

A check you can run today

Build the image, then inspect the merged configuration the build emits and the final thread table in the linked binary, never the fragments. On a Zephyr-based target that means the generated.config in the build directory plus the static thread definitions in the ELF. On other kernels it means the generated system description the kernel reads at boot. Write a CI script that fails the build unless three checks pass: budget enforcement is on for every supervised partition, the monitor's effective priority is higher than every thread it watches, and the disassembled image shows exactly one caller of the watchdog feed function, the monitor itself. Then run the bench test. Put a deliberate busy loop into the sidelink decode path behind a test flag, and confirm the partition restarts or the board resets within the configured 20 ms watchdog window while positioning output never pauses. The static check takes under a minute of CI time (an estimate), but the bench injection is the test that catches overlays you didn't know existed.

The decision rule is blunt: if the merged configuration cannot prove that the watchdog is fed only by the component that observes sidelink progress and runs above it, the build fails, no matter how clean the diff looked.

The cost you keep paying

Turning budget enforcement back on brings back the jitter the overlay was trying to remove. Budget exhaustion forces a context switch at the worst possible moment, roughly a few microseconds on a typical Cortex-R class core by my estimate. You can size the budget with enough headroom that it never triggers during normal decoding, at the price of capacity you paid for and rarely use. Or you can route every jitter-tuning overlay through the same merged-config gate and accept slower tuning work. Either way, someone has to own the overlay layer, because the next version of this incident will be hiding there.

Back to V2XKernel · Domains

← Back to V2XKernel
Engineering & Architecture Brief

Your Watchdog Is Being Fed by the Wrong Thread

One configuration mistake keeps causing incidents in sidelink microkernels: the hardware watchdog is fed by a periodic timer callback, when it should be fed by the health monitor that can see whether messages are being processed. It passes review because the feed call sits in a tidy, well-named function, and the priority that makes it dangerous lives in a board overlay nobody diffed. When the sidelink receive path spins, the timer keeps firing and the watchdog stays satisfied. The node keeps broadcasting stale awareness messages while its heartbeat stays green.

Why review never sees it

Embedded build systems stack their configuration in layers: a base file, then SoC defaults, a board fragment and finally a product overlay, and the last layer to set a value wins. The diff a reviewer reads shows the health monitor at a sensible priority in the base file. The product overlay was written months earlier as a thermal workaround. It raised the sidelink decode thread above the monitor and turned off budget enforcement to recover a little jitter. Neither file is wrong on its own, and each passed review. The defect exists only in the merged result, which no human reads.

What should survive when the decoder spins

In a well-partitioned microkernel, a runaway decoder should be a contained event. Its partition uses up its CPU budget, the kernel preempts it, and the health monitor runs. The monitor sees that the progress counter on the decoded message queue has stopped advancing and restarts that partition. Meanwhile security, positioning and the vehicle bus gateway keep their time slots. That chain depends on three things: budget enforcement, a monitor priority strictly above the partition it supervises, and liveness based on observed progress rather than elapsed time. The timer-fed watchdog is the worst failure of the three, because it hides the other two: even a blunt reset would at least have left a log entry. Road vehicle functional safety standards such as ISO 26262 ask for exactly this independence of the monitoring channel, and configuration is where it quietly gets lost.

A check you can run today

Build the image, then inspect the merged configuration the build emits and the final thread table in the linked binary, never the fragments. On a Zephyr-based target that means the generated.config in the build directory plus the static thread definitions in the ELF. On other kernels it means the generated system description the kernel reads at boot. Write a CI script that fails the build unless three checks pass: budget enforcement is on for every supervised partition, the monitor's effective priority is higher than every thread it watches, and the disassembled image shows exactly one caller of the watchdog feed function, the monitor itself. Then run the bench test. Put a deliberate busy loop into the sidelink decode path behind a test flag, and confirm the partition restarts or the board resets within the configured 20 ms watchdog window while positioning output never pauses. The static check takes under a minute of CI time (an estimate), but the bench injection is the test that catches overlays you didn't know existed.

The decision rule is blunt: if the merged configuration cannot prove that the watchdog is fed only by the component that observes sidelink progress and runs above it, the build fails, no matter how clean the diff looked.

The cost you keep paying

Turning budget enforcement back on brings back the jitter the overlay was trying to remove. Budget exhaustion forces a context switch at the worst possible moment, roughly a few microseconds on a typical Cortex-R class core by my estimate. You can size the budget with enough headroom that it never triggers during normal decoding, at the price of capacity you paid for and rarely use. Or you can route every jitter-tuning overlay through the same merged-config gate and accept slower tuning work. Either way, someone has to own the overlay layer, because the next version of this incident will be hiding there.

Related Architecture Specifications (AUTOMOTIVEV2X): v2xtelemetry.com · v2xstack.com · v2aix.com

More Technical Articles on v2xkernel.com

Evaluating Inter-Process Communication (IPC) Throughput in Multi-Core Automotive Microkernels →Deterministic Dynamic Memory Allocation: Eliminating Heap Fragmentation in V2X Routers →The Watchdog That Kept Petting a Dead Sidelink Stack →Catching Sporadic Server Budget Mismatches in Sidelink Microkernels Before Deployment →