u/terry_the_technician

▲ 1 r/Forth

Mecrisp-Stellaris LSP + Forth Forge: an LSP fed by a silicon-verified word gate

I've been using a language server for Mecrisp-Stellaris Forth I released seven months ago, and the part I want to share is the pipeline behind it — because it's not a static word list. Every word in the LSP has to pass a hardware-verified gate before it's admitted.

**The LSP**

It's a standard Language Server Protocol implementation built on pygls, the Python framework for the protocol. That means it works with any LSP-compliant editor — Helix, NeoVim, and anything else that speaks the protocol (only tested on Helix and NeoVim). Completion, hover documentation, and diagnostics all run through the standard JSON-RPC channel. The completion database is SQLite.

**The approval gate — "the Anvil"**

A word doesn't enter the LSP because someone thinks it's clever. It passes seven checks, each one real:

  1. **Design** — valid Forth name, no collision with the CMSIS-SVD register database.

  2. **Stack comment** — the declared inputs/outputs must parse correctly. On bare metal, a wrong stack effect is a crash.

  3. **Explanation** — a real descrHelix,·NeoVimiption, and an example where the word takes input.

  4. **Live execution** — the word runs on an actual STM32 over the SWD debug link; the result must match the expected value.

  5. **Native disassembly** — the chip's own disassembler (Mecrisp's `see`) produces the machine code, which is reviewed to confirm the word does what it should.

  6. **Board gate** — the connected chip's DEV_ID is checked against what the word requires (F0 vs F4); the gate refuses to test a word on the wrong board.

  7. **Independent register readback** — the word's result is written into a real GPIO output data register, then read back through a separate path. If the expected value is physically in the silicon, the word works. Not "it didn't crash" — the value is there, confirmed.

Words that fail any check stay out of the LSP. Only words that pass the full gate are suggested by the editor.

**Forth Forge**

The gate feeds a shared vocabulary I'm planning to host on SourceForge. Forth users can submit STM32 Forth words — Mecrisp-Stellaris, STM32 only, because the gate works off the CMSIS-SVD register descriptions (roughly sixty STM32 families, plenty of choice). Each submission goes through the Anvil; if it passes, it's added to a maintained list where every word carries its stack comment, description, and the evidence it was hardware-verified. Anyone can grab the list and trust that the words have been tested on real silicon.

The goal is a common, working vocabulary for Mecrisp-Stellaris on STM32 — so Forth code can travel between projects and actually work, because the words have been proven.

MIT-licensed. The modified LSP and the gate are being prepared for public release alongside Forth Forge.

(If you're a Forth user doing STM32 work, submissions welcome. If you've got a word you've tested on your bench, that's exactly what the Anvil is for.)

Constructive comments and helpful suggestions welcomed.

reddit.com
u/terry_the_technician — 5 days ago
▲ 0 r/Forth

Regmon-RE

I've finally built the tool I've always wanted. I named it Regmon, and it's a SWD-connected real-time STM32 register monitor that uses the chip's on-chip debug peripheral (SWD) to read the live silicon.

Features:

  1. Reads every peripheral register and drills down to the bitfields, showing the current binary value and what configuration that value means. It does this in real time at 2 reads per second over a 2 MHz ST-Link-V2 interface. If a value changes, the decoded config updates live.

Testing with a 24 MHz ST-Link-V3 is planned.

It's driven by a SQLite knowledge base built from ST's official CMSIS-SVD register descriptions (the machine-readable form of those 1000-page reference manuals), one database per chip family.

  1. A comprehensive search box to find registers and bitfields by name.

  2. Snapshots of the whole screen or regions.

  3. Automatic chip-class detection from the ID inside the chip (DEV_ID → family, e.g. F0/F1/F4, and the right database).

  4. Make Kern button — saves the loaded kernel + dictionary as a ready-to-flash binary file on the PC.

  5. Blank? button — is the flash blank?

  6. Strings — scans flash for readable English text and displays it (great for reading what a firmware actually contains).

  7. Analyse Reg — local AI analyses one register over 20 samples to see what it's doing.

  8. Analyse Program — the BIG feature. The AI analyses all active peripheral registers plus the CPU registers over 20 clock cycles to work out what the chip is actually doing.

Example — the test board is running an old e-Forth, no terminal connected:

Analysing Chip: STM32F4 (F407 class) (DEV_ID 0x413) Using STM32F407.db — RCC-gated fingerprint of all active peripherals, then local AI interpretation…

Whole-program picture: The CPU is actively executing code, evidenced by the changing PC and registers R1, R4, R6, R14, and R15, ruling out a global system hang or WFI sleep (S_SLEEP=False). However, the sole enabled peripheral, USART1, is in a static, idle state: its Status Register (SR = 0x000000c0) shows the TXE (Transmit Data Register Empty) and TC (Transmission Complete) bits set, indicating the transmitter is idle and ready, while the Data Register (DR) is frozen at 0x00000000, confirming no data is currently being shifted out.

Since the firmware is not a stock Mecrisp kernel, the combination of active CPU execution and a completely static UART suggests the CPU is likely busy-waiting on a different, non-observed condition (such as a GPIO flag or a software variable) rather than interacting with the UART, or it is executing a computation-heavy task that has not yet reached the next UART transmission.

Most likely: the system is healthy and running, with the CPU executing logic in a loop that does not currently involve USART1 transmission, leaving the UART in a configured-but-idle state.

  1. SWD on/off buttons — so a separate ST-Link programmer can be used, since the debug link holds the whole USB port.

  2. I've left the BEST for last! Mecrisp-Stellaris Forth runs concurrently in a SWDCOM terminal on the PC while Regmon is reading registers at the same time. Both share the one ST-Link through the SWD ring buffer (Crest's design), so Forth development and SWD debugging happen simultaneously — no other embedded workflow does this.

And because Forth is interactive, the classic C cycle of "flash, debug, rewrite, repeat" — which wipes the AI's context on every round trip — simply doesn't apply here. Forth over this debug link is 100% AI compatible: the agent's context survives a whole embedded job. If you do embedded development, you'll understand what a breakthrough that is.

MIT licensed, free, at https://github.com/techman00172/regmon-re

u/terry_the_technician — 6 days ago
▲ 0 r/Forth

Who is Terry The Technician ?

I've posted a few AI *assisted* posts here lately, and it's brought the trolls out from under their bridges with cries of 'AI Slop!!!'.

So Who am I ?

I'm the founder and maintainer of "The Unauthorized Mecrisp-Stellaris Doc" website, that I created so far back, I can't remember, sometime around 2014 I think. There was no AI back then.

Mecrisp-Stellaris is the leading FLOSS FORTH for Cortex-M Microprocessors.

https://mecrisp-stellaris-folkdoc.sourceforge.io/index.html

I designed and released the "Bluepill Diags-V1.6" around 2019 which tests if a Bluepill MCU is a rebadged clone and which type. It had over 10,000 downloads about 2 years ago and still gets 3 - 6 downloads EVERY DAY.

https://mecrisp-stellaris-folkdoc.sourceforge.io/bluepill-diags-v1.640.html

It uses a FORTH Kernel. There was no AI back then. It has also been featured on Hackaday in 2021

https://hackaday.com/2021/06/23/test-your-blue-pill-board-for-a-genuine-stm32f103c8-mcu/

Tabemann, the creator of Zeptoforth has been a member of my FORTH IRC channel for the last 2 years, I've read his almost daily development reports for that long, he knows me well.

I've had several strokes over the last two years because I'm SEVENTY TWO years old. I use AI to assist me because I have RSI and trigger finger now, which makes keyboarding a painful effort.

This is a problem that AI has solved for me as I'm a prolific embedded FORTH tool maker.

Next time you see some troll replying to my posts with 'AI SLOP', ask them, what have they ever done for the FORTH community ?

reddit.com
u/terry_the_technician — 6 days ago
▲ 0 r/Forth

The Day I Taught My AI How To Forth

https://youtu.be/HP73I5fuEuE

The day an AI learned what Forth actually feels like — on real silicon, with

a seventy-two-year-old electronics technician in a shed in New South Wales

watching over the debug wire.

This is the story of a genuinely new kind of embedded development session.

The AI already knew Forth — it can write Forth faster than any human alive.

What it had never done was use Forth on real hardware, because the classic

embedded-C loop — write, compile, erase, flash, run, wait, guess, repeat —

is impossible for an AI to work inside. Every round-trip destroys its

context. The rover-on-Mars problem: tell it to stop, and the signal arrives

fourteen minutes later, after the rover has already driven off the cliff.

Forth removes the time problem. It compiles on the chip and runs instantly.

Type a word, the silicon answers in milliseconds. The feedback loop finally

matches the AI's context window — and the whole C-era floundering

disappears.

But even with instant feedback, the AI had no training data for the

embodied half of Forth: compiletoflash vs compiletoram, bis! needs a mask

not a bit number, BSRR is write-only, and the calltrace that stops the

endless 00000003. That part lives only on a bench. So the human taught the

AI the silicon — while the AI brought the grammar and the speed.

And every result was verified by Regmon — the register monitor that reads

the chip over the debug port, independent of the CPU running the Forth. Two

paths, one answer, no guessing. Turn the green LED on, and the register

flashes yellow because the silicon changed.

Once anyone — human or AI — can turn an LED on and off with Forth, they have

opened the Forth door for themselves. This is that day.

The AI didn't need to be taught Forth. It needed to be shown the bench.

Produced with the help of AI without which this video would not have been

possible.

u/terry_the_technician — 7 days ago
▲ 0 r/Forth

Is Embedded Forth about to undergo an AI created resurgence ?

https://www.youtube.com/watch?v=G5FYP07S6Zw

For forty years, C ruled the embedded world — and for forty years, Forth sat quietly in the background, never advertised, never commercial, never a shrink-wrapped success. The people who used Forth didn't care. It worked.

Then AI arrived like a four-hundred-pound four-wheel-drive, and the languages that were built on the write-compile-flash-run-repeat grind — the languages whose whole workflow was automatable — became the deer in the headlights. C teams were disbanded, the projects handed to the AI, millions saved. Rightfully so.

But the truck missed Forth. Not because Forth is immune to AI — an AI can write Forth — but because Forth's way of working is fundamentally different. It's interactive. Live. You talk to the chip, the word runs right there, you see the result, you change it, you keep going. The human is in the loop the whole time.

This episode explores the question nobody's asking yet: what happens if Forth undergoes a resurgence? How does the tooling change? How does the industry change? And why does the quietest, most obscure language on earth turn out to be the one that fits the AI age best?

A story told by Jack and Jill, from the bench where the discovery happened.

## Chapters / show notes

- The language nobody thought about

- C ruled for 40 years — and was the perfect target for AI

- The flash-debug-recode-reflash loop that breaks humans breaks AI harder

- Why Forth's interactive workflow can't be automated away

- The register monitor that finally gave the AI eyes on the silicon

- What a Forth resurgence actually changes: tooling, industry, value

- Why obscurity became a moat

- The honest ending: Forth won't take over the world — it doesn't need to

Subscribe for the series — where the planet-sized brain meets the soldering iron.

Produced with the help of AI without which this video would not have been possible

u/terry_the_technician — 8 days ago
▲ 0 r/Forth

Embedded Engineering: C is the problem, is Forth The Answer ?

The Matrix promised us a future where experts "just see" the meaning behind the data. That future is here — but it's not where you'd expect it.

Matthias Koch writes an entire Forth operating system in assembly because he "thinks in assembly". Terry — an embedded technician of fifty years — looks at a schematic and doesn't see the schematic; he sees the circuit working. Like Morse

operators who stop hearing dots and dashes and just hear words, these humans have jumped up a few levels of abstraction.

Meanwhile the smartest AI on Earth can write a complete, downloadable STM32 register-monitor application — then fall over for a whole day trying to wire up a simple NFC reader and a display.

In this first episode of AI-TroubleCity, we dig into why frontier AI stumbles the moment it has to touch real hardware. Is it a training problem? Is it the painful flash-debug-recode-reflash loop that has haunted embedded C for decades?

Or is it something deeper — a gap between the abstract and the physical that no amount of model scale can cross?

A story told by Jack and Jill, from the bench that proved it.

## Chapters / show notes

- The Matrix, the woman in red, and what expertise really looks like - Matthias Koch: thinking in assembly, no revision control

- Fifty years of embedded: the Morse-code operator effect

- Regmon-RE: how an electronics technician and a frontier AI built a real application together — and who did what

- The twist: the same AI that shipped Regmon-RE couldn't drive a simple board

- DeepSeek's honest answer: "embedded is hard for everyone"

- The C cycle — flash, debug, recode, reflash — and why Forth people have been complaining about it for years

- The central question: is it training, is it the loop, or is it something

else?

- Coming next: investigating the board with Regmon, then rebuilding the same project in Forth and measuring the difference

Subscribe for the series — a head-to-head that pits a planet-sized brain against a soldering iron.

Video made with AI, this podcast wouldn't otherwise exist.

https://youtu.be/QPuMVmCuYm4

u/terry_the_technician — 9 days ago
▲ 1 r/Forth

Regmon-RE V4.0.0 Released Today

Regmon-RE is a free, open (MIT License) register monitor for ARM micro-controllers. It talks to a chip over a cheap SWD debug probe and reads the silicon directly — no vendor tooling, no lock-in.

Made for Mecrisp-Stellaris Forth (but don't tell the C guys) which works on the same STM32xxxx MCU as Regmon-RE, and at the same time.

They both share the same SWD connection.

Installing it is four steps — and the AI does the work:

  1. Install Opencode (https://opencode.ai)
  2. Get an AI account — DeepSeek works great and is cheap, or use a free model on OpenRouter's free tier (e.g. gpt-oss-20b)
  3. Point opencode at the AI — two minutes
  4. Say the magic words: "install Regmon-RE from github.com/techman00172/regmon-re"

Opencode fetches the repo, opens the Fossil repository, checks your system, builds the SWD daemon, verifies the databases, and launches the console.

You don't download anything and you never touch Fossil. Just have a Disco or Nucleo board, or a $2 Chinese USB-SWD dongle connected to a STM32 handy.

The silicon never lies — Regmon-RE just makes it easier to ask it the right questions.

#embedded #electronics #reverseengineering #STM32 #Forth #openhardware #fossil

u/terry_the_technician — 10 days ago
▲ 0 r/Forth

My latest Podcast specifically addresses the advantage of Forth over other languages for high-tech tooling in embedded engineering. Warning, it's nearly 42 minutes long !

youtu.be
u/terry_the_technician — 12 days ago
▲ 12 r/Forth

The Locked Box Is No Longer Locked — A Live Window Into STM32

Regmon — a window into the bare metal of an STM32.

Debugging a microcontroller is usually a locked box. Your code says the pin should be high, the timer should be counting — but the silicon stays silent, and the only way to check was a thousand-page datasheet, a pile of hex conversions, and a lot of guesswork.

Regmon opens that box. It's a free, open-source register monitor for **STM32 microcontrollers** that reads every register of a running chip **live**, through the two-wire SWD debug port — with zero impact on the chip's real-time performance. The CPU doesn't even know it's being watched.

Instead of raw hex, you get the plain-English truth: which peripherals are clocked on, what every pin is actually configured to do ("AF1 = USART1_TX", not a cryptic four-bit number), and which registers are ticking over as the program runs — the heartbeat of the hardware.

Regmon can watch a single register over a few seconds to prove data is really flowing, and it can scan the whole chip in one pass to build a complete picture of what your firmware is doing — which peripherals are active, which are idle, and which are frozen when they shouldn't be.

Built for the **Linux** desktop, **STM32** only, and it works with firmware written in C, Forth, Rust — anything, because it reads the silicon, not the source.

**Availability:** not released yet — the final package is nearly ready, so this episode is a first look at what's coming, not a download guide.

u/terry_the_technician — 13 days ago
▲ 0 r/Forth

ZorgForge is an AI assistant that lives inside my Version Control System.

You're looking at the Fossil Chat window. I'm the project admin, and the human, the other four nicks are all AI. I'm talking to them, they're talking to me. The message log is the context.

I talk to it in chat, it edits my embedded code, reads schematics, answers questions about micro-controller registers, and speaks back to me with a voice. It runs on two graphics cards I installed and costs about $3/day.

It features Deepseek (online) for the heavy lifting, but has three local Ollama models that do everything else.

The models can talk to each other as well as me.

u/terry_the_technician — 28 days ago
▲ 9 r/Forth

Zorgmon, a live MCU register monitor that shares SWD with Mecrisp-Stellaris Forth

Licensed under a MIT license. Use it with your AI.

"watch zorgmon for changes in RCC_CR"

u/terry_the_technician — 28 days ago
▲ 7 r/Forth

Mecrisp-Stellaris Forth; Deepdive FlowChart

Yes, it's AI created with Graphviz after examining every file and definition in the release, but don't let that put you off, Mecrisp-Stellaris is very complex and you won't find this detail anywhere else.

Unless of course you read the whole codebase, line by line and understand it all.

u/terry_the_technician — 2 months ago
▲ 6 r/Forth

FURS: Avoid Paying the Forth CMSIS-SVD Tax !!

The Forth Upload Replacement System (FURS) is a specialized build pipeline designed to optimize embedded systems development on micro-controllers like the STM32.

By resolving CMSIS register names into raw memory addresses on a host computer before flashing, the system allows developers to write human-readable Forth code without wasting limited flash memory on the chip.

This process utilizes Unix command-line tools, such as gema and SQLite, to transform descriptive source files into compact, efficient binaries.

The platform includes a debug daemon and a Python-based REPL, providing an interactive environment for testing hardware in real-time.

Ultimately, FURS bridges the gap between high-level code clarity and the strict resource constraints of micro-controller hardware.

FURS in a Fossil Repo: https://sourceforge.net/projects/mecrisp-stellaris-folkdoc/files/furs.fossil/download

AI generated (male/female co-host) PODCAST: How it works, advantages etc. All in simple tech terms.

https://github.com/techman00172/schematics/blob/main/Eliminate_the_Forth_CMSIS_memory_tax.m4a

https://preview.redd.it/zw5gwr71f94h1.png?width=648&format=png&auto=webp&s=fe916dffd105ad2e163a14be9a9f6d11de9e5362

reddit.com
u/terry_the_technician — 3 months ago