Changelog¶
Unreleased¶
- Raspberry Pi Pico 2 W, an early port:
--target pico2wbuilds, flashes and runs a program over the board's USB port, with no BOOTSEL button to hold. It runs the Goose samples that fit its 520 KB of RAM, threads included, and stops a program at the first store past a data stack's end (MPU guards, as on the H7).import mcu;works there as on the other boards: GPIO, ADC (captures paced by the ADC itself, up to 500 kHz), PWM, UART, I2C, SPI, pin and timer interrupts, the chip's temperature and its hardware random numbers. The RP2350 has no DAC or CAN, so those calls return their "none" values. It has no WiFi yet. See Boards and the hardware API. - Two fixes to the Pico 2 W port, found by running the benchmark suite on it:
- A program whose contained workers abort no longer ends at a FreeRTOS
assertion (
event_groups.c). The SDK's lock roundmallocis off: FreeRTOS waited for it with its scheduler suspended, which it forbids, when a task that held it had been switched out. The port's own lock already keeps allocations one at a time. microgoose monitorrestarts a running program. The port fed its watchdog at every tick, which also put off the restart picotool asks for, so the monitor said the board didn't answer.
- A program whose contained workers abort no longer ends at a FreeRTOS
assertion (
- Benchmarks on the Pico 2 W: MicroGoose and C, 5 boots each, are on the
results page, in the chart
of MicroGoose against C and in the README's table. Every result matches
C's. MicroGoose takes 1.02 to 1.52 times C's time on five of the six
compute benchmarks there and 0.87 on the queue's (below), and wakes for
a timer or a pin beside a busy worker in 12 and 13 µs, where C at equal
priorities waits for the time slice.
bench/c/rp2350/is the C reference, set up as the port sets up the chip, andbench/run.py --target pico2wruns either suite. - Benchmarks on the ESP32 WROVER-E: MicroGoose and C, 5 boots each, are
on the results page, in
the chart of MicroGoose against C and in the README's table. Every
result matches C's, and MicroGoose's compute and scaling medians are
within 0.9% of the WROOM-32's. The suite runs to its end there since
the change below.
bench/run.py --target esp32 --label wroverruns it, and the report tells its runs from the WROOM-32's by that label. --emulatefor the Pico 2 W, in picoem's RP2350 model:microgoose run --target pico2w --emulatebuilds thepico2w_uartenv (the same program and port, with the console on UART0 and libgcc's doubles) and runs it inmg-picoem, a small runner thatpython ports/rp2350/picoem/build.py DIRbuilds from picoem's source at a pinned commit, with a patch (ports/rp2350/picoem/README.mdlists what it changes); pointMG_PICOEMat it. Every stock sample the board runs prints the same bytes there as on a PC: 22 pass, and 02_memory, 21_raytrace and 22_image_filters are skipped, as on the board, for needing more than its 520 KB of RAM. picoem doesn't enforce the MPU, so a data stack overflow there isn't stopped at the stack's end: it runs on until it leaves RAM. CI runs the samples in picoem on every pull request (Boards).- The examples choose Pico 2 W pins:
serial.gooseuses GPIO0 and GPIO1 for its UART there (connect them; the Pico can't send and hear on one pin), andanalog.goosereads GPIO26. - Goose v2026.5: MicroGoose now downloads and pins the Goose compiler
v2026.5
(released 2026-12-02), checked against its SHA-256 as before. Programs
get what it adds, among them
src_file()andsrc_line(),_in number literals (1_000_000), thematandquatmodules, file-local namespace aliases,copy_from(the new name ofcopy_into, which still works but is deprecated) andos.read_fileat an offset; see its release notes for the rest. The first build after upgrading downloads it, and compiles the runtime again. - What changed underneath for the boards:
- A worker thread keeps the port's 16 KB native stack. v2026.5 asks for 8 MB per worker thread, which a desktop only reserves but a board would have to allocate.
- A worker's copy of the globals still comes from the port, now that v2026.5 allocates the desktop's in whole 128-byte cache lines.
- An in-order sum whose count is a whole number of blocks, such as
for k in 64 { s += a[k] * b[k]; }, still runs one term at a time on the boards, with the same result. v2026.5 writes such a sum as its blocked loop alone, and MicroGoose rewrites that loop into the one-at-a-time loop v2026.4 wrote, so the benchmark suite'smatmul_f32keeps its speed (Optimizations, section 12). os.random_seed()and the newos.random_bytes()take the hardware random number generator's entropy on the ESP32s. The H7 has none to give yet:random_bytesreturns false there, andrandom_seedmixes the clocks as before.
- A folder set up for VS Code by an earlier release still points the Goose
extension at the old compiler.
microgoose vscode PROGRAM --forcepoints it at v2026.5. The extension itself is unchanged, so there is nothing to reinstall. task_priority(up): a thread can run ahead of the program's other threads. A thread that waits for events one step up has each one as it comes, whatever the workers are doing: with a worker busy on each core of an ESP32, a timer's tick or a pin's edge reaches it in 10 to 12 µs, 17 at the slowest, where it took a median of 0.8 to 1.1 ms. C with its waiting task raised the same way takes 8 to 10 µs. Levels 0 to 3 on the ESP32s, 0 or 1 on the STM32H7. See Events ahead of the workers.--worker-stack SIZEgives eachthread_spawnworker a native stack of that size in place of 16 KB (at least 2K). On a WROOM-32, a waiting worker with 4 KB data stacks holds 9 KB with--worker-stack 4Kagainst 21 KB, and 19 fit where 8 did. Measure before choosing a size: on the ESP32s nothing stops a worker that runs past its native stack.--stack-reportbuilds a program that measures its own stacks: how far each data stack was written and how much of each native stack was used. It prints the report when the program ends and at the newstack_report(). See Measuring stacks.- ESP32s: a crash with a thread's native stack nearly used up now says
native call stack overflow, most likely, and names--worker-stackwhen the thread is a worker. Until now it showed only as the crash it led to. - ESP32s: a worker's data stack is allocated so that the heap can give its memory to the next worker's data stack. With the heap nearly full, 13 to 19 workers that ended and were started again at once were refused their data stacks with 14 to 29 KB free. Each worker's data stack takes 192 bytes more at 4 KB and 448 more at 16 KB.
- STM32H7 and Pico 2 W: a queue's backlog no longer takes most of its
message nodes from
malloc. With one core, a worker that sends keeps the CPU, so most of its messages wait at once. The node cache there now grows in chunks that double, from 512 bytes to 8 KB, while they hold under a quarter of the free heap, and keeps them until reset. The benchmark suite'squeue_2000takes 0.59 of its time on the H7 and 0.65 on the Pico 2 W: 1.35 and 0.87 times C's, against 2.28 and 1.33. The ESP32s keep their 4 KB cache, where a bigger one gained 1.4% at most (Optimizations, section 13). - Benchmarks: pin-edge latency, in Goose and C. With nothing else running an edge reaches a waiting program in 10 µs on the ESP32-S3, 12 on the WROOM-32 and 1 on the STM32H7, against C's 8 and 10 on the ESP32s. See the report.
- ESP32s: an event reaches a thread waiting in
event_wait2 µs sooner. With nothing else running, a timer's tick or a pin's edge takes 8 µs on the ESP32-S3 and 10 on the WROOM-32, where it took 10 and 12: level with C on a FreeRTOS queue. The interrupt writes the event straight into the waiting thread's record and wakes it with a task notification, so the thread no longer takes the event queue's lock again. Four threads can wait at once; a fifth looks again at each tick. The first build after upgrading compiles everything again, for a new FreeRTOS setting. See Optimizations, section 14. - ESP32s: a pin's edge while a program read or wrote a file under
flash/stopped the board: the ESP32-S3 was reset by its interrupt watchdog, and the WROOM-32 stopped with a cache error. The pin's interrupt runs while flash can't be read, and it read the pin's level with an ESP-IDF function kept in flash. It reads the pin's register now.tests/stress/flash_edges.goosechecks it. - ESP32 boards with PSRAM (the ESP32-S3, the WROVER-E):
thread_spawnreuses a finished worker's thread. When a worker ends, its thread waits up to a second for the next spawn, two at most, and the next spawn hands it its worker instead of creating a thread. The benchmark suite'sspawn_waittakes 54 µs on the ESP32-S3, where it took 145: 0.67 of C's 81. It takes 77 µs on the WROVER-E, where it took 160.fault_containedtakes 146.5 µs on the S3, against 233. A waiting thread holds its native stack, about 16.5 KB of internal RAM, sofree_heap()reads lower for up to a second after a program's last spawn. A thread waits only while 32 KB of internal RAM stays free, and a data stack, a native stack or a worker's globals that can't be had sends the waiting threads away first. The WROOM-32, with no PSRAM, still creates a thread for each spawn: with threads waiting there, the suite ran out of memory in 2 boots of 5. See Optimizations, section 15. - ESP32s with PSRAM (the S3 and the WROVER-E): a finished worker's native
stack is freed as its thread ends. ESP-IDF left it to an idle task, and
while other workers kept both cores busy an idle task didn't run. On
the WROVER-E, where four 16 KB native stacks fit in the internal RAM
left, that ended the benchmark suite at
scale_4win every boot, withcannot create threadand over 4 MB of the heap free. A worker's thread is now joined as it ends, by a task above the program's priorities. The suite runs to its end on the WROVER-E, as built and with--worker-reserve 4K. The joining task holds 2 KB of internal RAM from the first worker on, and a detached pthread a program starts itself is joined too: an empty one, created and waited for, takes 120 µs against 83 on the S3. The WROOM-32 frees them as before: joining each thread there put its end on the next spawn's path. It runs none of the new code, but its contained faults take 322 µs in the suite against 242, and why wasn't found. See Optimizations, section 16. - UART frames other than 8N1, inverted lines, breaks and RS-485, on every
board:
uart_format(5 to 8 data bits, 7 or 8 on the H7; even, odd or no parity; 1 or 2 stop bits),uart_invert,uart_breakanduart_rs485, which drives a transceiver's direction pin around each write. They open up Modbus RTU (8E1 over RS-485), DMX512 (a break, then 250 kbaud 8N2) and SBUS receivers (100 kbaud 8E2, inverted).tests/stress/uart_frames.goosechecks them on a board with no wiring. See Frames, inverted lines and breaks. - LED strips (WS2812, NeoPixel, SK6812) on every board:
leds_open,leds_set,leds_show,leds_write(raw bytes, for RGBW or another colour order),leds_timing(other chips, such as a WS2811 at 400 kHz) andleds_close, up to 4 strips at once. The ESP32s send them with RMT, the H7 with a timer fed by DMA, the Pico 2 W with PIO fed by DMA.rgb_initandrgbare now a strip of one LED, so they also work on the H7 and the Pico 2 W, which ignored them before.tests/stress/leds_frames.goosechecks them on a board with no strip. See LED strips.
0.2.2 (2026-12-04)¶
VS Code and tutorials for getting started, compiler errors that name your file, fixes to the emulators and the console, and shorter ESP32 builds.
After upgrading, the first build for each ESP32 board compiles everything
again, as after any upgrade. A folder made with an earlier release has no
VS Code setup; microgoose vscode PROGRAM adds it.
- VS Code:
microgoose newsets the folder up for the Goose extension, so opening it shows errors as you type, hover and go to definition intoimport mcu;, and Ctrl+Shift+B builds and runs the program on the board. It writes.vscode/settings.json, which points the extension at the Goose compiler and at MicroGoose's library, and.vscode/tasks.json, with tasks to run, build, monitor, emulate and make Velxio's files. Until now the extension reportedcannot find the module mcu, or, with the compiler off PATH, found no compiler at all.microgoose vscodedoes the same for an existing folder or another board. See Editors. - The tutorials start in VS Code: a new first page,
Start here: VS Code, with
screenshots, sets it up and shows running on a board with Ctrl+Shift+B.
Tutorial 1 opens the traffic light in VS Code and runs it on a board
first, with Velxio as the way to run it without one, and each tutorial's
On a board tab comes first.
microgoose newwith an example that has a circuit now suggests running it on a board first, then Velxio. - Tutorials, at microgoose.dev/tutorials: four of them, from installing MicroGoose to a knob that turns a servo. Each runs on an ESP32 or ESP32-S3 board, or with no board in the Velxio browser simulator, and the language tour in QEMU too. A unit test compiles every whole program in them, so they keep matching the compiler.
- The compiler's errors and warnings name your file, as you typed it
(
lights/main.goose:55: error: …), where they named MicroGoose's copy of it inbuild/stage. So do runtime errors such as an index out of bounds. - On Windows, building a program that isn't under the current folder
(
microgoose build C:\elsewhere\main.goose) failed in the C compiler withincomplete universal character name \U: the file's path went into the C with its backslashes unescaped. It's escaped now, and runtime errors still show the path as you typed it. --target s3 --emulateruns programs that useimport mcu;, among them the starter program ofmicrogoose newandexamples/threads.goose. They stopped while the chip booted: ESP-IDF calibrates the S3's ADC at start-up, from eFuses a real chip has programmed at the factory, and by measuring the ADC when they're blank, which QEMU doesn't model. QEMU's eFuses start blank. MicroGoose now gives the S3's QEMU an eFuse file,build/emulate/s3.efuse.bin, that is blank except forBLK_VERSION_MAJOR= 1, the value that says the calibration is there. The MAC address, flash encryption and secure boot bits stay as a blank chip's. The firmware is unchanged; boards are unaffected. CI runs the starter program and the threads example in the S3's QEMU as well.- STM32H7 in Renode:
delay_ms()and waits with a timeout return. The port's clock is the chip's cycle counter, which Renode doesn't model, so the time stood still there and the starter program stopped at its firstdelay_ms(). The firmware's 1 ms tick now checks that the counter has moved; where it hasn't, the tick moves the clock, andmicros()steps by - On a board the counter counts and the clock is read as before: a
read of
micros()costs the same cycles (bench/results/probes/20261203-h7-renode-clock). CI runs the starter program in Renode as well as in the classic ESP32's QEMU. - A clean ESP32 build compiles only the ESP-IDF components MicroGoose
uses, not all of ESP-IDF (
MINIMAL_BUILDinfirmware/CMakeLists.txt): 956 files instead of 1,113 for the ESP32-S3 and 910 instead of 1,064 for the classic ESP32. On our PC one clean build of each went from 6 min 21 s to 5 min 18 s for the S3 and from 5 min 50 s to 5 min 7 s for the ESP32. The linker already left the other components out, so the firmware keeps what it had, apart from mDNS's handling of an Ethernet interface, which no MicroGoose board has: a networked image is 1 KB smaller and one without networking 80 bytes. The first build after the upgrade compiles everything again, as after any upgrade. - For people who build MicroGoose from a checkout:
firmware/platformio.inireads an optionalfirmware/platformio.local.ini, which git ignores, and abuild_cache_dirthere turns on PlatformIO's build cache. With it filled, a clean ESP32-S3 build took 60 to 90 seconds on our PC where it took 5 min 20 s. It only helps builds in the same folder, and it is off unless you add the file (Contributing). CI keeps the same cache for its ESP32 jobs. runandmonitorshow the program's last line whole. When the end of the output arrived in two pieces, the rest of the line was kept but not printed, and the console stopped at[microgoose] program exited with c. Seen in the classic ESP32's emulator; boards read their console the same way.
0.2.1 (2026-12-02)¶
Fixes to the first steps, found by installing 0.2.0 from PyPI the way a new user does and running the docs' commands as written.
microgoose setupsays when your shell won't find themicrogoosecommand, where pip put it, and the line that adds that folder toPATH. With Python from the Microsoft Store,pip install microgooseleaves the command offPATH, so the quick start's next line failed with'microgoose' is not recognized.python -m microgooseworks there, and the tool's own hints and messages now name it whenmicrogooseis offPATH.setupalso says when Windows refuses to run the command's launcher (An Application Control policy has blocked this file, from Smart App Control), and Getting started names that message. The launcher is a small unsigned program pip makes at install time;python -m microgooseis the same tool run by Python, which is signed.--port PORTonrun,flashandmonitornames the ESP32 board's serial port. The docs set it withMG_PORT=COM7 microgoose run ..., which is a POSIX shell's syntax and an error in Windows'cmdand PowerShell.MG_PORTstill sets the default.run,flashandmonitorlook for the board's port before they build, and--emulatefor its emulator. With two boards plugged in, a firstrunbuilt for six minutes and then stopped on the port. The message now lists the ports found, and the USB serial ports that were not picked (a CH340's, for one).- Getting started's install step covers the two ways a plain
pip installfalls short: the command offPATH, and pip'sexternally-managed-environmentrefusal on recent Debian, Ubuntu and Homebrew (checked on Ubuntu 24.04), with pipx or a virtual environment as the way in. - The README's quick start runs the starter program, which works on all
three boards. It ran
blink, which is written for the ESP32-S3 board's LED and prints an error and -273 °C on a WROOM-32. Getting started's sample output is now the starter's, not another program's. - The quick starts no longer show
--emulatewithout saying that an emulator has to be installed, and the no-board commands use the classic ESP32's emulator, where the starter program runs. The boards page says what the other two can't do. In QEMU, an S3 program that calls intoimport mcu;stops while the chip boots: the evaluation page's own example did. In Renode, the STM32H7'sdelay_ms()and waits with a timeout don't return, so the starter program stops at its first one. - The boards page explains the three PSRAM error lines of every WROOM-32
boot. Commands the docs joined with
&&are on lines of their own (Windows PowerShell 5 doesn't take&&), and the network console's page says what to use where there is nonc. - The examples' header comments give commands that work after
microgoose new. microgoose sshandsftpsay what to do when a board's host key is not the one remembered for its name, which happens after its flash is erased: OpenSSH'sREMOTE HOST IDENTIFICATION HAS CHANGEDgave no way on. The networking page covers it too.- The benchmark charts and the pipeline diagram draw their own background when they are shown as images. On PyPI's white page, a visitor whose system is in dark mode got a chart's dark-mode colours: its title and labels were light text on white, all but invisible. The first chart's footnote no longer says the WROOM-32 can't start the 2-worker run, which it runs.
- CI takes the first steps of Getting started on installs like a new
user's: on Windows with the command off
PATH, and on Ubuntu's own Python with pipx and with a virtual environment. Its emulator jobs run the programs the docs run without a board.
0.2.0 (2026-12-02)¶
The second release. Since 0.1: a hardware library for the peripherals the
three boards share (import mcu;), networking, updates over WiFi, SSH and
files that survive a reset on the ESP32s (import net;), threads on the
STM32H7, an emulator for each target, and a benchmark suite against C,
Rust, TinyGo and MicroPython with nine measured performance changes
(the report).
Coming from 0.1:
import esp;is nowimport mcu;. The old name still works, with a note at build time.- The root
mg.pyis gone: runmicrogoose. - The ESP32s have a partition table of their own, and the WROOM-32's app
slots are 1.75 MB. A board flashed with 0.1 picks it up, with its
flash/folder, at its next USB flash. - On the ESP32s
timer_every()takes the chip's four general-purpose timers, so C code built in with--includecan use only the ones a program leaves.
All changes, newest first:
- The benchmark work has a report,
docs/benchmarks/report.md: MicroGoose at the baseline, after the nine changes, against C, Rust, TinyGo and MicroPython, what the work cost and what is left. Its tables are written from the stored runs bybench/final.py, and--checkfails if one is stale. - Workers take less memory, and the WROOM-32 fits more of them. In the
benchmark suite a worker held 70 KB and wrote 1 KB of it. A
thread_spawnworker's copy of the globals now holds only the globals it uses, on every board: the compiler's C allocated and zeroed a copy of every global in the program at each spawn, 37 KB in the suite, where no worker uses one.--worker-reserve SIZE(microgoose buildandrun) gives the data stacks of workers a size of their own. Without it they are--reservebytes, as before. On an ESP32 with no PSRAM, a program without networking is given a data stack while 8 KB stays free, not 64 KB. And a spawn's native stack now waits up to five ticks for finished workers to be freed, as a data stack already did: with less held back, a spawn could run out there first (cannot create threadin one boot of ten). A worker of the suite now holds 32 KB as built and 20 KB with--worker-reserve 4K, with which the WROOM-32 runs the whole suite for the first time.spawn_waitwent from 210 to 153 µs on the S3, 285 to 218 on the WROOM-32 and 104 to 65 on the STM32H7, andfault_containedfrom 404 to 354, 422 to 336 and 128 to - What it leaves: as built, the WROOM-32 still stops at
scale_4w; main's data stacks are still one size; and a loop of spawns on the S3 holds five finished workers' stacks at once, 81 KB, where it held one, until the idle task frees them.tests/stress/worker_globals.goose,low_heap.gooseandheap_needs.gooseare new. bench/run.pynotices a boot whose console lost bytes on the way to the host. It took a cut sample line at face value: in one run a piece of atimer_idle_gapline became a benchmark namedti000, and the boot was reported complete with 826 of its 1,000 samples. Now a sample line counts only if it names one of the suite's benchmarks, has the unitusand holds 1 to 20 integers, and every benchmark of a boot is counted against what the suite prints. Such a boot is printed asDAMAGEDwith what was found,samples.jsonkeeps that underdamage, and the run exits with an error. No published run is affected: of the 826 stored boots, only that one fails.- On the ESP32s, timer ticks and pin events reach a waiting program
sooner and more evenly.
timer_every()runs on the chip's general-purpose timers and stamps each tick in its interrupt, 2 µs after it is due. It was anesp_timer, whose task stamped a tick 10 to 11 µs late and woke the program on the other core. From due to the program having it, a 1 ms tick takes 12 µs on the S3 and 14 on the WROOM-32, against 23 and 28. A worker computing on the program's core used to hold every event up by as much as the scheduler's 1 ms tick, for as long as it stayed there: on the S3,timer_busy_wake's boots had medians of 174 to 886 µs.event_wait()now moves that worker to the other core when that core is idle, at the first late event, and every wake of the benchmark takes 10 µs. Four timers at once keep their periods to the microsecond. What it costs: a program that starts a timer links ESP-IDF's timer driver, 8 KB of flash;timer_every()takes the chip's four general-purpose timers, so C code built in with--includethat takes one leaves three; and a timer's interrupt runs on the core of the thread that started it, 9 to 11 µs a tick there. On the S3,scale_2wis 0.3% slower, because the image's 896 bytes more of internal RAM send one worker's globals to PSRAM.tests/stress/timer_wake.gooseandpin_wake.goosetime the ways a tick and an edge reach a program. - On the ESP32s,
delay_ms(n)no longer returns before n ms have passed. It wasvTaskDelayfor n 1 ms ticks, and FreeRTOS counts the tick already under way as the first, so a wait could end up to a tick early: of 5,700 waits of 1 to 50 ms intests/stress/delay_early.goose, 3,696 did on the S3 and 3,005 on the WROOM-32, a 1 ms wait after as little as 9 µs.delay_msnow blocks for the whole ticks and waits out what is left, under a tick, on the clockmicros()reads. None of the 5,700 is early, from the main thread or a worker. The end of a wait that used to be cut short is spun: in a loop of back-to-back delays, 0.11 to 0.32 ms a call, which is 27% of adelay_ms(1)on the S3, 14% on the WROOM-32, and under 1% of adelay_ms(50). The rest of the wait is blocked, as before. A turn of adelay_ms(1)loop went from 997 to 1,005 µs on the S3. The STM32H7'sdelay_msalready waited on its clock. - The documentation at microgoose.dev has a
logo, a new home page, and new pages for engineering teams evaluating
MicroGoose, its security model, questions and answers, and this
changelog. Each page has its own search description, title and social
preview.
SECURITY.mdsays how to report a vulnerability. - The root
mg.pyis gone. Runmicrogooseafterpip install -e ., orpython -m microgoosefrom the checkout without installing. - The documentation and README show MicroGoose running in the Velxio
browser simulator, and the benchmark pages have charts: MicroGoose
against C on each board, the languages on the ESP32-S3, and each
optimization's before and after.
bench/charts.pydraws them frombench/results/, asbench/report.pywrites the tables, and both take--check. Lists on the benchmark and findings pages that ran into the paragraph above them render as lists. - On the STM32H7, reading the clock is six times as fast.
micros()went throughclock_gettime(), which made three 64-bit divisions, in software on this core: 305 cycles a read. The port now keeps the time as seconds, microseconds and the cycles past them, and moves it forward at each read with one 32-bit division: 51 cycles.micros(),clock_gettime(), event times,delay_ms()and timed waits all read it and give the values they gave before.clock_1000takes 0.169 of its time, and 0.52 of C's. Benchmarks that time short spans withmicros()read a little shorter for it:pingpong's mean went from 8.74 to 8.20 µs.tests/stress/clock_costs.goosetimes a read's parts and checks the clock across the cycle counter's wraps, from a worker and against a timer's interrupt. - In-order float sums are faster on every board. Goose's C adds such a
sum's terms in blocks of 8, through a local array, a shape that
vectorizes on a desktop. These chips have no vector float unit, so the
array only costs a store and a load a term, and on the ESP32s the
block's 64-bit counters two compares. MicroGoose now turns the block
off, and the loop Goose emits for the rest runs every term, in the
same order, with the same results.
matmul_f32now takes 0.436 of its time on the S3, 0.394 on the WROOM and the WROVER-E and 0.635 on the H7: 1.31 times C's on the S3, 1.37 on the WROOM and 1.01 on the H7. The rest is C's fused multiply-add, which Goose never uses for a*and a+.heapsortstill takes 1.93 to 2.15 times C's: in C, 64-bit indexes alone take 1.51 to 1.77 times as long.tests/stress/loops_costs.goosetimes both beside C with Goose's ingredients added one at a time. - Queue round trips are faster on the ESP32s. mg_sync's waits there
now sleep on binary semaphores, kept for the next wait, which ESP-IDF
wakes sooner from the other core than a task notification. Its
critical section is this core's interrupts masked and a
compare-and-swap, in place of
portENTER_CRITICAL(790 ns entered and left on the S3). On every board, a woken waiter returns without entering it. On the ESP32s, a lock that finds the mutex held, with nobody waiting for it, watches it for up to 4 µs before it sleeps.pingpongnow takes 0.893 of its time on the S3 and 0.676 on the WROOM, andqueue_20000.657 and 0.483; on the WROVER-E, 0.676 and 0.518. On the H7,queue_2000takes 1.039 of its time: placement alone moves it by up to 2.8%, and over seven placements the change took 2.3% longer on average. On the S3, spawns and contained faults got slower:spawn_waitby 6 to 16 µs at every placement tried (1.077 of its time in the suite), andfault_contained1.118 in the suite and 1.221 alone, with mg_sync doing the same work for them as before; why isn't known.tests/stress/pingpong_costs.goosetimes the round trip and its parts. On the S3, the round trip runs at one of two speeds, about 19 or 24 µs, depending on the build; why isn't known. -
Spawning a worker is faster on the ESP32-S3 and the STM32H7. Each worker starts with a zeroed copy of all the program's globals (37,136 bytes in the benchmark), and the globals it uses are then copied in.
- On the S3, ESP-IDF put a block that size in PSRAM, where zeroing it took 1.1 ms. A worker's globals now come from internal RAM while 64 KB of it stays free, as data stacks do.
- On the H7, the port has its own
memset, which writes 4 bytes at a time where newlib-nano's wrote one. It also fills each new task's stack.
spawn_waitnow takes 0.146 of its time on the S3 and 0.325 on the H7, andfault_contained0.204 and 0.372. The WROOM has no PSRAM, and its code is the same: itsspawn_waitwent from 275 to 279 µs, within the spread between its builds.tests/stress/spawn_costs.goosetimes a spawn's parts and checksmemset.On the WROVER-E (a classic ESP32 with PSRAM), the probe's spawn went from 2,287 to 297 µs. The benchmark's didn't change (2,330.5 to 2,326): with 96 KB of data stacks for main, internal RAM had no room for the globals above the 64 KB kept free, so they still went to PSRAM.
-
Queue messages take their nodes from a cache (
mg_qnode.c) on every board, in place ofmallocandfree, for nodes up to 128 bytes. The cache takes 512-byte chunks as it needs them, 8 at most (4 KB), and keeps them until reset; past that, nodes come frommallocas before.queue_2000now takes 0.50 of its time on the S3, 0.22 on the WROOM and 0.985 on the H7, andpingpong0.74, 0.71 and 0.82. With more messages waiting than the cache holds,qputandqgetcost up to 9% more on the ESP32s.tests/stress/qnode_stress.goosechecks the cache under load. - On the STM32H7,
event_waitno longer wakes a tick late. An event that came while the wait was getting ready to sleep woke nobody, so the wait slept until the next 1 ms tick. With workers running, the waiting task, coming back down from the priority it waits at, could also hand the CPU to a worker until the next tick: with two workers, more than half the wakes came over 500 µs late, by up to 2 ms.uart_read,can_sendandcan_receivewait the same way and are fixed with it.tests/stress/event_wake.goosechecks it. - Queues are faster on every board: the runtime's mutexes and condition
variables are MicroGoose's own (
mg_sync.c), in place of ESP-IDF's pthreads on the ESP32s and the port's FreeRTOS mutexes on the H7. Taking and giving back a mutex nobody waits for is one compare-and-swap each, and a signal with nobody waiting is one load.queue_2000now takes 0.19 of its time on the S3, 0.30 on the WROOM and 0.45 on the H7, andpingpong0.54 on the ESP32s and 0.69 on the H7.tests/stress/sync_stress.goosechecks mutual exclusion, wakes, timed waits and queues. On the H7, spawning got slower in this build (spawn_wait323 to 454 µs), because the linker placed newlib-nano's byte-at-a-timememset4 bytes off an 8-byte boundary. A test withmemsetplaced on one put it back at 319 µs. - On the STM32H7, a timed wait on a condition variable no longer times
out before its deadline. The port's
pthread_cond_timedwaitcounted 1 ms ticks from when it started, so it could end up to a tick early. Goose's own queue waits checked the time again and weren't affected. C code that waited directly was. - On the ESP32s, a timed queue wait (
qget<T>(ms)) works after the wall clock is set (ntp_sync). ESP-IDF compared the runtime's deadline, which counts from boot, with the wall clock. Once the clock was set, the wait spun holding the queue's mutex until its deadline, so a message couldn't arrive during it.tests/stress/wall_clock.goosechecks it. - On the STM32H7,
reallocno longer reads past the end of the block it grows. newlib-nano's, in the toolchain the port builds with, copied the new size out of the old block. Past the end can be a worker's stack, which begins with an MPU guard, and then the copy faulted: the runtime grows blocks for contained aborts and for each task's thread-local variables. The port now has its ownrealloc, the toolchain's with newlib 4.0.0's fix.tests/stress/realloc_copy.goosechecks it. - The STM32H7 port uses the double-precision FPU. It used to be built for
software floating point. Floating-point work now runs 5.9 to 15.6 times
faster on the H7: Mandelbrot comes within 7% of C built for the FPU, and
matrix multiplication takes 1.6 times as long. FreeRTOS saves a task's
FPU registers at a switch, and contained workers return from an abort
through a
setjmpthat keeps them too.tests/stress/fpu_registers.goosechecks both. - The ESP32 and ESP32-S3 builds recompile the runtime, the rest of the
microgoosecomponent and the program whencompat/mg_prefix.h, which they get with-include, changes, or a header it includes (mg_fs.h). They used to compile nothing and link the objects from before the change. ESP-IDF's own objects don't depend on it. - Benchmarks in MicroPython on all three boards (
bench/micropython/), on MicroPython 1.29.0: the same workloads and checks, withasynciotasks, frozen into firmware built from MicroPython's source.bench/run.py --impl micropythonbuilds it (in WSL withBENCH_MICROPYTHON=wsl:<distro>) and flashes it;--impl micropython-nativecompiles the workloads with@micropython.native. The H7 build has a DevEBox board definition and an RTT console written in Python. The findings compare them with C. - Benchmarks in Go on all three boards (
bench/tinygo/), built with TinyGo 0.44: the same workloads and checks, with goroutines, channels andsync.WaitGroup.bench/run.py --impl tinygobuilds and flashes them;--impl tinygo-coresruns the S3 build on TinyGo's multicore scheduler. The findings compare them with C and describe the TinyGo problems the runs ran into. - Benchmarks in Rust on all three boards (
bench/rust/), on Embassy: the same workloads and checks as the C and Goose suites, one shared suite for every board,esp-halwith an executor per core on the ESP32s andembassy-stm32on the H7.bench/run.py --impl rustbuilds them with cargo, natively or in WSL (BENCH_CARGO=wsl:<distro>), and records the crate versions. The findings compare them with C. - Finished workers free their memory sooner. On the STM32H7, a worker's
task is now deleted when
thread_waitwakes, not only at the next spawn or when the idle task runs, so a burst of workers no longer holds about 17 KB each after it has been waited for. On the ESP32s, a data stack that doesn't fit is retried for up to five ticks while ESP-IDF's idle tasks free the workers that just finished. That's aimed at a spawn failure that ended the benchmark suite in 2 of 12 boots on the WROOM-32, which hasn't recurred in 24 boots since. The exit line says how many data stacks waited. The benchmark findings now cover the correctness issues the baseline turned up, andbench/run.py --dirkeeps runs out of the report. - Velxio:
microgoose velxio FILEbuilds a program for the classic ESP32 and writes the two files Velxio loads, the flash image and the circuit beside the program (diagram.json), so it runs in the browser wired to LEDs, buttons, knobs and servos. Three examples come with circuits:velxio/traffic(GPIO and pin interrupts),velxio/dimmer(ADC, PWM to an LED and a servo) andvelxio/rainbow(a NeoPixel over RMT).microgoose new NAME --example velxio/trafficcopies the whole example folder. - PWM on the ESP32s:
pwm_pulse_usno longer trusts a frequency readback more than an eighth off what was asked. QEMU's LEDC, as in Velxio, reads back a tenth of the real frequency, so servo pulses came out a tenth as long and a servo never moved. On a chip the readback is within rounding, and is used as before. - Benchmarks (
bench/, docs under Benchmarks): MicroGoose against native C on all three boards, with the same clocks, RTOS settings, priorities and stacks. They measure compute, the clock, typed queues, round trips, spawning, multicore scaling, timer jitter and wake-up, and contained faults.bench/run.pykeeps every boot's raw console, every sample, the build log and configuration, and the compilers found in the ELF.bench/report.pywrites the tables. The baseline is theperf-baselinetag, before any performance work, and its findings include where Goose is behind. - Threads on the STM32H7: the port now runs on the FreeRTOS kernel that
STM32Cube ships, and
thread_spawnand the typed queues work, so the H7 passes 23_mandelbrot_threads and 32_pool_worker_snapshots (22 of 22 samples that fit). The program and its workers share the one core in 1 ms time slices. A worker's native stack is 16 KB, with an MPU guard while a region is free, and overflowing it or a data stack is reported as on the main program. Prints from several tasks stay whole lines. Hardware calls from different tasks take turns without one that waits holding up the others, and a task waiting for an interrupt wakes at once even while another computes. With no worker running, waits and delays behave as before. - CAN in
import mcu;, on all three boards: classic frames with 11- or 29-bit ids and remote frames, throughcan_open(tx, rx, bitrate, mode),can_sendandcan_receiveorcan_read. Received frames wait in a ring of 64 (can_available,can_dropped), and one mask filter per bus keeps the ids a program wants.can_state, the error counters andcan_recoverreport and leave bus off.CAN_LOOPBACKchecks a board with no transceiver, andCAN_LISTENonly listens. The ESP32s use TWAI on any pins: there, the same pin as TX and RX is open-drain with the pull-up, so ESP32s can share one wire on a bench. The H7 has FDCAN1 and FDCAN2, clocked from the 25 MHz crystal.examples/can.gooseruns in loopback. mg runon the ESP32s starts the program once. The upload had reset the board into the program, and the monitor reset it again to show the output from boot, so the first start ran for about a second: long enough to send a CAN frame, publish over MQTT or write toflash/twice. The upload now leaves the chip in its bootloader and the monitor's reset is the start.mg flashalone still leaves the program running.- Interrupts in
import mcu;, on all three boards: pin edges and timer ticks arrive as events, in order, stamped on themicros()clock.pin_watch(pin, RISING/FALLING/CHANGE, debounce_us)watches a pin, and| COUNT_ONLYcounts its edges (pin_count) without queueing them.timer_every(period_us)starts one of 4 periodic timers.event_wait(orevent_next, which also gives the time and level) takes the next event. The queue holds 255;event_droppedcounts the rest. A pin edging faster than the chip keeps up with (100 kHz on the ESP32s, 1 MHz on the H7) stops its own watch and queues an event of level −1: a 500 kHz signal had reset the S3. The H7 uses EXTI and TIM5, 6, 7 and 12.examples/interrupts.goosewatches and counts its own pin. - STM32H7:
delay_msand Goose's own sleeps wait as long as asked;HAL_Delayhad added a millisecond (delay_ms(1)took 2 ms). Pin −1 is no longer PA0 in the pin calls. - UART, I2C and SPI in
import mcu;, as masters, on all three boards. Each*_opentakes the pins and returns a handle:uart_open(tx, rx, baud),i2c_open(sda, scl, hz),spi_open(sck, mosi, miso, hz, mode). UART reads wait in a buffer (1 KB on the ESP32s, 256 bytes on the H7) and come back with a timeout, or a line at a time withuart_read_line. I2C hasi2c_write,i2c_read,i2c_write_read(repeated start) andi2c_probe; SPI hasspi_transfer,spi_writeandspi_write_read, each holding a chip-select pin low. The ESP32s take any pins and refuse the ones flash or PSRAM use; the H7 takes its peripherals' pins (USART1-3, UART4-5, USART6, UART7-8, I2C1-4, SPI1-4). A UART with the same pin for TX and RX is a one-wire link that hears itself, and on the ESP32s an SPI bus with MISO on its MOSI pin reads back what it sends:examples/serial.goosechecks both buses that way and scans I2C. - PWM in
import mcu;:pwm_start(returns the frequency the hardware hit),pwm_duty(0.0 to 1.0),pwm_pulse_usfor servos, andpwm_stop. The ESP32s use LEDC: any output pin, 8 at once on 4 frequencies, 1 Hz (S3: 2 Hz) to 40 MHz. The STM32H7 uses TIM1 to TIM4 on 32 pins, 1 Hz to 100 MHz.pin_read()reads a PWM pin's level;examples/pwm.goosemeasures its own wave that way. - ADC and DAC in
import mcu;: raw reads (adc_read_raw,adc_bits), input ranges (adc_range), averaging (adc_average_mv) and captures at a fixed rate into an array (adc_capture, about 21 kHz at most on the ESP32s, 230 kHz on the H7);dac_write,dac_write_mvanddac_offon the ESP32's GPIO25 and 26 and the H7's PA4 and PA5. The STM32H7 gets its ADC, DAC and temperature sensor, all scaled by the VDDA it measures.adc_read_mvreports millivolts on a chip without eFuse calibration too, rather than a raw reading.examples/analog.goosereads a DAC back through the ADC without a wire. import esp;is nowimport mcu;: the same functions under a name that fits every board, the STM32H7 too.import esp;still works, with a note at build time.--emulateruns a target's firmware in an emulator of its chip instead of on a board: Espressif's QEMU fors3(octal PSRAM) andesp32(as a WROOM-32), Renode forh7.tests/conformance.py --emulateruns the stock samples there. CI does both on every pull request for all three targets, along with a check that a data stack overflow hits the hardware guard.tests/conformance.pyexits non-zero unless every sample passes.- Networking on the ESP32s:
import net;brings WiFi, mDNS names (microgoose.local), NTP time, an HTTP and HTTPS client, an HTTP server the program answers itself, and TCP and UDP sockets.microgoose wifi SSIDsaves the network;--netmakes any program networked. See the new Networking page. - Updates over WiFi: once a board runs a networked program,
run --ota,flash --otaandmonitor --otawork without a cable. Updates are signed with a keymicrogoose wifimakes, go to the app slot not running, and roll back if the new app never gets online. Images sent over WiFi carry no WiFi password; the board keeps the one a USB flash gave it. - MQTT in
import net;: connect (mqtt://,mqtts://,ws://,wss://, with a login and a last will), publish and subscribe at QoS 0 to 2, andmqtt_nextfor incoming messages. The board reconnects and subscribes again by itself.examples/mqtt.goosereports its temperature and answers commands. - Files that survive a reset: on the ESP32s, the
flash/folder of the board's file tree is kept in flash with LittleFS (12 MB on the S3, 448 KB on the WROOM-32). Files there outlive resets, power cuts and new firmware; everything else stays in RAM as before.microgoose sftpand the SSH shell reach it as/flash, and moves between it and RAM copy the file.examples/boots.goosecounts the board's boots in it. - The WROOM-32's app slots shrink from 1.9 MB to 1.75 MB to make room for
flash/; the S3 gets a partition table of its own. Boards flashed before pick up the new table at their next USB flash. - SSH on a board without PSRAM waits for memory to send in, rather than drop the connection, when the program has taken nearly all of it.
- SSH and SFTP on networked boards, port 22:
microgoose sshopens a small shell (ls,cat,rm,mkdir,mv,info,log,restart) or runs one command, andmicrogoose sftpmoves files in and out of the board's file tree. Logins take the PC's own Ed25519 key, made on first use, and any in~/.microgoose/authorized_keys; no passwords. The board keeps its host key across updates. The server is MicroGoose's own, on Monocypher (curve25519-sha256 with strict key exchange, Ed25519, chacha20-poly1305), andtests/test_ssh.pydrives it with OpenSSH on the PC. - A network console on port 3233 mirrors everything the board prints and replays the run from its start. It keeps the run across a crash and notes how it ended.
- The ESP32 firmware uses its own partition table: two 1.9 MB app slots.
- Files on the board: Goose's file functions work against a RAM filesystem
that starts with the files given to
--data.--stdin FILEfeedsread_lineandread_stdin. --include HEADERpasses a C header to the Goose compiler, forextern fns that bind C functions written alongside the program.- stderr shows in red on every board's console.
- The STM32H7 can be reflashed after a program ends, without a manual reset.
- The conformance run covers every stock sample a board can run (26 of 32; five draw in desktop windows and two need over 8 MB). Every sample that fits a board's memory matches the PC: 24 of 24 on the ESP32-S3, 21 of 21 on the WROOM-32, 20 of 20 on the STM32H743.
- Goose runtime errors on ESP-IDF 6 print their message instead of crashing
(picolibc's
fflush(NULL)). - An ESP-IDF build rebuilds from clean when its build configuration changed, instead of linking with stale flags.
- Copyright holder spelled VoodooMods; the trademark policy is withdrawn.
0.1.1 (2026-11-28)¶
- The first release on PyPI. 0.1.0 was tagged but never published, because its release workflow also targeted TestPyPI, which isn't used.
- The release workflow publishes to PyPI only.
0.1.0 (2026-11-28)¶
The first release.
- The
microgoosecommand:new,build,run,flash,monitorandsetup. - Targets:
s3: ESP32-S3esp32: ESP32 WROOM-32 and WROVER-Eh7: STM32H743
- Goose v2026.4, downloaded on first use and verified by SHA-256.
- Data-stack overflow guards: hardware watchpoints on the ESP32s, MPU regions on the STM32H7, and canaries for any stacks beyond those.
import esp;: time, GPIO, WS2812 LED, ADC, chip temperature, RNG and system info.- Tested: all 12 stock Goose samples match the PC output on the ESP32-S3, WROOM-32, WROVER-E and STM32H743.