[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-107759":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":15,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":17,"rankGlobal":10,"rankLanguage":10,"license":18,"archived":19,"fork":19,"defaultBranch":20,"hasWiki":21,"hasPages":19,"topics":22,"createdAt":10,"pushedAt":27,"updatedAt":28,"readmeContent":29,"aiSummary":30,"trendingCount":15,"starSnapshotCount":15,"syncStatus":31,"lastSyncTime":32,"discoverSource":33},107759,"memmap","iharhl\u002Fmemmap","iharhl","Datasheet-style memory maps for MCUs, from a YAML layout, a firmware ELF and linker map, or an ESP-IDF, Zephyr or nRF Connect SDK partition table. Renders to SVG, PNG or PDF.","",null,"Python",80,5,61,0,19,44.23,"MIT License",false,"main",true,[23,24,25,26],"diagram-generator","embedded","memory-layout","memory-map","2026-11-14 11:06:24","2026-11-16 04:04:18","# memmap\n\nTurn a YAML description of an MCU memory layout into a datasheet-style memory map image. The look\nfollows the STM32 reference manual figures, for your own layouts: bootloaders, app slots, config\nsectors, shared RAM.\n\n- One YAML file holds the memory (`memory`) and how to draw it (`view`), kept separate.\n- Validation catches overlaps, overflow and flash sector misalignment, with YAML path, line and hint.\n- Output is deterministic, and `describe` lists everything drawn, so agents and CI can verify it\n  as text.\n\nBelow find an example with four memory maps drawn by **memmap**.\n\n![](docs\u002Fexamples.svg)\n\n## Install\n\nEach [GitHub release](https:\u002F\u002Fgithub.com\u002Fiharhl\u002Fmemmap\u002Freleases) has a wheel attached. To install\nit with Python 3.10 or newer and no uv or checkout, using the version you want:\n\n```bash\npipx install https:\u002F\u002Fgithub.com\u002Fiharhl\u002Fmemmap\u002Freleases\u002Fdownload\u002Fv0.2.0\u002Fmemmap-0.2.0-py3-none-any.whl\n```\n\nTo work from a checkout:\n\n```bash\nuv sync\n```\n\nPNG and PDF output needs the `raster` extra and the system cairo library:\n\n```bash\nuv sync --extra raster\n```\n\nOn macOS with Homebrew's cairo, the library is not on the default search path, so set this before\nrendering PNG or PDF:\n\n```bash\nexport DYLD_FALLBACK_LIBRARY_PATH=\u002Fopt\u002Fhomebrew\u002Flib\n```\n\n## Use\n\nStart from the closest config in [examples\u002F](examples\u002F), listed under [Examples](#examples):\n\n```bash\ncp examples\u002Fcustom_bootloader.yaml layout.yaml\n```\n\n```bash\nuv run memmap check layout.yaml\n```\n\n```bash\nuv run memmap describe layout.yaml\n```\n\n```bash\nuv run memmap render layout.yaml -o layout.svg\n```\n\n| Command | Purpose |\n| --- | --- |\n| `memmap render CONFIG [-o OUT] [--format svg\\|png\\|pdf] [--json] [--strict] [--set key=value]` | Validate, then draw; `--strict` fails on warnings |\n| `memmap check CONFIG [--json] [--strict]` | Validate only; `--strict` fails on warnings |\n| `memmap describe CONFIG [--json]` | Resolved regions, blocks, labels and option origins |\n| `memmap from-elf ELF [-o OUT] [--map FILE] [--region id=start:size[:name]] [--min-size N] [--force] [--json] [--strict]` | Write a config from a linked ELF's sections, then check it |\n| `memmap schema` | JSON Schema of the config |\n| `memmap guide` | Print the agent guide, for agents using an installed copy |\n\n### From an ELF file\n\n`from-elf` writes a config from the sections of a linked firmware image, each at its real\naddress and size. The ELF does not record how big flash and RAM are, so pass the map file the\nlinker writes, from GNU ld, Keil (armlink) or IAR:\n\n```bash\nuv run memmap from-elf build\u002Ffirmware.elf -o layout.yaml --map build\u002Ffirmware.map\n```\n\nAn lld map, as Rust and the LLVM Embedded Toolchain write, lists no regions. Give them with\n`--region` instead, copying `ORIGIN` and `LENGTH` from the linker script's `MEMORY` block:\n\n```bash\nuv run memmap from-elf build\u002Ffirmware.elf -o layout.yaml --region flash=0x08000000:64K --region ram=0x20000000:20K\n```\n\nThe output is an ordinary config: edit it, then `render` it. [docs\u002Ffrom-elf.md](docs\u002Ffrom-elf.md)\ncovers where each toolchain puts its map, what is read from it, what happens when it is not\nenough, and how sections become blocks.\n\nA minimal config:\n\n```yaml\nversion: 1\nfigure: { title: \"Flash layout\" }\nmemory:\n  regions:\n    - id: flash\n      start: 0x08000000\n      size: 64K\n      sectors: { size: 2K, count: 32 }\n      children:\n        - { id: boot, name: Bootloader, size: 16K }\n        - { id: app, name: Application, size: auto }\nview:\n  defaults:\n    labels:\n      address: both\n      size: true\n    scale: { mode: linear }\n  columns:\n    - { id: flash_col, root: flash, title: Flash }\n```\n\nColumns take an optional `title`, drawn above them. For a detail column created by `view.expand`,\nset it on the expansion: `expand: [{ region: flash, title: Flash }]`.\n\n## Learn more\n\n- [AGENTS.md](AGENTS.md): task guide, recipes and the full diagnostic list. `memmap guide` prints it.\n- [docs\u002Ffrom-elf.md](docs\u002Ffrom-elf.md): drawing a linked firmware image, its map readers and limits.\n- [examples\u002F](examples\u002F): see the table below.\n- `memmap schema`: every key with a description and an example. Point your editor's YAML extension\n  at it for completion.\n\n## Examples\n\n| Example | Shows |\n| --- | --- |\n| [custom_bootloader.yaml](examples\u002Fcustom_bootloader.yaml) | Sequential placement, `auto` and `align: end`, sector checks, linear scale, colour palette |\n| [stm32f303_fig8.yaml](examples\u002Fstm32f303_fig8.yaml) | Datasheet replica: numbered bands, zooms anchored to the top and bottom, `top_label`, legend |\n| [stm32f051_fig10.yaml](examples\u002Fstm32f051_fig10.yaml) | Datasheet replica: reserved labels, staggered zooms with `anchor: free` and `offset` |\n| [stm32f407_ota.yaml](examples\u002Fstm32f407_ota.yaml) | Mixed sector sizes, `fill_gaps: error`, weighted scale with `max_height`, notes |\n| [nrf52840_boot_chain.yaml](examples\u002Fnrf52840_boot_chain.yaml) | Chained zooms, column `range`, per-column labels and scale, `start_of_next` |\n| [riscv64_soc.yaml](examples\u002Friscv64_soc.yaml) | 64-bit addresses, `collapse_reserved_over`, relative heights, style options |\n| [rtos_mpu_ram.yaml](examples\u002Frtos_mpu_ram.yaml) | `check_alignment`, `fill_gaps: none`, `depth`, two columns of one memory |\n\nTo render them all into `build\u002F`:\n\n```bash\nmkdir -p build\n```\n\n```bash\nfor f in examples\u002F*.yaml; do uv run memmap render \"$f\" -o \"build\u002F$(basename \"${f%.yaml}\").svg\"; done\n```\n\n## Develop\n\n```bash\nuv run pytest\n```\n\nCheck types and style. mypy finds type errors, ruff finds missing annotations and lint issues:\n\n```bash\nuv run mypy\n```\n\n```bash\nuv run ruff check\n```\n\nGolden SVGs live in `tests\u002Fgolden\u002F`. After an intended drawing change, review the diff and\nregenerate them:\n\n```bash\nMEMMAP_UPDATE_GOLDEN=1 uv run pytest tests\u002Ftest_golden.py\n```\n\n`from-elf` is also tested on real firmware images and linker maps, kept as small snapshots with\ngoldens. After an intended change to the importer, the map readers or the drawing, review and\nregenerate those too:\n\n```bash\nMEMMAP_UPDATE_GOLDEN=1 uv run pytest tests\u002Ftest_elf_snapshots.py tests\u002Ftest_linker.py\n```\n\n[docs\u002Ffrom-elf.md](docs\u002Ffrom-elf.md#testing) explains the approach and shows the drawings.\n\nText is measured with a built-in Helvetica\u002FArial width table, so wrapping is slightly approximate\nfor other fonts.\n\nTo cut a release, see [RELEASING.md](RELEASING.md).\n","memmap 是一个嵌入式系统内存布局可视化工具，将 YAML 描述或固件 ELF 文件及其链接器映射文件转换为数据手册风格的内存映射图。它支持地址与尺寸校验、Flash 扇区对齐检查，并输出 SVG\u002FPNG\u002FPDF 格式图像；采用分离式配置（memory 定义物理资源，view 控制渲染样式），具备确定性输出和结构化描述能力。适用于 MCU 固件开发中 bootloader、应用分区、配置扇区等内存规划的文档生成与 CI 验证。",2,"2026-11-24 04:32:50","CREATED_QUERY"]