Framebuffer Dump (J-Link → PNG)
Export the actual on-device rendered frame directly from SDRAM framebuffer and convert to PNG.
Default parameters (PRO2)
- - Device: INLINECODE0
- FB base: INLINECODE1
- Resolution: INLINECODE2
- Pixel format:
RGB888 (3 bytes/pixel) - Dump size: INLINECODE4
One-shot workflow
1) Create J-Link command file
Use
scripts/dump_fb.jlink.template and replace placeholders:
- - INLINECODE6
- INLINECODE7 (e.g.
12000) - INLINECODE9 (absolute path)
- INLINECODE10 (e.g.
0xD0000000) - INLINECODE12 (e.g.
0x1C5000)
2) Dump raw framebuffer
CODEBLOCK0
3) Convert raw to PNG
CODEBLOCK1
Troubleshooting
- - If output bin is 0 bytes: check J-Link connection / path permissions.
- If colors look wrong: verify pixel format is RGB888 (not BGR / RGB565).
- If image shifted/corrupt: verify width/height match current display mode.
- If command hangs too long: make sure dump size is correct (
0x1C5000 for 604x1024 RGB888).
Notes
- - This method captures real framebuffer pixels (no camera distortion).
- Best for Figma-vs-device pixel comparison and regression snapshots.
帧缓冲转储 (J-Link → PNG)
直接从SDRAM帧缓冲导出设备实际渲染帧并转换为PNG格式。
默认参数 (PRO2)
- - 设备:STM32H747XI_M7
- 帧缓冲基址:0xD0000000
- 分辨率:604x1024
- 像素格式:RGB888 (3字节/像素)
- 转储大小:60410243 = 1,855,488 (0x1C5000)
一次性工作流程
1) 创建J-Link命令文件
使用scripts/dump_fb.jlink.template并替换占位符:
- - {{DEVICE}}
- {{SPEEDKHZ}} (例如 12000)
- {{OUTBIN}} (绝对路径)
- {{FBADDR}} (例如 0xD0000000)
- {{FBSIZE}} (例如 0x1C5000)
2) 转储原始帧缓冲
bash
JLinkExe -NoGui 1 -CommandFile /tmp/jlink
dumpfb.jlink > /tmp/jlink
dumpfb.log 2>&1
3) 将原始数据转换为PNG
bash
python3 scripts/dump_fb.py \
--in /path/to/fb_dump.bin \
--out /path/to/fb
dump604x1024.png \
--width 604 --height 1024 --stride 3
故障排除
- - 如果输出bin文件为0字节:检查J-Link连接/路径权限。
- 如果颜色显示异常:确认像素格式为RGB888(非BGR/RGB565)。
- 如果图像偏移/损坏:确认宽度/高度与当前显示模式匹配。
- 如果命令长时间挂起:确保转储大小正确(604x1024 RGB888对应0x1C5000)。
备注
- - 此方法捕获真实帧缓冲像素(无相机畸变)。
- 最适合Figma与设备像素对比及回归快照。