{"skill":{"slug":"framebuffer-dump","displayName":"Framebuffer Dump","summary":"Dump the current STM32 LCD framebuffer via J-Link and convert it to PNG for visual comparison with Figma. Use when user asks to export, snapshot, dump, or ca...","description":"---\nname: framebuffer-dump\ndescription: Dump the current STM32 LCD framebuffer via J-Link and convert it to PNG for visual comparison with Figma. Use when user asks to export, snapshot, dump, or capture what is currently displayed on device screen.\n---\n\n# Framebuffer Dump (J-Link → PNG)\n\nExport the **actual on-device rendered frame** directly from SDRAM framebuffer and convert to PNG.\n\n## Default parameters (PRO2)\n- Device: `STM32H747XI_M7`\n- FB base: `0xD0000000`\n- Resolution: `604x1024`\n- Pixel format: `RGB888` (3 bytes/pixel)\n- Dump size: `604*1024*3 = 1,855,488 (0x1C5000)`\n\n## One-shot workflow\n\n### 1) Create J-Link command file\nUse `scripts/dump_fb.jlink.template` and replace placeholders:\n- `{{DEVICE}}`\n- `{{SPEED_KHZ}}` (e.g. `12000`)\n- `{{OUT_BIN}}` (absolute path)\n- `{{FB_ADDR}}` (e.g. `0xD0000000`)\n- `{{FB_SIZE}}` (e.g. `0x1C5000`)\n\n### 2) Dump raw framebuffer\n```bash\nJLinkExe -NoGui 1 -CommandFile /tmp/jlink_dump_fb.jlink > /tmp/jlink_dump_fb.log 2>&1\n```\n\n### 3) Convert raw to PNG\n```bash\npython3 scripts/dump_fb.py \\\n  --in /path/to/fb_dump.bin \\\n  --out /path/to/fb_dump_604x1024.png \\\n  --width 604 --height 1024 --stride 3\n```\n\n## Troubleshooting\n- If output bin is 0 bytes: check J-Link connection / path permissions.\n- If colors look wrong: verify pixel format is RGB888 (not BGR / RGB565).\n- If image shifted/corrupt: verify width/height match current display mode.\n- If command hangs too long: make sure dump size is correct (`0x1C5000` for 604x1024 RGB888).\n\n## Notes\n- This method captures **real framebuffer pixels** (no camera distortion).\n- Best for Figma-vs-device pixel comparison and regression snapshots.\n","tags":{"embedded":"1.0.0","jlink":"1.0.0","latest":"1.0.0","stm32":"1.0.0"},"stats":{"comments":0,"downloads":588,"installsAllTime":22,"installsCurrent":0,"stars":0,"versions":1},"createdAt":1773124081887,"updatedAt":1778491803852},"latestVersion":{"version":"1.0.0","createdAt":1773124081887,"changelog":"Initial release — J-Link framebuffer dump for STM32 LCD to PNG","license":"MIT-0"},"metadata":null,"owner":{"handle":"ylongw","userId":"s178xpp699t983pp6f0av2why9885yhh","displayName":"ylongw","image":"https://avatars.githubusercontent.com/u/67491174?v=4"},"moderation":null}