Skip to content
| Marketplace
Sign in
Visual Studio Code>Visualization>Embedded Map ViewerNew to Visual Studio Code? Get it now.
Embedded Map Viewer

Embedded Map Viewer

joyful-jogo

|
3 installs
| (0) | Free
Offline, zero-dependency visual analyzer for ARMCC/ARMCLANG and GNU LD firmware map files: whole-chip flash map, page heatmap, treemap, icicle, charts, diff and source navigation.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Embedded Map Viewer

Offline, zero-dependency firmware memory analysis for VS Code. Open a Keil ARMCC/ARMCLANG or GNU LD .map file and see the whole chip, not just a table of object sizes. Built for STM32, GD32, NXP, nRF, PAC55xx and other Cortex-M firmware teams, with no vendor-specific module names baked in.

Embedded Map Viewer — whole-chip flash, page grid, hierarchy and ranking

Dark theme (same data, independent dark palette):

Embedded Map Viewer dark theme

Single-axis Pareto chart and the five-table detail surface:

Pareto chart and module table

License: MIT

  • No npm install, no TypeScript build, no CDN, no telemetry.
  • Backend uses only the VS Code API and Node.js built-ins.
  • Frontend is native HTML/CSS/ES6/SVG, split into focused modules.
  • Everything is rendered from local files; map text is always treated as untrusted text.

English

Why another map viewer?

A linker map is an address document. Most viewers stop at a sortable table, so the two questions that actually matter during a release review stay unanswered:

  1. Where is the firmware physically? — including the bootloader, the .data load image, ramfunc, the integrity tail, reserved slots and free holes.
  2. Which module is consuming the next page? — down to a page, a section or a symbol.

Embedded Map Viewer answers both without sending a byte off the machine. It is generic: no vendor, board, company or private project names are hard-coded. The built-in demo is a fictional Cortex-M4 with 128 KiB flash / 1 KiB pages / 32 KiB SRAM.

Features

Area What you get
Formats Keil ARMCC / ARMCLANG armlink maps, GNU LD maps, .ld linker scripts, Keil .sct scatter files, Program Size: build logs, CSV fallback
Whole chip Physical flash panorama, address ruler, bootloader / Code+RO / .data load image (compressed or plain) / ramfunc image / integrity tail / custom partitions / free holes
Pages Page or sector heat grid (512 B–16 KiB), hover fill ratio + top objects, click to filter every view
SRAM Physical SRAM bar, firmware/free/reserved accounting, ramfunc, execution/load region water levels
Hierarchy Squarified treemap (drill, wheel zoom, drag pan), icicle bands, expandable tree list
Grouping Logical layer (app / ctrl / drv / hal / mw / lib / bsp / stdlib), source directory, execution region, flat objects
Ranking Top 15/25/50/all stacked horizontal bars, wheel/button horizontal zoom, table view
Charts Single-axis Pareto ROM%/RAM%, module bytes ranking, build trend — never a second Y axis
Tables Modules, symbols, sections/regions, removed unused sections, build/workspace diff — all sortable
Integration Custom editor (priority: option), explorer/editor-title menu, source navigation, status bar, save refresh, workspace .map comparison
Export UTF-8 BOM CSV (Excel opens Chinese text correctly), formula-injection safe
Accessibility Dual light/dark colorblind-safe palettes, 45°/135° pattern assist, icon+text status states, auto/light/dark themes, compact layout

Quick start

1. Build the VSIX (no Node.js required)

powershell -NoProfile -ExecutionPolicy Bypass -File .\package_vsix.ps1

The standard VSIX is written to dist\embedded-map-viewer.vsix. It contains [Content_Types].xml, a complete extension.vsixmanifest and the extension/ tree. No vsce, npm or TypeScript is invoked.

One-step local installation:

powershell -NoProfile -ExecutionPolicy Bypass -File .\package_vsix.ps1 -Install

2. Open a map

  • Right-click a .map file in the Explorer → Embedded Map Viewer: Open Visualization.
  • Or open the Command Palette → Embedded Map Viewer: Open Built-in Demo.
  • The custom editor is registered with priority: "option", so double-clicking a .map still follows your normal text-editor preference. Use Open With… or the context menu when you want the visual view.
  • Use View Original Text inside the page to return to the normal editor.
  • The same menu also opens .ld / .sct linker files, .log build logs, .csv tables and .txt notes in a dashboard-style panel.

3. Let it discover the chip

The viewer reads the map's load/execution regions and, when enabled, scans the current folder and workspace for .ld / .sct files. Sibling .map files in the same folder (for example a bootloader and an application) are overlaid on the same physical flash address bar. The page controls can override flash capacity and page size without changing settings.

Configuration

All settings live under embeddedMapViewer.* in settings.json.

Setting Default Meaning
flashTotalKB 128 Fallback flash capacity. A valid map/linker region or the in-page selector takes precedence.
flashBaseHex "auto" "auto" or an explicit base such as 0x08000000 / 0x00000000.
flashPageSizeBytes 1024 Physical page/sector size: 512, 1024, 2048, 4096, 8192 or 16384 bytes.
ramTotalKB 32 Fallback SRAM capacity.
ramBaseHex "0x20000000" SRAM base address.
customPartitions [] Bootloader, EEPROM/FEE, calibration, OTA, reserved or data partitions.
autoDetectLinkerScripts true Scan .ld / .sct and infer memory context.
statusBarEnabled true Live flash/SRAM water level in the status bar.
mergeSiblingMaps true Overlay sibling .map images in the whole-chip bar.

Example:

{
  "embeddedMapViewer.flashTotalKB": 128,
  "embeddedMapViewer.flashBaseHex": "0x08000000",
  "embeddedMapViewer.flashPageSizeBytes": 1024,
  "embeddedMapViewer.ramTotalKB": 32,
  "embeddedMapViewer.ramBaseHex": "0x20000000",
  "embeddedMapViewer.autoDetectLinkerScripts": true,
  "embeddedMapViewer.statusBarEnabled": true,
  "embeddedMapViewer.mergeSiblingMaps": true,
  "embeddedMapViewer.customPartitions": [
    { "name": "Bootloader slot", "start": "0x08000000", "size": "16K", "kind": "bootloader" },
    { "name": "FEE / EEPROM", "start": "0x0801C000", "size": "8K", "kind": "eeprom" },
    { "name": "OTA metadata", "start": "0x0801E000", "size": "4K", "kind": "ota" },
    { "name": "Calibration", "start": "0x0801F000", "size": "4K", "kind": "calibration" }
  ]
}

Partition kind is one of bootloader, eeprom, calibration, ota, data, reserved, crc. A reserved or crc fixed slot is shown with a neutral state and is never reported as a tight-memory alert.

Parsing rules that matter

Keil ARMCC / ARMCLANG component table

The six numeric columns are:

Code (inc. data)   RO Data   RW Data   ZI Data   Debug   Object Name

The first column already contains the second inc. data column. Embedded Map Viewer never adds column 2 to column 1. Calculations are:

ROM = Code + RO Data + RW Data
RAM = RW Data + ZI Data
RAM including ramfunc = RW Data + ZI Data + ramfunc

Object, library-member and library tables are parsed separately. Library aggregate rows and Object Totals / Library Totals / (incl. Generated) / (incl. Padding) summary rows never become modules.

ramfunc is deliberately strict

A section is counted as ramfunc only when it executes in a RAM region (base >= 0x20000000) and one of these is true:

  • the section name contains ramfunc, fast or itcm and is executable;
  • its type is Ven;
  • it is Code with RO attributes.

A startup file at the beginning of RW_IRAM1 with Code RW (text) is not ramfunc, and the region itself is never labelled (ramfunc). This avoids the classic false positive where an entire RAM region is reported as RAM-executed code.

UNINIT is neutral

An execution region marked UNINIT (or a .noinit / .uninit section) is a fixed reservation. It gets the neutral 「预留空槽 / 固定保留」 state even at 0% or 100%. It never raises the red “tight” alert.

GNU LD

Memory Configuration entries (FLASH (rx), RAM (xrw), 0x08000000, 128K, 1M) and input-section rows from Linker script and memory map are parsed. GNU maps usually expose VMA semantics only; when the .data load image is not present in the map, the flash bar marks a synthetic estimated .data load image instead of silently hiding it.

Build logs and CSV

Every Program Size: Code=… RO-data=… RW-data=… ZI-data=… line becomes a build snapshot for the trend chart. Simple comma/semicolon/tab tables with module / code / RO / RW / ZI columns are accepted as a fallback.

Views and controls

  • Global filter bar (one line): map, shape, group, sort, metric, top N, search. Press / to focus search; Esc clears it.
  • Nine sort modes: current metric ↓/↑, ROM ↓, RAM ↓, physical address ↑, name A→Z, section count ↓, removed bytes ↓, Δ against baseline ↓.
  • Three layouts: integrated, space-first, compact.
  • Treemap: click a group to drill; click a section leaf to jump to source; wheel to zoom, drag to pan, double-click to reset the viewport.
  • Icicle: three levels of horizontal bands; click any level to focus.
  • Tree list: expand/collapse all, inline share bars, physical start address, double-click a module to open source.
  • Page grid: every page is a button. Hover shows page number, address range, fill ratio and top objects. Click filters every module table and the treemap/ranking views to that address range.
  • Status bar: Flash used/limit (free) | RAM %. At ≥95% it gets a warning icon and warning background. Hover for partitions and headroom; click to open the panel.

Source navigation

Keil local symbol records contain the original source path. It is normalized from \ to / and resolved against the map folder, the workspace roots and a basename search. Function and data symbols are located by scanning the target source for the definition. If a path only exists on the build machine, the viewer says so instead of opening an unrelated file.

Auto refresh and build diff

Saving the .map (or changing it externally) re-parses it and posts a fresh payload. The previous analysis is kept as the baseline:

  • the Modules table gains a Δ baseline column;
  • the Diff tab shows added, removed and changed modules;
  • the Trend chart receives a new build snapshot.

Embedded Map Viewer: Compare All Workspace Maps builds a summary table for up to 50 .map files without opening each one.

Security model

  • Map, symbol, path, library, partition and warning text is untrusted.
  • innerHTML, outerHTML, insertAdjacentHTML, document.write and eval are not used in the webview.
  • Every dynamic label, tooltip row and table cell is created with createElement / createTextNode / textContent.
  • Strict CSP: no remote scripts, styles, fonts, images or connections; script URLs are local asWebviewUri resources with a per-load nonce.
  • The custom editor is read-only. It never edits the map.
  • CSV cells beginning with a spreadsheet formula trigger are prefixed with an apostrophe; negative numeric values remain numbers.
  • File size and CSV size limits are enforced in the extension host.

Project layout

embedded-map-viewer/
  extension.js              # host: custom editor, commands, status bar, files
  media/
    index.html              # static markup + strict CSP
    style.css               # themes, layouts, status tokens, patterns
    dom.js                  # safe DOM / formatting / tooltip
    parsers.js              # ARMCC, GNU, linker/scatter, log parsers
    sample-data.js          # generic Cortex-M4 demo
    flash-map.js            # flash, page grid, SRAM, regions, composition
    hierarchy.js            # treemap, icicle, tree list
    charts.js               # ranking and single-axis line chart
    table.js                # 5 sortable tables + CSV
    app.js                  # state, filters, messages, source navigation
  resources/icon.png        # generated by the packager
  samples/                  # public generic examples
  test/                     # parser + host smoke tests (excluded from VSIX)
  package_vsix.ps1          # ASCII-only, zero-Node packager

Development

# parser regression suite (Node built-in only)
node test/run-tests.js

# stubbed VS Code host smoke test (no npm)
node test/extension-smoke.js

# rebuild the VSIX
powershell -NoProfile -ExecutionPolicy Bypass -File .\package_vsix.ps1

To debug interactively, press F5 with this folder open and use the Run Extension launch configuration. The built-in demo needs no workspace files.

Publishing checklist

The project is prepared for the Marketplace publisher id embedded-tools (display name joyful-jogo) and the public repository https://github.com/joyful-jogo/embedded-map-viewer. Before an update:

  1. increment version in package.json;
  2. run package_vsix.ps1 again;
  3. upload dist\embedded-map-viewer.vsix in the Marketplace management portal (or publish with your normal vsce publish flow if you use it elsewhere).

The local VSIX is complete and installable without any Node.js tooling.

Known limitations

  • Symbol line numbers are not stored in .map files; the viewer scans source text for a plausible definition and falls back to the top of the file.
  • GNU LD maps often omit .data LMA; the flash image is marked as estimated.
  • A map cannot prove what happens after reset. UNINIT reservations are neutral by design, not “used” or “broken”.
  • Page grids larger than 16,384 pages are truncated with an explanatory note.
  • Very large workspace comparisons are capped at 50 maps to keep the webview responsive.

License

MIT. See LICENSE.


中文

这是什么

Embedded Map Viewer 是一个纯离线、零依赖的 VS Code 固件内存分析扩展, 面向 STM32 / GD32 / NXP / nRF / PAC55xx 等 Cortex-M 固件团队。打开 Keil ARMCC/ARMCLANG 或 GNU LD 的 .map,你会同时看到:

  • 整片 Flash 的物理地址全景:Bootloader、Code+RO、.data 载入镜像、 ramfunc 镜像、校验尾、自定义分区、空洞与未分配空间;
  • 按页/扇区的热力网格:每页填充率、页内主要目标文件,点击即可筛选;
  • SRAM 物理条与 Execution/Load Region 水位;
  • 矩形树图 / 冰柱图 / 可展开目录树,从逻辑分组逐级下钻到模块、段;
  • 单轴折线图:Pareto 累计 ROM%/RAM%、模块大小排行、构建版本趋势;
  • 5 张可排序明细表 与自动构建 Diff;
  • 点击源码跳转、状态栏水位、UTF-8 BOM CSV 导出。

没有任何外部 CDN、npm 依赖、TypeScript 编译或遥测。内置示例是虚构的通用 ARM Cortex-M4:128 KB Flash / 1 KB 页 / 32 KB SRAM,不含任何厂商、公司 或私有项目名称。

安装与打包

powershell -NoProfile -ExecutionPolicy Bypass -File .\package_vsix.ps1
# 产物:dist\embedded-map-viewer.vsix

# 本地安装测试
powershell -NoProfile -ExecutionPolicy Bypass -File .\package_vsix.ps1 -Install

打包脚本是纯 ASCII PowerShell:

  • 用 [System.IO.File]::ReadAllText($path, [System.Text.Encoding]::UTF8) 读取 package.json,避免 Windows PowerShell 5.1 按 GBK 误读 UTF-8;
  • 用 .NET System.Drawing 生成 128×128 PNG 图标;
  • 用 .NET System.IO.Compression 写入标准 VSIX: [Content_Types].xml + extension.vsixmanifest + extension/ 目录;
  • -Install 调用 code --install-extension <vsix> --force。

打开方式

  • 资源管理器中右键 .map → Embedded Map Viewer: Open Visualization;
  • 命令面板 → Embedded Map Viewer: Open Built-in Demo;
  • 自定义编辑器使用 priority: "option",不会劫持你双击 .map 的默认习惯;
  • 页面内 View Original Text 可回到普通文本编辑器;
  • 同一入口也支持 .ld / .sct、.log 构建日志、.csv 表格和 .txt 文本。

核心解析规则(避免踩坑)

  1. Keil 六列映射:第 1 列 Code 已包含第 2 列 inc. data,绝不相加; ROM = Code + RO + RW,RAM = RW + ZI。
  2. ramfunc 精确判定:仅当段位于 RAM 执行区(base >= 0x20000000),且 段名含 ramfunc/fast/itcm(且为可执行段)、Type === Ven、或 Code + RO 时才计入。RW_IRAM1 开头的启动文件 Code RW 不会误判; Region 也不会被标成 (ramfunc)。
  3. UNINIT 预留区中性化:固定保留槽显示「预留空槽 / 固定保留」,即使 0% 或 100% 也不触发红色紧张告警。
  4. UTF-8 优先:读取文本时若出现替换符 \uFFFD,自动用 GBK 重新解码。
  5. 安全渲染:所有 map/符号/路径/分区名称只通过 textContent / createTextNode 进入 DOM;前端不使用 innerHTML 拼接任何不可信文本。

配置示例

{
  "embeddedMapViewer.flashTotalKB": 128,
  "embeddedMapViewer.flashBaseHex": "0x08000000",
  "embeddedMapViewer.flashPageSizeBytes": 1024,
  "embeddedMapViewer.ramTotalKB": 32,
  "embeddedMapViewer.ramBaseHex": "0x20000000",
  "embeddedMapViewer.autoDetectLinkerScripts": true,
  "embeddedMapViewer.statusBarEnabled": true,
  "embeddedMapViewer.mergeSiblingMaps": true,
  "embeddedMapViewer.customPartitions": [
    { "name": "Bootloader slot", "start": "0x08000000", "size": "16K", "kind": "bootloader" },
    { "name": "FEE / EEPROM", "start": "0x0801C000", "size": "8K", "kind": "eeprom" },
    { "name": "OTA metadata", "start": "0x0801E000", "size": "4K", "kind": "ota" },
    { "name": "Calibration", "start": "0x0801F000", "size": "4K", "kind": "calibration" }
  ]
}

reserved 与 crc 分区按固定保留展示,不产生紧张告警。

筛选与视图

  • 顶部单行全局筛选栏:Map / Shape / Group / Sort / Metric / Top / Search; 按 / 聚焦搜索,Esc 清除。
  • 9 种排序:当前指标升降序、ROM、RAM、物理地址、名称、段数、未用裁剪量、 与基准的 Δ。
  • 3 种布局:综合、空间优先、紧凑分屏。
  • 3 种层次:矩形树图(点击下钻、滚轮缩放、拖拽平移)、冰柱图、目录树。
  • 4 种分组:逻辑分层 / 源码目录 / 执行区域 / 平铺。
  • 页面网格:每页都是按钮,悬停看页号、地址、填充率、主要模块;点击联动 全部视图。
  • 状态栏:Flash 已用/上限 (余量) | RAM %,≥95% 警告;悬停看分区余量。

安全与可维护性

  • 前后端共享 media/parsers.js;host 只依赖 Node 内置模块。
  • CSP 禁止远程脚本/样式/字体/图片/连接;脚本仅本地 asWebviewUri + nonce。
  • 文件大小上限、CSV 大小上限、CSV 公式注入防护。
  • 自动刷新保留上一次分析作为基准,直接看本次构建增减。

开发与测试

node test/run-tests.js
node test/extension-smoke.js
powershell -NoProfile -ExecutionPolicy Bypass -File .\package_vsix.ps1

发布前

项目当前的 Marketplace Publisher ID 是 embedded-tools(显示名 joyful-jogo),GitHub 仓库是 https://github.com/joyful-jogo/embedded-map-viewer。后续发版只需递增 package.json 的 version,重新运行打包脚本,再上传 dist\embedded-map-viewer.vsix。VSIX 可手工上传到 Marketplace 管理门户, 无需本地 Node.js 工具链。

许可证

MIT,详见 LICENSE。


Built for firmware engineers who want the whole memory picture, offline.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft