Skip to content

Releases

MicroCS 2.0.0 — Web flasher, LVGL and NuttX

Choose a tag to compare

@github-actions github-actions released this 04 Nov 20:30
9197c85

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-2.0.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-2.0.0-<chip>.bin esptool.py --chip <chip> write_flash 0 microcs-2.0.0-<chip>.bin
STM32 Nucleo-F401RE / F411RE / F446RE / G474RE / L476RG / H743ZI microcs-2.0.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-2.0.0-blackpill_f411ce.bin USB DFU (hold BOOT0, reset): dfu-util -a 0 -s 0x08000000:leave -D microcs-2.0.0-blackpill_f411ce.bin, or ST-LINK; console = USART1 (PA9 TX, PA10 RX) via a USB-serial adapter
Linux x64 mcs-2.0.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-2.0.0.zip Sketch → Include Library → Add .ZIP Library
  • Add a browser-based firmware flasher for supported ESP32, STM32 and Raspberry Pi boards, with release integrity checks and a Studio-matched interface.

Interpreter hot-path restoration

  • Apache NuttX as an optional OS (MCS_OS_NUTTX, auto-detected through
    __NuttX__): Thread.Run / RunOn / Every, Worker and Channel run on
    NuttX pthreads, semaphores and critical sections (CPU pinning with
    CONFIG_SMP). New ports/nuttx NuttX application (Kconfig, Make, CMake) that
    builds the mcs NSH command from the unix CLI; verified on NuttX 12.11.0
    sim:nsh (single core and SMP) with the full C# thread suite
    (make nuttx-test). 🧪 Opt-in GPIO character-device reads and writes are
    simulator-tested; physical boards, interrupts and other native peripherals
    are not yet verified or supported. The Make build handles empty and custom
    configuration-header paths. On NuttX the default
    MCS_THREAD_PRIORITY is -1 without round-robin so a busy script thread cannot
    starve the shell. The shell module's internal enum constants were renamed
    (SC_*) because NuttX defines a CODE macro.
  • Fix Directory.Delete(path, true) deadlocking with the threaded VFS lock by removing
    entries outside directory-list callbacks.
  • Use exact digit generators by default on NuttX (MCS_OWN_DTOA) for
    shortest-round-trip and explicit decimal formatting, avoiding its printf
    15-digit precision limit.
  • On NuttX, add a best-effort native stack reserve check for nested interpreter
    callbacks (MCS_NUTTX_STACK_RESERVE); it does not guard all native or
    compiler recursion, and target-specific stack sizing is still required.
  • Restore the pre-1.16 VM speed: PUSH is a single compare against the stack
    limit with a cold, out-of-line grow path; interpreter sp/slots/frame are
    real locals again (the internal exec_views indirection that forced them into
    memory is removed and every re-entrant call-out reloads them); the shared
    push-tail, ENTER_FAST and shared dispatch size trade-offs are now gated by
    MCS_VM_COMPACT (default: on only without computed goto; set 1 on flash-tight
    targets to trade speed for ~5 KB of flash).
  • Native calls take their argument vector from a small per-VM arena
    (MCS_NATIVE_ARENA, default 32 slots, 8 in lowram, 0 in min) instead of the heap when enabled.
  • Cut the compile-time cost of namespace-qualified type resolution: cheaper
    name_is library lookup, plus per-compile memoization of known_type_name()
    and type_name() (keyed by enclosing class/scope; a few KB of transient
    compile arena). Output is unchanged; tests/t35_type_scope.cs covers
    same-named types in different namespaces, nested classes and using. For VMs
    with heap limits at or below 64 KiB, use the uncached lookup to protect the
    application memory budget (compilation can be slower).
  • Inline float/int and float/float arithmetic and comparisons in the VM's speed
    layout, including optimized superinstructions. The generic paths remain for
    other types and operations. MCS_VM_COMPACT=1 retains the smaller layout;
    the flash cost on microcontrollers still needs measurement. Numeric edge
    cases are covered by tests/t36_float_fastpath.cs.
  • Fit the 256 KiB Cortex-M0 reference builds with compact dispatch and the
    runtime-only variant with heap-backed native arguments. Fit the G474 firmware
    with compact dispatch and LTO; ESP32-C6 BLE defaults to
    compact dispatch through menuconfig. These retain features and storage layout,
    but may reduce runtime speed relative to the fast VM.
  • Add -DMCS_STACK_STRESS test mode (relocate stack/frames on every growth,
    poison the old block) and tests/t34_stack_relocation.cs.

Optional LVGL 8.x / 9.x binding

  • New opt-in MCS_ENABLE_LVGL: scripts call the LVGL C API with its C names (lv_button_create, LV_ALIGN_CENTER, lv_style_t, ...) on
    LVGL 8.0 to 9.x. The name tables and wrappers are generated from the LVGL headers (tools/lvgl_gen); v8 and v9 spellings both work.
    Events, timers, animations and async calls take lambdas; pointers are objects with identity and deleted objects raise
    ObjectDisposedException; images and fonts load from the MicroCS file system through an LVGL drive. LVGL is not bundled and the firmware does the
    port. See docs/LVGL.md.
  • Fix all-release LVGL builds at version boundaries: guard APIs unavailable before 8.3/9.1, adapt observer user data on 9.0/9.1, restore 9.0 screen aliases and support deprecated 9.6 APIs under strict warnings.
  • Build support: CMake (cmake/MicroCSLvgl.cmake), ESP-IDF and Zephyr Kconfig, Arduino (make_arduino.py --lvgl), PlatformIO, microcs.mk;
    make mcs-lvgl / lvgl-test / fetch-lvgl / lvgl-api; mcs --lvgl[=WxH] in-memory display on the host; capability Lvgl.
  • Studio: LVGL completion, hover and signature help (lazy-loaded data) and the LVGL graphics template category, including keyboard, calendar, canvas, dashboard and tree-walk examples.
  • Prevent reuse of the same font wrapper after an explicit font destroy; add lifetime/GC stress and explicit cleanup tests. Font and style cleanup still belongs to the script or host.

MicroCS 1.19.0 — Studio workbench and editor intelligence

Choose a tag to compare

@github-actions github-actions released this 27 Oct 16:46
b930916

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.19.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.19.0-<chip>.bin esptool.py --chip <chip> write_flash 0 microcs-1.19.0-<chip>.bin
STM32 Nucleo-F401RE / F411RE / F446RE / G474RE / L476RG / H743ZI microcs-1.19.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.19.0-blackpill_f411ce.bin USB DFU (hold BOOT0, reset): dfu-util -a 0 -s 0x08000000:leave -D microcs-1.19.0-blackpill_f411ce.bin, or ST-LINK; console = USART1 (PA9 TX, PA10 RX) via a USB-serial adapter
Linux x64 mcs-1.19.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.19.0.zip Sketch → Include Library → Add .ZIP Library
  • Refresh Studio with calmer dark/light chrome, separate action/document rows,
    file breadcrumbs, keyboard-accessible tabs and a collapsible explorer.
  • Add a keyboard-driven command palette (Ctrl+Shift+P) and open-file switcher
    (Ctrl+P), with disabled-state checks and focus restoration.
  • Improve scope-aware completion, this/base and method-return inference,
    nested generic/dictionary value types and signature argument counting.
  • Share protected-string/comment masking between the formatter and language
    service. Format code around multiline literals without rewriting their bytes;
    preserve CRLF, support indentation widths and retain carets inside literals.
  • Editor changes are browser-only: no new firmware polling, runtime dependency
    or per-read heap work. Upgrade project/package versions to 1.19.0.

MicroCS 1.18.0 — File streams and Studio improvements

Choose a tag to compare

@github-actions github-actions released this 27 Oct 15:44
d3c36c0

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.18.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.18.0-<chip>.bin esptool.py --chip <chip> write_flash 0 microcs-1.18.0-<chip>.bin
STM32 Nucleo-F401RE / F411RE / F446RE / G474RE / L476RG / H743ZI microcs-1.18.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.18.0-blackpill_f411ce.bin USB DFU (hold BOOT0, reset): dfu-util -a 0 -s 0x08000000:leave -D microcs-1.18.0-blackpill_f411ce.bin, or ST-LINK; console = USART1 (PA9 TX, PA10 RX) via a USB-serial adapter
Linux x64 mcs-1.18.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.18.0.zip Sketch → Include Library → Add .ZIP Library
  • Release detached lazy API registrations when initialization runs out of
    memory; fault-injection tests verify complete pool and file-handle cleanup.

  • Fix EOF reads at the FileStream position ceiling and prevent oversized POSIX
    file metadata from wrapping to a small length; add allocation-failure cleanup
    and sparse-file boundary regressions.

  • Fetch CI dependencies from signed official HTTPS Ubuntu repositories instead
    of the runner's unreliable Azure HTTP mirror, retaining bounded timeouts.

  • Integrate automatic multi-region heaps with the FileStream build, preserving
    both opt-outs in the static-pool, flash-constrained Cortex-M0 reference.

  • Bound CI package mirror requests, retries and installation time; fail on missing
    indexes instead of stalling the Pico build before compilation for six hours.

  • Add bounded-memory C# FileStream byte-range reads/writes, seek/position,
    flush/disposal and portable backend operations with automatic handle cleanup.

  • Default Studio templates to a persistent Supported only filter; show all
    remains available, including unknown/legacy requirements and offline browsing.

  • Publish/read worker activity atomically so concurrent runtime pool callbacks
    do not race when additional workers start or workers finish shutdown.

  • Coalesce repeated Studio file-open clicks by normalized path and connection,
    prevent duplicate device tabs, ignore stale downloads after reconnect, and
    preserve conflicting old drafts as untitled recovery copies.

  • Skip identical saved-file uploads in File mode after fresh device-byte
    verification; changed/new files still upload and compile checks remain intact.
    Device flow control, upload window and firmware RAM budgets are unchanged.

  • Add portable, automatically growing multi-region pools with a hard combined
    backing cap, cross-region realloc, and ownership-safe idle trimming/shutdown.
    Static buffers remain supported; OS-backed targets need only a cap, while
    allocator-free MCUs retain static buffers or a board-provided safe provider.

  • Use an internal-RAM, native-reserve-aware provider in the ESP32 example instead
    of requiring the entire VM pool to fit in one native allocation. Preserve radio
    headroom; report committed backing, ceiling and region count in shell/Studio.

  • Refresh clean Studio device tabs after runs and explorer refreshes, including
    same-size changes and files outside the selected folder. Check the visible
    file on demand while idle in machine mode without overwriting unsaved edits,
    stealing focus, or interrupting foreground scripts and the REPL. Recurring
    file polling is opt-in and off by default to avoid ongoing device/serial work.
    Keep Save busy until its existing refresh completes, preventing late file
    replies from racing the next save/build snapshot without extra device reads.

  • Make Studio Ctrl+` toggle the terminal both closed and open, including from
    the REPL. Ignore held-key repeats and show the shortcut on toolbar/menu controls.

  • Extend the existing dependency-free JSON engine with TryParse, computed and
    inherited instance getters, mixed nested collections, explicit cycle detection
    and optional inclusion of underscore-prefixed members.

  • Validate UTF-8 and surrogate pairs, preserve embedded NUL, reject malformed
    number syntax, and parse complete numeric tokens without truncation. Native
    numeric precision is unchanged; JSON numbers are not arbitrary precision.

  • Add Http.GetJson, PostJson, PutJson, PatchJson and HttpResponse.Json,
    plus feature capabilities for older-firmware checks. JSON works offline on every
    port with List and Dictionary; HTTP still needs the existing socket backend.

  • Release JSON scratch buffers on fatal OOM and fix partially committed dictionary
    growth that could corrupt allocation accounting after a failed resize. Store
    dictionary keys/values in one compact allocation, retain atomic OOM recovery
    without a staged buffer, and compact power-of-two index checks to preserve
    the unchanged 256 KiB Cortex-M0 flash limit.

  • Add a JSON guide, Studio signatures and templates, strict malformed-input and
    allocation-failure tests, and 1,000 round trips in an unchanged 40 KiB test pool.

  • Allow custom Studio UART baud rates with preset suggestions including 74880,
    19200 and 38400. Validate positive 32-bit integer rates before connecting, retain
    115200 as the default, and remember custom rates across reloads/reconnects.

  • Fix compiler-free host builds: only compile the shell result-report helper
    when its source-compiler commands are enabled. Close the browser transport before
    terminating its runtime fixture to prevent teardown-only broken-pipe failures.

  • Add a closeable Studio terminal with a toolbar/menu toggle, Alt+Tab when delivered
    by the OS, Ctrl+J fallback and Ctrl+` to reopen/focus. Preserve output, plotter
    selection and resized height; remember visibility without stopping the device.

  • Automatically replace the previous application on runtime file/Project Run.
    Stop workers, jobs, GPIO/timer callbacks and encoders; release native objects,
    old globals and bytecode before compiling the replacement in the same pool.
    Preserve filesystem mounts/RAM files, uploaded scripts and console/baud.

  • Studio Run requests replacement before build checks when firmware advertises
    Runtime.Replace. Save/Check stay non-destructive; REPL/selection and explicit
    run <file> shared retain shared state. Legacy firmware gets an explicit warning.

  • Add unchanged-app 2,000-cycle real-U8g2 64 KiB rerun coverage without manual
    script cleanup, plus native cleanup, RAM-file, OOM/retry and browser regressions.

MicroCS 1.17.0 — Long-run upload memory recovery

Choose a tag to compare

@github-actions github-actions released this 23 Oct 10:57
0421c94

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.17.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.17.0-<chip>.bin esptool.py --chip <chip> write_flash 0 microcs-1.17.0-<chip>.bin
STM32 Nucleo-F401RE / F411RE / F446RE / G474RE / L476RG / H743ZI microcs-1.17.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.17.0-blackpill_f411ce.bin USB DFU (hold BOOT0, reset): dfu-util -a 0 -s 0x08000000:leave -D microcs-1.17.0-blackpill_f411ce.bin, or ST-LINK; console = USART1 (PA9 TX, PA10 RX) via a USB-serial adapter
Linux x64 mcs-1.17.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.17.0.zip Sketch → Include Library → Add .ZIP Library
  • Separate short-lived compiler/VFS buffers from retained VM objects using
    opposite ends of the same fixed pool; preserve allocation accounting, OOM
    cleanup, live application state and GPIO/timer callbacks during compile checks.
  • Collect unreachable prior-run objects before the first idle source-file read.
  • Reduce 32-bit compiler tokens from 16 to 12 bytes while preserving numeric
    precision, source line/column diagnostics and string-prefix locations.
  • Add an optional compiler-scratch allocator, synchronized runtime wrappers and
    per-worker high-end scratch allocation without a second heap or larger pool.
  • Strengthen the larger-app regression to 2,000 content-edit/upload/check/run
    cycles with 7,500 extra bytes retained in the unchanged 64 KiB application pool.
    Local 10,000-cycle stress passes; the unchanged-main negative control fails on
    cycle 4 with a 512-byte OOM. The separate hard 40 KiB OLED gate remains intact.
  • Expand mixed-allocator, exhaustive OOM-recovery and diagnostic coverage. No
    language features, fonts or default execution ceilings are removed. Host
    simulation and sanitizer results do not substitute for physical-board validation.

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.

MicroCS 1.15.0 — Radio-enabled releases, Bluetooth LE and Studio reliability

Choose a tag to compare

@github-actions github-actions released this 16 Oct 12:25
ba12729

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.15.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.15.0-<chip>.bin esptool.py --chip <chip> write_flash 0 microcs-1.15.0-<chip>.bin
STM32 Nucleo-F401RE / F411RE / F446RE / G474RE / L476RG / H743ZI microcs-1.15.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.15.0-blackpill_f411ce.bin USB DFU (hold BOOT0, reset): dfu-util -a 0 -s 0x08000000:leave -D microcs-1.15.0-blackpill_f411ce.bin, or ST-LINK; console = USART1 (PA9 TX, PA10 RX) via a USB-serial adapter
Linux x64 mcs-1.15.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.15.0.zip Sketch → Include Library → Add .ZIP Library
  • Release firmware — Wi-Fi + ESP-NOW and NimBLE on all supported ESP32-family
    targets according to their onboard radios, including S2, H2, P4, C5 and C61;
    explicit Wi-Fi on Pico W / Pico 2 W. Builds check requested radio configuration
    and linked backend symbols before publishing. Back up scripts before upgrading
    ESP32: the larger app partition moves storage from older no-Wi-Fi releases.

  • Release capability detection — the 1.14.0 release predates the shell caps
    report, while Studio now requires it for peripheral templates. This new version
    produces fresh firmware with capability reporting instead of reusing the old
    release. No hardware is guessed from board names or feature bits.

  • Studio upload responsiveness — save, upload and Run Selection stop a running
    foreground script before entering its occupied operation queue, with a bounded
    wait and an actionable failure instead of an indefinitely queued transfer.

  • RP2 USB output — raw block writes replace byte-by-byte TinyUSB writes, avoiding
    a USB write/task/flush cycle per output byte; binary output is unchanged.

  • Templates — the two-display OLED example requires U8g2 and gets an OLED tag.
    CPU benchmark collection workloads fit fixed 96 / 128 KB release pools, with
    accurate labels and preallocated list capacity rather than a 4,000-entry list
    whose growth needs old and new tagged-value buffers at once.

  • Studio console input — machine-mode Console.ReadLine no longer echoes input
    a second time; raw REPL echo is preserved. Studio forwards trailing spaces in script
    input unchanged, with echo-on/off, multiple-prompt and runtime regressions.

  • Cortex-M flash budget — shared capability lookup / direct peripheral predicates;
    LTO on the 256 KB Cortex-M0 reference targets and benchmark preserves configured
    features while accommodating GCC/newlib size differences.

  • Capability-aware templates — allocation-free shell caps and expanded Hal.Has,
    explicit requires: metadata for every template, connected-board filtering with offline
    browsing and conservative older-firmware fallback. Radio examples check Wi-Fi / BLE /
    ESP-NOW and required roles before referencing optional classes. Software/configuration
    flags and peripheral subfeatures are checked separately; bus support is not device detection.

  • BLE API v2 and examples — backend option read/write discovery without starting the
    radio, configurable scan interval/window (including ESP menuconfig), operation-level role
    flags and Ble.Reset for clean reruns without erasing bonds. Added seven BLE templates
    and matching standalone examples. Fixed lost/ignored passkey writes and misleading no-op
    MTU/PHY/security setters. NimBLE role reports honor the configured roles. BLE remains opt-in in custom builds.

  • Web templates / foreground network lifecycle — moved the raw HTTP example into
    Web server and WebSocket; servers now run until Stop rather than two seconds and use
    port 80. Raw TCP listeners share the host privileged-port fallback used by HttpServer.
    Close sockets, listeners, DNS servers and WebSockets at foreground run exit
    (normal, error or abort), preserving earlier interactive resources. Native server
    loops service idle work and Stop even with busy/stalled clients; propagate cancellation
    through native tail calls and nested route callbacks. Added shell lifecycle regressions.

  • Studio C# highlighting — balanced interpolated/verbatim strings ($@" and @$"),
    including multiline HTML, nested quoted expressions, escaped braces and comments;
    added a dedicated highlighter regression suite.

  • ESP BLE menuconfig — discoverable BLE submenu with prerequisite hints, device name,
    queue / GATT / scan / discovery limits, subscriptions, timeouts and UART buffer. The
    front-end connection limit follows NimBLE (C2 supports at most two); the BLE overlay uses
    two connections. Added BLE builds for C2 / C6 / H2 and IDF 5.5.2 builds for C5 / C61,
    plus non-BLE S2 / P4 checks. Guarded legacy CAN on CAN-FD-only chips (IDF omits
    the legacy TWAI driver there), fixing C5 firmware link failures. C5 / C61 target defaults
    use a 2.5 MB app slot; older chips retain their existing flash layout. Corrected TX-power clamping on C6 / C61 (minimum -15 dBm)
    and the +20 dBm readback on newer controllers. BLE remains opt-in, absent from release builds.

  • HTTP client diagnostics / framing — distinguish a server closing before its status
    line from truncated headers, body or chunks; reject invalid / overflowing chunk lengths,
    invalid chunk terminators, incomplete trailers and overlong response lines. Added local
    wire-format regressions. The basic HTTP GET template no longer depends on a public time
    API and prints a web page instead.

  • Bluetooth LE (docs/BLE.md) — opt-in (MCS_ENABLE_BLE), not in any release
    firmware. C# Ble (radio, name, TX power, MTU, PHY, events), BleAdvertisement (name, UUIDs,
    manufacturer / service data, iBeacon, Eddystone-URL / -UID, raw data), scanning into
    BleDevice (parsed AD fields, beacons), a GATT server (BleService, BleCharacteristic,
    BleDescriptor: read / write / notify / indicate, OnWrite, OnSubscribe, encrypted /
    authenticated permissions), BleConnection in both roles (MTU, RSSI, parameters, pairing), a
    GATT client (BleRemoteService / Characteristic / Descriptor: discovery, long reads and
    writes, subscriptions), security (IO capabilities, passkeys, Secure Connections, bonds),
    BleUart (Nordic UART Service) and BleUuid. Backends: ESP-IDF NimBLE
    (ports/esp32/example/sdkconfig.ble), Pico W / Pico 2 W BTstack (-DMICROCS_BLE=ON, with or
    without FreeRTOS / Wi-Fi), Zephyr Bluetooth host (overlay-ble.conf; the west manifest now
    fetches mbedtls), ArduinoBLE (tools/make_arduino.py --ble; no central / security), and a
    simulated radio with peers for the PC (make mcs-ble, CMake -DMICROCS_BLE=ON, --sim).
    make ble-test (in make check) and CI builds for every backend.

  • Fixed: Pico W / Pico 2 W filesystem — the Wi-Fi firmware (~1.1 MB with the CYW43 blob)
    overlapped the filesystem, which started at 1 MB, so the board silently fell back to a RAM
    disk. Builds with the radio now keep 1.5 MB for the firmware (MCS_RP2_FW_RESERVE) and put
    the filesystem after it.

  • Templates are plain files — tools/studio/templates/<nn-category>/ holds one .cs
    (or .cfg) file per template and a templates.txt that names and describes every file of
    the folder (how to add one). tools/studio/gen_templates.py
    bundles them into templates.js (Studio still runs from file://); --check runs in CI and
    make docs-check, and fails on undescribed, missing or duplicate files. Snippets moved to
    tools/studio/snippets.js.

  • Templates dialog — search matches every word and ranks name hits first, with
    highlighting; Recent category; tags derived from the code (Wi-Fi, OLED, files,
    jobs, threads, DMA, input); line count, copy button and a link to the source file;
    PgUp/PgDn/Home/End, Ctrl+Enter = insert at cursor, Esc clears the search first;
    a link to search all categories when the current one has no hit; narrow-window layout.
    Arrow keys no longer re-render the whole dialog.

  • Fixes — saving a new file (e.g. a template as main.cs) over an existing file on the
    device now asks before replacing it; added templates get a name no open tab uses
    (hello-2.cs); Add / Insert at cursor are disabled without a selection (and Insert
    for read-only tabs); the save dialog selects the name without the extension for any
    extension (it assumed .cs) and accepts a relative path. The Wi-Fi and networking folder
    is 28-wifi-and-networking; test_templates.js fails on a template without source or
    des...

Read more

MicroCS 1.14.0 — Web server, WebSockets and Pico W Wi-Fi

Choose a tag to compare

@github-actions github-actions released this 12 Oct 10:31
9bef7c5

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.14.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 / ESP32-S3 / ESP32-C2 / ESP32-C3 / ESP32-C6 microcs-1.14.0-<chip>.bin esptool.py --chip <chip> write_flash 0 microcs-1.14.0-<chip>.bin
STM32 Nucleo-F401RE / F411RE / F446RE / G474RE / L476RG / H743ZI microcs-1.14.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.14.0-blackpill_f411ce.bin USB DFU (hold BOOT0, reset): dfu-util -a 0 -s 0x08000000:leave -D microcs-1.14.0-blackpill_f411ce.bin, or ST-LINK; console = USART1 (PA9 TX, PA10 RX) via a USB-serial adapter
Linux x64 mcs-1.14.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
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.14.0.zip Sketch → Include Library → Add .ZIP Library

The server side of the network, Wi-Fi on the Raspberry Pi Pico W / Pico 2 W, and Studio
templates regrouped by peripheral. Reference: docs/NETWORK.md.

  • HttpServer — new HttpServer([address, ]port); routes Get / Post / Put /
    Delete / Patch / On([method, ]path, handler) with {param} and * prefix paths,
    NotFound, ServeFiles(urlPrefix, folder) (index.html, MIME types, .gz copies), Cors,
    Start / Poll(ms) / Run / Stop, Port, Requests. Handlers return a string (HTML),
    byte[] or any object (JSON) — or answer through HttpRequest: Method, Path,
    Query, Headers, Header(name), Body / Bytes / Json, Param(name[, default]) (path,
    query and form fields), Send, SendJson, SendStatus, SendFile, Redirect,
    SetHeader, Authenticate (HTTP Basic).
  • WebSocket — endpoints on an HttpServer (web.WebSocket(path, onMessage[, onOpen[, onClose]]), Broadcast) and a client (Connect("ws://…" / "wss://…"), Send text or
    binary, Receive, OnMessage + Poll, Ping, Close(code, reason), CloseStatus);
    fragmented messages, pings and close handshakes handled; new WebSocketException.
  • DnsServer — answers every name (or one Domain) with the board's address for
    captive portals; served by HttpServer.Poll too.
  • Wifi.Wps([timeout[, save]]) (push button) and Wifi.SmartConfig(...) (ESP-Touch /
    AirKiss) on the ESP32 and in the simulator; network backends get an optional provision
    entry (MCS_NET_API_VERSION 2).
  • Raspberry Pi Pico W / Pico 2 W — new backend ports/rp2/mcs_port_rp2_net.c on
    pico_cyw43_arch_lwip_sys_freertos: station + AP, scan, events, static IP, hostname,
    country, power save, TX power, auto-reconnect, DHCP server for AP clients, SNTP, mDNS,
    ping, sockets, Http, the servers and WebSocket. CMake option MICROCS_WIFI (on by
    default for *_w boards with MICROCS_OS=freertos), ports/rp2/wifi/lwipopts.h, the
    on-board LED as pin "LED" / "WL_GPIO0", RTC through settimeofday. CI builds and the
    release page get pico_w and pico2_w firmware.
  • Saved networks without NVS — Wifi.Save / Forget / SavedSsid fall back to the file
    /.wifi (MCS_WIFI_CREDS_FILE) on ports without their own store; Net.Has("Wifi.Save").
  • New Net.Has names "HttpServer", "WebSocket", "DnsServer", "Wifi.Wps",
    "Wifi.SmartConfig", "Wifi.Save"; Net.Backend "rp2". Options
    MCS_HTTP_SERVER_MAX_ROUTES, MCS_HTTP_SERVER_TIMEOUT, MCS_WS_MAX_MESSAGE,
    MCS_WS_MAX_CLIENTS, MCS_RP2_HOSTNAME, MCS_RP2_WIFI_RETRIES, MCS_RP2_RECONNECT_MS,
    MCS_RP2_DHCPS_LEASES.
  • PC — servers bind ports below 1024 at port + 8000 when that needs root (:80 →
    :8080, noted on stderr); tests/test_net_server.py tests the HTTP, WebSocket and DNS
    servers against Python clients.
  • Studio — templates regrouped by peripheral: GPIO, PWM, ADC, UART, I2C and SPI each
    carry their settings and async versions, new categories QSPI, I2S audio, CAN,
    Board and system; new Web server and WebSocket category (LED web page, REST API,
    live WebSocket dashboard, WebSocket client, captive portal, files from flash, WPS /
    SmartConfig) and ESP-NOW (messages, broadcast, encrypted peers) — 194 templates;
    snippets httpserver, route, wsserver, wsclient, captive, wps; completions,
    hover and parameter info for HttpServer, HttpRequest, WebSocket, DnsServer and
    the new Wifi methods. Template tests run the server templates one at a time.

MicroCS 1.13.0 — Wi-Fi & networking

Choose a tag to compare

@github-actions github-actions released this 12 Oct 05:16
7cfd87b

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 / RP2040-Zero microcs-1.13.0-<board>.uf2 hold BOOTSEL, plug in, copy the file to the RPI-RP2 drive
ESP32 / ESP32-S3 / ESP32-C2 / ESP32-C3 / ESP32-C6 microcs-1.13.0-<chip>.bin esptool.py --chip <chip> write_flash 0 microcs-1.13.0-<chip>.bin
STM32 Nucleo-F401RE / F411RE / F446RE / G474RE / L476RG / H743ZI microcs-1.13.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.13.0-blackpill_f411ce.bin USB DFU (hold BOOT0, reset): dfu-util -a 0 -s 0x08000000:leave -D microcs-1.13.0-blackpill_f411ce.bin, or ST-LINK; console = USART1 (PA9 TX, PA10 RX) via a USB-serial adapter
Linux x64 mcs-1.13.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
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.13.0.zip Sketch → Include Library → Add .ZIP Library

C# scripts get the network on every ESP32 with a radio (ESP32, S2, S3, C2, C3, C5, C6), and
real sockets + HTTP on the PC. Reference: docs/NETWORK.md.

  • Wifi — station, soft access point and both at once: Connect(ssid, password[, timeout[, bssid, channel]]) (returns false with StatusName / ReasonName() instead of throwing),
    Begin + WaitConnected (non-blocking), ConnectEnterprise (WPA2/WPA3-Enterprise, IDF 5.1+),
    Reconnect, Disconnect, Off; Scan([hidden]) → WifiNetwork (SSID, BSSID, RSSI, channel,
    security, protocols, quality); StartAp / StopAp / ApClients (MAC, IP, RSSI) / SetApIp;
    SetStaticIp / UseDhcp, Ip, Netmask, Gateway, Dns, Dns2, Ipv6, Mac / ApMac;
    options Hostname, Country, TxPower, PowerSave, Protocol / ApProtocol (incl. LR and
    11ax), Bandwidth, Band (5 GHz on dual-band chips), MinAuth, ListenInterval,
    AutoReconnect, Persistent, Antenna; WPA3-SAE and PMF automatically.
  • Events — Wifi.OnEvent((ev, value) => …) on the script thread: connected, got/lost IP,
    disconnected (with reason), scan done, AP start/stop, station joined/left/assigned, ESP-NOW,
    NTP sync. They travel through the HAL event ring (MCS_HAL_EV_NET).
  • Saved networks — Wifi.Save / Forget / SavedSsid in NVS; Wifi.Connect() joins it.
    menuconfig Connect at boot (CONFIG_MICROCS_WIFI_SSID / _PASSWORD /
    _AUTOCONNECT) joins before /main.cs runs (mcs_esp32_wifi_autoconnect() for your own
    firmware).
  • EspNow — Start, AddPeer(mac[, channel[, key]]), RemovePeer, SetPmk, Send with
    delivery report, Broadcast, Receive → EspNowMessage, OnReceive((mac, data) => …).
  • Ntp (SNTP, POSIX time zones, LocalTime / UtcTime / UtcOffset), Mdns (host
    name, services, .local lookups — with the espressif/mdns component, detected
    automatically), Ping, Net.Has(feature) / Net.Backend (also via Hal.Has).
  • Sockets — TcpClient (connect timeout, ConnectTls, Write / WriteLine / Read /
    ReadLine / ReadToEnd / ReadByte, Timeout, NoDelay, KeepAlive, endpoints),
    TcpListener (AcceptTcpClient(timeout) → null, Pending, port 0), UdpClient
    (Send / Receive(timeout), broadcast, multicast), Dns. New exceptions SocketException
    (an IOException) and HttpRequestException.
  • Http — HTTP/1.1 client: Get, Head, Delete, Post, Put, Patch, Request,
    GetString, Download (streamed to a file, atomic rename), UrlEncode; headers as
    Dictionary<string, string>, lines or string[]; redirects, chunked bodies, Timeout,
    UserAgent; HttpResponse (StatusCode, Body, Bytes, Header(name),
    EnsureSuccess() …). HTTPS through esp-tls and the ESP-IDF certificate bundle (or your CA).
  • Json (every port, MCS_ENABLE_JSON) — Json.Parse → Dictionary<string, object> /
    List<object> / numbers / strings, Json.Stringify(value[, indent]) for collections, values
    and script objects, Json.Escape, and JsonSerializer.Serialize / Deserialize.
    Off in the min profile and in the 256 KB-flash Cortex-M0 reference firmware (-DMCS_ENABLE_JSON=0).
  • Simulator — ./mcs --sim adds a simulated radio (networks, wrong-password / not-found
    paths, AP clients, ESP-NOW echo peer, mDNS, ping); sockets and HTTP use the PC's network.
  • ESP32 port — ports/esp32/mcs_port_esp32_net.c; menuconfig MicroCS → Wi-Fi and
    networking
    (CONFIG_MICROCS_WIFI, on by default on chips with Wi-Fi;
    CONFIG_MICROCS_WIFI_RESERVE_KB keeps RAM for the driver). The driver starts only when a
    script first uses Wi-Fi. The example's partitions.csv now has a 2 MB app partition
    (Wi-Fi + TLS ≈ 1.6 MB) and ~1.9 MB LittleFS — reflashing it re-formats the storage
    partition, so copy your scripts off first (or keep the old layout: partitions_nowifi.csv
    with CONFIG_MICROCS_WIFI=n).
  • Release files stay without Wi-Fi — the ready-to-flash ESP32 images are built with
    CONFIG_MICROCS_WIFI=n and the unchanged 1.5 MB app / 2.4 MB LittleFS layout
    (partitions_nowifi.csv), so updating them keeps your files; the Arduino library zip leaves
    modules/net out. Wi-Fi is for firmware you build from ports/esp32/example.
  • Studio — 16 Wi-Fi and networking templates (connect, events, scan, soft AP, options,
    saved network, HTTP GET/POST JSON, HTTPS download, web server, TCP, UDP, NTP clock, ESP-NOW,
    mDNS + ping, MQTT publish), 10 new snippets, completions for every new class.
  • Config — MCS_ENABLE_NET, MCS_ENABLE_SOCKETS, MCS_NET_SIM, MCS_NET_TIMEOUT,
    MCS_WIFI_CONNECT_TIMEOUT, MCS_WIFI_SCAN_MAX, MCS_NET_MAX_READ, MCS_HTTP_MAX_BODY,
    MCS_HTTP_MAX_HEADER, MCS_HTTP_MAX_REDIRECTS, MCS_ESPNOW_MAX_PEERS, MCS_NET_SLICE_MS,
    MCS_ESP32_WIFI_RETRIES, MCS_ESP32_ESPNOW_QUEUE, MCS_ENABLE_JSON — all in the
    config/mcs_user_config.h template.
  • Fixes — when a native stops early because the run must end (Ctrl-C, Studio Stop,
    --time-limit), the run now ends with the abort instead of a follow-up error such as a
    NullReferenceException on the native's result. New public C API mcs_dict_len /
    mcs_dict_at for modules.
  • Docs — new NETWORK.md; README, ESP32 port README and guide,
    ARCHITECTURE, HAL, PORTING, CONFIGURATION, TESTING and STDLIB (now also listing the
    network, threads and U8g2 classes) updated.
  • Tests — t24_net (whole network API on the simulated radio, TCP/UDP over loopback),
    t25_json, tests/test_net.py (25 HTTP checks against a local server, part of make test).

MicroCS 1.12.1 — Reliable uploads on ESP32 native USB; Studio templates for U8g2, peripheral settings and DMA

Choose a tag to compare

@github-actions github-actions released this 11 Oct 21:07
957d581

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 / RP2040-Zero microcs-1.12.1-<board>.uf2 hold BOOTSEL, plug in, copy the file to the RPI-RP2 drive
ESP32 / ESP32-S3 / ESP32-C2 / ESP32-C3 / ESP32-C6 microcs-1.12.1-<chip>.bin esptool.py --chip <chip> write_flash 0 microcs-1.12.1-<chip>.bin
STM32 Nucleo-F401RE / F411RE / F446RE / G474RE / L476RG / H743ZI microcs-1.12.1-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.12.1-blackpill_f411ce.bin USB DFU (hold BOOT0, reset): dfu-util -a 0 -s 0x08000000:leave -D microcs-1.12.1-blackpill_f411ce.bin, or ST-LINK; console = USART1 (PA9 TX, PA10 RX) via a USB-serial adapter
Linux x64 mcs-1.12.1-<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
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.12.1.zip Sketch → Include Library → Add .ZIP Library
  • Reliable uploads on ESP32 USB-Serial-JTAG (ESP32-C3 / C6 / S3 / H2 native USB). Saving a
    script from Studio sometimes stalled ("upload stalled - retrying slower") because ESP-IDF's
    USB-Serial-JTAG driver silently drops received bytes when its 256-byte buffer is full —
    which happened while LittleFS erased a flash block or while the console waited on UART0.
    Fixes: put <f> <len> <window> — the device acknowledges every window with \x04MORE
    (MCS_SHELL_PUT_WINDOW, 256), so the host can never overrun it (Studio and
    tools/mcs_remote.py use it; older firmware still gets the plain stream); the ESP32 console
    installs the driver with a 4 KB receive buffer (MCS_ESP32_USB_RXBUF) and sleeps on the USB
    port instead of UART0 while a USB host is attached.
    RP2040 was never affected: TinyUSB holds the host off (USB NAK) instead of dropping bytes.
  • Studio templates for U8g2 / U8x8 displays. A new U8g2 displays category with 20
    scripts that together cover the whole API: hello, every bus (I2C, SoftI2C, SPI,
    SoftSPI, Soft3WireSPI, 8080 / 6800, KS0108), all shapes, text / alignment / font metrics,
    fonts from files and byte[], XBM bitmaps and icons, rotation / flip / contrast / sleep /
    draw colours / clipping, page mode (Draw, FirstPage / NextPage), Print, buttons and
    text bars, the built-in menus (scripted with SetMenuInput), a custom menu with
    GetMenuEvent, the u8log terminal, a dashboard, a clock, an animation with
    UpdateDisplayArea, buffer screenshots (GetBuffer, Dump, WriteBufferXBM), U8x8 text and
    status screens, two displays. Snippets u8g2, u8frame, u8page, u8x8; Studio completion,
    signature help and hover for every U8g2 / U8x8 member. tests/studio/test_templates.js
    runs them on the simulated SSD1306 with a u8g2 build (new CI step).
  • Studio templates for peripheral settings and DMA. 17 new ready-to-run templates in two
    new categories: Peripheral settings (what the board supports, button / LED / open-drain
    GpioConfig, I2C, SPI and UART on your own pins, PwmConfig, AdcConfig, board options and
    reusable settings) and DMA (DmaBuffer, SPI.WriteAsync in the background, a
    double-buffered display loop, I2C.WriteReadAsync, UART.ReadAsync with timeout / cancel,
    QSPI.ReadAsync, Dma.Copy / Fill). New snippets gpiocfg, i2ccfg, spicfg, uartcfg,
    dmabuf, spiasync. Studio now has 169 C# templates and 61 snippets; CI runs every one on the
    simulated board.

MicroCS 1.12.0 — Peripheral configuration and DMA (HAL API v3)

Choose a tag to compare

@github-actions github-actions released this 11 Oct 12:06
82789c9

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 / RP2040-Zero microcs-1.12.0-<board>.uf2 hold BOOTSEL, plug in, copy the file to the RPI-RP2 drive
ESP32 / ESP32-S3 / ESP32-C2 / ESP32-C3 / ESP32-C6 microcs-1.12.0-<chip>.bin esptool.py --chip <chip> write_flash 0 microcs-1.12.0-<chip>.bin
STM32 Nucleo-F401RE / F411RE / F446RE / G474RE / L476RG / H743ZI microcs-1.12.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.12.0-blackpill_f411ce.bin USB DFU (hold BOOT0, reset): dfu-util -a 0 -s 0x08000000:leave -D microcs-1.12.0-blackpill_f411ce.bin, or ST-LINK; console = USART1 (PA9 TX, PA10 RX) via a USB-serial adapter
Linux x64 mcs-1.12.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
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.12.0.zip Sketch → Include Library → Add .ZIP Library
  • Configuration objects for every peripheral. GpioConfig, UartConfig, I2cConfig,
    SpiConfig, QspiConfig, PwmConfig and AdcConfig carry the settings a vendor SDK takes in
    its init struct — pins, pulls, slew rate / speed, drive strength, Schmitt trigger, pad hold,
    hardware inversion, glitch filters, initial output level, alternate functions, buffer sizes,
    RS-485, three-wire SPI, sampling delay, ADC attenuation / oversampling, PWM resolution /
    polarity / centre alignment, DMA on / off. New overloads: GPIO.Configure, new Pin(pin, cfg),
    pin.Configure, UART.Open(port, cfg), I2C.Open(bus, cfg), SPI.Open(bus, cfg),
    new SpiDevice(bus, cs, cfg), QSPI.Open(bus, cfg), PWM.Configure, ADC.Configure.
    Unset properties stay at the board default; values are range-checked on assignment; a board
    that cannot honour a setting throws NotSupportedException / ArgumentException with the
    reason (DriveMa: 2, 4, 8 or 12 mA). Nothing is silently ignored.
  • Board options: chip-specific settings by name (cfg.Set("queue_size", 8)), listed with
    their range and help by Hal.Options([peripheral]).
  • DMA and asynchronous transfers. DmaBuffer (DMA-capable memory), SPI.TransferAsync / WriteAsync / ReadAsync, I2C.WriteAsync / ReadAsync / WriteReadAsync, UART.WriteAsync / ReadAsync, QSPI.ReadAsync / WriteAsync, device-object variants, and Dma.Copy / Fill / CopyAsync / FillAsync / WaitAll. Each returns a DmaTransfer (Wait, OnComplete,
    Cancel, Result, Error). Transfers stay in order per bus, keep their buffers alive and
    complete through the event queue, never in an interrupt. Synchronous SPI.Write / Read and
    QSPI.Read accept DmaBuffers of any size. Boards without DMA run the same calls
    synchronously, so scripts are portable. Hal.Has("DMA.SPI") & co. tell what really runs in
    the background.
  • ESP32 port: everything — runtime pins for UART / I²C / SPI / QSPI / PWM (no more C pin
    tables needed), GPIO filters (pin and flex glitch filters), hold, invert, drive; UART buffers,
    inversion, RS-485 half duplex, RX timeout; I²C pull-ups and filter; SPI three-wire, input delay,
    max transfer; LEDC resolution / invert; ADC attenuation / resolution / oversampling; SPI and
    QSPI transfers on DMA, async memcpy on GDMA chips, DmaBuffer in internal DMA-capable RAM.
  • RP2040 / RP2350 port: GPIO pulls, drive, slew, Schmitt, alternate function, invert (pad
    overrides or software), glitch-free initial level; runtime UART / I²C / SPI pins, UART
    inversion and RTS / CTS, I²C spike filter, pull-ups and timeout; PWM resolution, polarity and
    phase-correct mode; ADC oversampling; SPI transfers and memory copy / fill on DMA.
  • STM32 port: GpioConfig (pull, speed, open drain, alternate function) and PwmConfig
    (polarity, centre-aligned). Zephyr, Arduino and Cortex-M keep the basic settings.
  • Simulator implements and validates every setting and runs DMA transfers through the event
    queue, so scripts can be tested on a PC (mcs --sim --sim-virtual).
  • C API: MCS_HAL_API_VERSION 3. New optional mcs_hal_t members (*_configure, options,
    dma_alloc / dma_free / dma_align / dma_channels, dma_copy, dma_abort,
    spi_transfer_async, i2c_transfer_async, uart_write_async, uart_read_async,
    qspi_command_async), mcs_*_config_init(), mcs_hal_opt(), mcs_hal_error(),
    MCS_HAL_EV_DMA; MCS_HAL_MAX_DMA, MCS_HAL_MAX_OPTS and MCS_ENABLE_HAL_DMA (leave the DMA
    classes out, ~11 KB; off in the 256 KB Cortex-M0 reference build) in mcs_user_config.h;
    mcs_userdata_of(). A port can return MCS_HAL_ENOTSUP from an async call to get the
    synchronous fallback. Board tables written for v1 / v2 compile and work unchanged.
  • Docs: Peripheral configuration, DMA, step-by-step
    guides for peripheral settings and DMA,
    example 17_config_dma.cs, Studio completions for every new class.