Skip to content

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.