Embedsys Weekly #139 is out, and it opens with 24 KB of pure assembly: a whole operating system whose only job is to run an LLM.
It boots in under 100 ms. No Linux, no libc, no C, no Rust.
Also in this issue:
- two typos in 8-bit firmware that hid inside the Wii U's GPU for 13 years
- a $3 Arduino Nano that reads a 1994 Jeep's engine computer
- a passive USB sniffer made from a Pico and two resistors
- Orthodox C++, a subset that reads like a firmware coding standard
- Memory Safety for Skeptics, for C developers tired of the debate
- a 1977 pinball flipper that cuts its coil current 10x with no transistor
- TinyGo 0.45.0, its biggest release so far
A warm welcome to the 750+ of you who followed Embedsys since the last issue.
From the bench: I bought https://t.co/jjngdsdSIj, a free site to share your real, messy workbench. Send me yours.
Which one will you read first?
https://t.co/1QFIWX1pYV
Before designing the 6809, Motorola's architects counted the instructions in 25,000 lines of 6800 code. Then they explained every choice in BYTE, in a 1979 series titled "A Microprocessor for the Revolution: The 6809".
Terry Ritter and Joel Boney, the chip's co-architects, wrote it in three parts.
What the data told them:
• loads and stores were 38% of all instructions
• 93% of index offsets were 0 or under 32
• so they added richer indexed modes, auto-increment, a second index register and a user stack, and remapped the opcodes. Programs shrank to one half to two thirds of their 6800 size
They also took the draft spec to about 30 customers, including some known to be hostile to the 6800. Most said source compatibility was enough, which freed the opcode map.
Part 2 is my favorite: a Q&A defending what they left out. No block moves. No bit manipulation: "Are you really willing to pay 10 to 20 percent more just for bit manipulation?" No undefined-opcode trap, because the unused opcodes were "don't cares" that shrank the logic. The reproduction page notes that almost every missing feature they listed later showed up in Hitachi's 6309.
Their stated goal was to cut software cost, with position-independent code and ROMs that work in any system. It still reads like a modern argument.
Thank you Grant Beattie for sending it to me by email!
Which of their trade-offs would you make differently today?
https://t.co/Z1Br1lexPV
An 8-bit counter that covers the range of a uint32_t. The trick: store a tiny floating point number and increment it at random.
The article revisits Robert Morris's 1978 approximate counting algorithm, then a 2009 paper by Miklós Csűrös that replaces the pure logarithm with a binary log-linear counter.
The author's C implementation is short:
- 5 exponent bits and 3 mantissa bits, packed in an unsigned _BitInt(8)
- small counts stay exact, like denormals in IEEE 754
- the increment probability halves with each exponent step, decided by ffsll() on one random word
- when the mantissa overflows, it rolls into the exponent with no special case
What I like most is the trade-off discussion. Morris lets you tune range and precision smoothly, but needs a lookup table that grows with wider counters. Csűrös gives you lumpy choices of range, a bit like picking between uint32_t and uint64_t, for a few instructions and no table.
For embedded work, this belongs in the toolbox: event counters and statistics in a few bytes of RAM on a small MCU. The cost moves elsewhere. You need a random word per event, so the RNG becomes part of your budget.
Nice use of C23 _BitInt too.
Where would you trade exactness for bytes in your firmware?
https://t.co/Q95g4ERXjK
Someone got Doom running on a Xiaomi air fryer. An air fryer.
I challenge you to find a more absurd port.
@ID_AA_Carmack I think we've crossed a line
https://t.co/t6obtF4CoA
This 1950s resistor hides a hollow glass tube and two metal plungers. Its value was likely set by how deep the plungers went in.
CuriousMarc found it in a Metrix tube oscilloscope after a restoration. The carbon resistors above 100k had drifted high and were all replaced. The low values spot-checked fine and stayed. Then a vertical instability appeared, and the culprit was a 20k resistor now reading 843k, with no visible damage.
So Marc sanded it in half, on TubeTime's advice. Expected: a blob of carbon between two leads. Found: a resin envelope, a glass tube with a resistive coating inside, and a conductive plunger at each end, crimped in place.
The failure was the contact between the plungers and the tube. Wiggling them during sanding brought it back to 111k, then 300k. Still dead, but it explains everything.
A perfect-looking part with an intermittent contact inside. Spot checks only prove the parts you measured.
Would you have replaced every resistor in that scope?
https://t.co/Xiezog4vcu
This bootloader can verify post-quantum signatures today. microtun boot already verifies FN-DSA-512 on every boot, on the ESP32-C3, C5, C6 and the RP2350 (Pico 2).
It is a secure boot bootloader written in Rust. It reuses MCUboot's on-flash formats: image header, TLVs, trailer. It authenticates the application before starting it, finishes any pending upgrade, and never boots an image that fails verification.
What it supports:
- swap-using-scratch with revert and power-fail resume
- overwrite-only and direct-XIP
- downgrade prevention and a minimum version
- a hardware security counter for anti-rollback (temporarily disabled on the ESP32-C5)
I like the testing setup. A full regression suite runs under QEMU, and a hardware-in-the-loop crate flashes complete boot chains on real boards.
Now the caveats, and the README is honest about them. The signature profile is experimental, based on the FIPS 206 draft. Stock MCUboot and imgtool can't sign or verify these images. Encrypted and compressed images are rejected. The license is PolyForm Noncommercial, which makes it source-available. Commercial use needs a separate agreement.
So it's a prototype to study before anything goes into a product. Reusing MCUboot's formats is a smart way to keep the migration path familiar.
How soon do you expect post-quantum signatures in MCU secure boot requirements?
https://t.co/vX7rDQPTCi
Guys, how would you consider agent reading FPGA timings off the console, printed with ASCII?
A nifty feature? Or it's just me having too much time on my hands...?
#Xilinx#mcp#FPGA