root@kali:~# flashrom -p ft2232_spi:type=232H -r spi_dump.bin flashrom v1.2 on Linux 5.10.0-kali3-amd64 (x86_64) flashrom is free software, get the source code at https://flashrom.org
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns). Found Generic flash chip "unknown SPI chip (REMS)" (0 kB, SPI) on ft2232_spi. === This flash part has status NOT WORKING for operations: PROBE READ ERASE WRITE The test status of this chip may have been updated in the latest development version of flashrom. If you are running the latest development version, please email a report to [email protected]if any of the above operations work correctly for you with this flash chip. Please include the flashrom log file for all operations you tested (see the man page for details), and mention which mainboard or programmer you tested in the subject line. Thanks for your help! Read is not working on this chip. Aborting.
* pciutils+libpci (if you want support for mainboard or PCI device flashing) * libusb (if you want FT2232, Dediprog or USB-Blaster support) * libftdi (if you want FT2232 or USB-Blaster support)
root@kali:/opt/flashrom-master# ./flashrom -p ft2232_spi:type=232H -r spi_dump.bin flashrom on Linux 5.10.0-kali3-amd64 (x86_64) flashrom is free software, get the source code at https://flashrom.org
手动编译了 flashrom,再次尝试读取仍旧失败。于是,就只能修改源码,添加对这款芯片的支持。
分析 pull requests 中的内容
提取 SPI Flash 中的固件对 flashrom 工具比较依赖,但遇到不支持的芯片的时候就很尴尬。趁这个机会,跟着 Commit 来了解一下怎么添加对新设备的支持。为什么是跟着别人的 pull requests学习呢,直接阅读完整源码花费的时间很长,但看别人提交的对某芯片的支持就只需要花费很短的时间,然后模仿新增的代码编写自己需要的内容,降低学习成本。接下来看看 flashchips.c: Add support for XMC new SPI flash types 为支持 XMC 的部分芯片添加了哪些代码。