From b372254eac63fc582ec13f58a65601795e74154b Mon Sep 17 00:00:00 2001 From: Jax Calder Date: Wed, 28 Oct 2026 15:14:39 +0000 Subject: [PATCH 1/2] lib/dmod: dmod develop with the deflate compression method and the firmware SAL The firmware loads the modules with the decoder of dmod, so it has to be able to read "deflate" before the modules are released in it (the packages of the registry are taken as they are, the latest ones). dmod 8264cbb (#341) has it: the "deflate" method of Dmod_Compression_* by dmcomp (a submodule of dmod, which is why a clone needs --recursive; the workflow gets one more safe.directory for it) and the SAL Dmod_FirmwareReady, Dmod_WritePersistency, Dmod_ReadPersistency (-ENOSYS here, for now). The old pin (714c926) is contained in the new one. The firmware: +2.6 kB of code (the decoder; the encoder is not built without the standard library) until its modules are repacked. Checked on the STM32F746G-DISCO: all the modules of /ext repacked with deflate (82 of them, 459 kB -> 376 kB), the services start (carhmi, networkd, dmview, dmaudio, automount, the SD card). Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/build.yml | 2 ++ lib/dmod | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5a1f70d..0a669c0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,6 +34,7 @@ jobs: echo "GITHUB_WORKSPACE: $GITHUB_WORKSPACE" git config --global --add safe.directory "$GITHUB_WORKSPACE" git config --global --add safe.directory "$GITHUB_WORKSPACE/lib/dmod" + git config --global --add safe.directory "$GITHUB_WORKSPACE/lib/dmod/lib/third-party/dmcomp" git config --global --add safe.directory "$GITHUB_WORKSPACE/lib/dmlog" - name: Initialize and update submodules @@ -168,6 +169,7 @@ jobs: run: | git config --global --add safe.directory "$GITHUB_WORKSPACE" git config --global --add safe.directory "$GITHUB_WORKSPACE/lib/dmod" + git config --global --add safe.directory "$GITHUB_WORKSPACE/lib/dmod/lib/third-party/dmcomp" git config --global --add safe.directory "$GITHUB_WORKSPACE/lib/dmlog" - name: Initialize and update submodules diff --git a/lib/dmod b/lib/dmod index 714c926..8264cbb 160000 --- a/lib/dmod +++ b/lib/dmod @@ -1 +1 @@ -Subproject commit 714c9268ab18647fbd497f339105da051c7511eb +Subproject commit 8264cbbc7e7c3bd0cf17bda5491f9efc3beefa5d From 71ab6b33c7a4db30b443700b7c4e41adef7d59e1 Mon Sep 17 00:00:00 2001 From: Jax Calder Date: Wed, 28 Oct 2026 19:24:26 +0000 Subject: [PATCH 2/2] docs: the size of the image with the modules compressed with deflate Measured on the STM32F746G-DISCO build with dmod 8264cbb and the latest packages of the registry: the image is 347 307 B (MinSizeRel), modules.dmp 178 311 B (it was 216 499 B with FastLZ, 382 883 B for the whole image). The note about the tools: an old dmf-get does not read deflate and silently takes the previous release of a module. Co-Authored-By: Claude Sonnet 5.5 --- docs/external-flash.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/external-flash.md b/docs/external-flash.md index 06ff427..b8fdbf9 100644 --- a/docs/external-flash.md +++ b/docs/external-flash.md @@ -77,9 +77,13 @@ For this board: `umount`, `ymodem`, `tty`, `mklittlefs`, and `automount`, which mounts the SD card (see below). The root file system `/` is a read-only dmffs embedded in the image (it holds `/mnt`); `/tmp` is a RAM file system (`dmramfs` on `/ext`, mounted by `/ext/cfg/services/board/tmp.ini`), so nothing can be written before `/ext` is up. Built with - `-DCMAKE_BUILD_TYPE=MinSizeRel` the image is about 382 kB - (160 kB of it the core of the firmware); the `Debug` build type has no optimization at all and the same image is about - 485 kB. + `-DCMAKE_BUILD_TYPE=MinSizeRel` the image is about 347 kB: 161 kB of the core of the firmware (the decoder of the + `deflate` compression included), 178 kB of the modules, 5 kB of the configuration. The modules of the registry are + compressed with DEFLATE (it was FastLZ; 32 of the 35 modules, the other three - `dmini`, `dmhaman`, `dm_sw_ring` - still + are): 178 kB instead of 216 kB. The tools that unpack them have to know `deflate` too - `dmf-get` and `todmp` of + dmod 8264cbb or newer; an older `dmf-get` does not fail, it takes the previous (FastLZ) release of the module. The + `Debug` build type has no optimization at all, and its image is bigger (about 485 kB, measured before the modules were + compressed with DEFLATE). - **Everything else is on `/ext`** (`ext.dmd`, `configs/common/tools.dmd`): the shell tools (`ps`, `cat`, `catini`, `mkdir`, `reboot`, `memory`, `service`, `rm`, `tree`, ...), the Ethernet and Wi-Fi stacks, telnetd, the crypto/secrets modules, the RTC and UTC/NTP, the SD card driver and its file system (dmsdio, dmfatfs,