Blog
Selected articles
-
Bugs? Rebuild it from a contract. Case study.
Bugs are found in software faster than ever. Formal methods promise a solution, but for problems that are undecidable, they cannot help. Solution? Make software from decidable primitives only. I wrote a ZeroTier client and it resulted in a surprising boost in performance, too.
-
zephyr-codeplace: caching beyond limits
When your code is larger than cache, careful selection of what to evict can improve overall performance 7x
-
Legal research with LLMs: the prompts and harnesses
Public prompts, source code and evaluation methods for legal defect research. A short guide, source table and linked report distinguish simulated rule systems, planted defects and findings about existing law.
-
Defending hostile overload of small devices with Zephyr
When a small USB network experiences hostile overload attempt, should it drop the data or answer NAK? Dense measurements with error bars on three CPUs.
-
ZeroTier VPN on a microcontroller
ZeroTier VPN node runs on a Teensy 4.1 under Zephyr, fully compatible with public ZeroTier nodes. No more excuses for lack of security for tiny devices.
The long tail
-
Teensy 4.1 and Zephyr USB networking: ten times faster from the same chip
The Teensy 4.1 runs Zephyr from external flash through a 32 KB cache, and the USB network path does not fit. With the hot code in the unused 128 KB ITCM and some tuning, the board answers 22,000 UDP echoes per second instead of 2,260.
-
Raspberry Pi Pico and Zephyr USB networking: fixing the flash cache problem
Layout alone halves the time per ping on the Raspberry Pi Pico, but one echo uses more code than its 16 KB flash cache holds. About 16 KB of well-chosen functions in SRAM plus a cache-aware layout gives 2,250 UDP echoes per second instead of 322.
-
Raspberry Pi Pico and Zephyr USB networking: the code waits for its own flash
The Raspberry Pi Pico answers USB network echoes four times slower than an STM32F3 at a lower clock. Clock scaling, on-chip probes and the XIP cache counters show why: about 2300 cache misses per echo. Code in SRAM is four times faster; a better flash layout is the next step.
-
Zephyr USB CDC NCM investigation
When the network stack has no free receive packet, the Zephyr USB network drivers stop the whole USB device. Measurements on a Teensy 4.1, an STM32F3DISCOVERY, a Raspberry Pi Pico and six emulated CPUs, before and after each fix.
-
A lock-up in the Zephyr USB network driver, and a two-line fix
Under load, the Zephyr USB Ethernet driver (CDC-NCM) could stop the whole USB device until a reset. We found the cause on a Teensy 4.1 and offer a two-line fix to the Zephyr project.
-
SNMP on Zephyr: zephyr-snmp works on a Teensy 4.1
We tested the simpleiot/zephyr-snmp agent (SNMP v1/v2c) on a Teensy 4.1 with Zephyr v4.4.2, over Ethernet over USB. Walk, get, set, error replies, agent restart and traps all work. We filed two small issues upstream.
-
RAM and flash cost of Zephyr services on a Teensy 4.1
What does Ethernet, MQTT, TLS, SNMP, CAN, USB or LVGL cost on a small Cortex-M7 board? 305 clean builds of a Zephyr reference app measure the flash and static RAM of 279 services, one at a time and in typical combinations. Main result: flash is not the limit; RAM is. A managed connected device with DHCP, DNS, SNTP, mDNS, MQTT over TLS, an HTTP REST server and SNMP uses 3.6% of the 8 MB flash, but half of the default 256 KB RAM region.