fix(pm5): suppress bogus [FPGA] version section on PM5

PM5's FPGA (Gowin GW1NR) bitstream is loaded at runtime via `hw fpga config`
and is not compiled into the firmware; only the Xilinx fpga_pm3_hf.bit is pulled
in (to generate g_fpga_version_information[]) which PM5 never runs. So the
`[ FPGA ] fpga_pm3_hf.ncd image 2s30vq100` line described a bitstream unrelated
to the actual device.

- Firmware (appmain.c): omit the [FPGA] section from the version string on PM5
  (#ifndef PM5), since there's no meaningful built-in FPGA version to report.
- Client (cmdhw.c): skip the FPGA_TYPE "chip mismatch" check for PM5, which would
  otherwise trigger now that the section is gone.
This commit is contained in:
Nemanja Nedeljkovic authored and Philippe Teuwen committed 2026-08-20 10:36:09 +02:00
1 parent 36027b48e6
commit ba315d8d58
3 files changed
+10 -1

No files matched your search

+1
View File
@@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.
This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log...
## [unreleased][unreleased]
- Fixed `hw version` / `hw status` showing a bogus FPGA image (`fpga_pm3_hf.ncd image 2s30vq100`) on Proxmark5 (PM5/AT32): PM5's Gowin FPGA bitstream is loaded externally and not compiled in, so the built-in Xilinx version info is meaningless there; the `[ FPGA ]` section (and the client FPGA "chip mismatch" check) are now suppressed for PM5 (@nemanjan00)
- Fixed `hw status` [Model] section reporting "PM3 GENERIC" firmware on Proxmark5 (PM5/AT32); it now reports `PM5` (@nemanjan00)
- Added Proxmark5 (PM5/AT32) reporting in `hw version` / `hw status`: correct MCU (AT32F437), flash size and `PM5` target, instead of the AT91-decoded "Unknown / 32 KB / PM3 GENERIC". The device now also reports its on-chip flash size, appended to the `CMD_VERSION` reply in a backward-compatible way (@nemanjan00)
- Fixed `hf mf dump` preserving readable sector trailer Key B data instead of overwriting it with values from the supplied key file (@oSPANNERo)
+6
View File
@@ -362,6 +362,11 @@ static void SendVersion(void) {
strncat(VersionString, " Compiler... GCC "__VERSION__"\n", sizeof(VersionString) - strlen(VersionString) - 1);
#endif
#ifndef PM5
// PM5's FPGA (Gowin) bitstream is loaded at runtime via `hw fpga config` and is
// not compiled into the firmware, so there is no meaningful built-in FPGA
// version to report here. g_fpga_version_information[] describes the Xilinx
// bitstream that PM5 does not run, so omit the section entirely on PM5.
strncat(VersionString, "\n [ "_YELLOW_("FPGA")" ] \n ", sizeof(VersionString) - strlen(VersionString) - 1);
for (int i = 0; i < g_fpga_bitstream_num; i++) {
@@ -370,6 +375,7 @@ static void SendVersion(void) {
strncat(VersionString, "\n ", sizeof(VersionString) - strlen(VersionString) - 1);
}
}
#endif
#ifdef WITH_COMPRESSION
// Send Chip ID and used flash memory
uint32_t text_and_rodata_section_size = (uint32_t)__data_src_start__ - (uint32_t)_flash_start;
+3 -1
View File
@@ -2268,7 +2268,9 @@ void pm3_version(bool verbose, bool oneliner) {
}
}
PrintAndLogEx(NORMAL, payload->versionstr);
if (strstr(payload->versionstr, FPGA_TYPE) == NULL) {
// PM5 doesn't report a built-in FPGA version (Gowin bitstream is loaded
// externally), so skip the Xilinx FPGA_TYPE match check for it.
if (!IfPm5() && strstr(payload->versionstr, FPGA_TYPE) == NULL) {
PrintAndLogEx(NORMAL, " FPGA firmware... %s", _RED_("chip mismatch"));
}