Skip to content

MicroCS 1.16.0 — Source discovery, bounded memory and Studio projects

Choose a tag to compare

@github-actions github-actions released this 22 Oct 10:28
b7b6bf1

Try it without installing anything: MicroCS Studio in Chrome or Edge, connected to a board flashed with one of the files below.

Board File How to flash
Raspberry Pi Pico / Pico 2 / Pico W / Pico 2 W / RP2040-Zero microcs-1.16.0-<board>.uf2 hold BOOTSEL, plug in, copy the file to the RPI-RP2 drive (pico_w / pico2_w files: Wi-Fi, sockets, HTTP client + server, WebSocket)
ESP32 / S2 / S3 / C2 / C3 / C5 / C6 / C61 / H2 / P4 microcs-1.16.0-<chip>.bin esptool.py --chip <chip> write_flash 0 microcs-1.16.0-<chip>.bin
STM32 Nucleo-F401RE / F411RE / F446RE / G474RE / L476RG / H743ZI microcs-1.16.0-nucleo_<board>.bin copy the file to the NOD_xxx drive of the Nucleo's ST-LINK (or STM32CubeProgrammer, .hex keeps your files); the console is the ST-LINK virtual COM port
STM32 Black Pill (F411CE) microcs-1.16.0-blackpill_f411ce.bin USB DFU (hold BOOT0, reset): dfu-util -a 0 -s 0x08000000:leave -D microcs-1.16.0-blackpill_f411ce.bin, or ST-LINK; console = USART1 (PA9 TX, PA10 RX) via a USB-serial adapter
Linux x64 mcs-1.16.0-<os>.tar.gz compiler, REPL and simulator: ./mcs --repl --sim
Threads Pico / Pico 2 / RP2040-Zero and ESP32 files run FreeRTOS (SMP on dual cores): Thread.RunOn(1, …) and jobs.cfg jobs use real threads; STM32 files are bare-metal
Radios ESP32: Wi-Fi + ESP-NOW and BLE where the chip supports them. S2: Wi-Fi + ESP-NOW only; H2: BLE only; P4: neither onboard radio. Pico W / Pico 2 W: Wi-Fi. Radios start when used by a script (or saved Wi-Fi autoconnect).
ESP32 storage migration Radio-enabled images use a larger app partition than the old no-Wi-Fi releases. Back up scripts before flashing: the storage partition moves and old files are not preserved.
ESP32-C2 note built for a 40 MHz crystal (ESP-IDF default); boards with a 26 MHz ESP8684 need a rebuild with CONFIG_XTAL_FREQ_26=y
Arduino IDE MicroCS-1.16.0.zip Sketch → Include Library → Add .ZIP Library

Source discovery hardening

  • Discover providers at nested VFS mount roots even when no backing parent
    directory exists; deduplicate files already reached through the root walk.
  • Replace recursive namespace-dependency visits with a growing, VFS-allocator-backed
    traversal stack. Long chains no longer consume native stack per provider; all
    scratch storage is released after success, compile errors, denied execution or OOM.
  • List every RAMFS directory entry using bounded scratch pages while preserving
    creation order, rather than silently dropping entries after 64.
  • Grow sorted POSIX directory listings beyond 256 entries; fail explicitly and
    clean up on allocation or enumeration errors rather than returning partial success.
  • Add nested-mount, no-execute, large-directory, moving-allocation, deep-cycle and
    exhaustive scratch-allocation failure regressions to make project-test.

Bounded memory and accurate telemetry

  • Compact paged compiler tokens and AST storage; release consumed declarations,
    trim completed methods, and preserve configured execution limits while returning
    large idle stack/frame reservations during compilation.
  • Compact internal symbol keys, best-fit fixed pools and optional cache allocation
    fallback. Runtime source/read buffers now count against the physical pool.
  • Shell/Studio report tracked VM allocations, full pool capacity/usage/peak/free/
    largest block and optional ESP32 device heap separately, including after OOM.
  • Add a 32-bit real-U8g2, fixed-40-KiB, 20-Project-cycle regression with
    profile-default stack/frame ceilings; no feature/profile/precision reduction.
  • ESP32 example pool ceiling/stack/frame settings and fail-closed allocation;
    existing defaults remain unchanged. See docs/MEMORY.md for scope/exclusions.

Studio project workflow

  • CI readiness — wait for asynchronous storage/memory telemetry before asserting
    values, deliberately delay initial memory replies, and summarize failed assertions.

  • Studio formatting — safe offline C# whitespace formatter, explicit document formatting,
    default-on line/paste formatting and format-on-save; preserve literal/comment contents.

  • Parameter info — reliably dismiss on outside pointer clicks, Escape, close button,
    focus loss and leaving the call context.

  • Save/build — default-on upload of all editable open C# tabs and compile-only checks
    before Save/F5/Run file; individual toggles, duplicate-path protection and action locking.

  • Multi-file source — IntelliSense combines all open C# tabs. Firmware file execution resolves
    namespace providers anywhere in the mounted VFS referenced by using, including transitive dependencies and
    isolated job VMs, while suppressing dependency top-level statements and implicit Main.
    Single-capital completion now offers built-in classes such as Path.

  • Editor safety — toolbar format-on-save replaces the document even while the toolbar has
    focus instead of inserting the formatted text at the previous editor caret.

  • Project mode — remembered device folder, required jobs.cfg, recursive source checks,
    F5/global Run scheduling only configured jobs; separate Run file / Ctrl+Enter action.

  • Firmware — guarded mcs_check_source / mcs_check_file, check shell command and
    validated project job replacement without reboot. Failed validation preserves the job
    table, not already-uploaded file contents. Updated firmware required for the new workflow.

  • Tests/docs — formatter, compiler/project transaction and real-shell browser regressions;
    usage, compatibility and deployment caveats documented. No physical-board validation.

Power management, memory recovery and documentation audit

  • Repeated-run memory recovery — collect dead objects before an idle top-level
    source run starts compilation; preserve live globals and callbacks. Fixed-pool
    regressions run the Studio CPU benchmark 20 times without manual collection.
  • File memory safety — stable reads no longer double their temporary buffer to
    detect EOF. Failed resizing never returns uninitialized capacity as file content.
    Native OOM cleanup releases whole-file read buffers, sequence-write handles and
    directory iterators; tests cover forced failures and 100 Studio upload/run cycles.
  • U8g2 naming — add upstream-style GetAscent(), GetDescent(),
    GetMaxCharHeight() and GetMaxCharWidth(); retain the old property aliases and
    update the reference, Studio completion and OLED text template.
  • Power API / HAL v4 — cooperative Sleep, per-VM SetWakePin / ClearWakePin,
    WakePin / WakeHigh, capability-gated LightSleep, reset-on-wake DeepSleep,
    and actual Shutdown. Optional append-only callbacks/masks preserve source
    compatibility for old ports; unsupported modes never become delay fallbacks.
  • Port support — shared ESP-IDF / Arduino-ESP32 light/deep sleep and chip-specific
    GPIO/timer wake; RP2 WFE CPU idle with sampled GPIO; STM32 CPU SLEEP and limited
    F4/L4/G4 PA0/high standby, L4 shutdown; optional Zephyr CONFIG_POWEROFF.
    No claim of RP2 dormant, STM32 STOP, generic Zephyr deep sleep or ESP shutdown.
  • Safety — validate before entry, reject worker VMs / active MicroCS DMA / worker
    subsystem use, require a wake source for light/deep sleep, and reject live ESP radios.
    Wifi.Off now checks driver stop errors and sets the SDK mode to NULL for safe entry.
  • Docs and Studio — power support matrix, wake/USB/watchdog/recovery caveats,
    six guarded capability-filtered templates, completion/hover reference and generated
    API reference. Fix stale release/BLE claims and current HAL version; publish power
    and previously omitted BLE documentation in the wiki navigation.
  • Tests — power policy, simulated calls, SDK wake-backend variants, gallery filtering,
    and documentation/API/template consistency; no physical power-current claims.