Files
proxmark3/fpga/Makefile
T
iceman1001andClaude Opus 5.5 f777b91a09 PM5: ship the FPGA image built from the repo sources
client/resources/PM5_FPGA_fix_loedge_bug.bin was a Gowin IDE build
posted in #3449 on 2026-08-15, before the FPGA sources were opened in
#3697. Its lo_edge_detect fix (adc_clk = pck0) has been in the sources
since 7666e8444, so the shipped binary only lagged behind them and
could not be checked against anything in the tree.

Add `make -C fpga fpga_pm5_release`, which builds fpga_pm5.bin and
copies it with its sha512 to client/resources. It stays out of `all`
so a local test build does not replace the shipped image by accident.
Point update_fpga.cmd and update_fpga_and_bwm.cmd at fpga_pm5.bin and
document the build in Getting_Started_With_PM5.md.

The image was built with oss-cad-suite 2026-10-11, the release pinned
in fpga-pm5.yml. A clean rebuild gives the same bytes, IDCODE is
0x1100381B, and all clocks meet timing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-10 11:18:13 +07:00

71 lines
2.1 KiB
Makefile

#
# FPGA build dispatcher.
#
# Each requested target is routed to the implementation of the platform that
# owns it:
# proxmark3_fpga.mk Xilinx ISE - PM3, PM3-ULT, iCopy-X
# proxmark5_fpga.mk yosys/nextpnr - PM5
#
# make - every PM3 image
# make pm3 - same
# make pm5 - the PM5 bitstream
# make fpga_pm5_release - the PM5 bitstream, copied to client/resources
# make <target> - routed by name, e.g. fpga_pm3_hf, fpga_pm3_ult_lf, fpga_pm5
# make clean - both platforms
# make help - both target lists
#
# Both platform files are also usable directly, which is how the recursive
# builds call them:
# make -C fpga -f proxmark5_fpga.mk all
include common_src.mk
PM3_MK = proxmark3_fpga.mk
PM5_MK = proxmark5_fpga.mk
PLATFORMS = pm3 pm5
# Everything that is not a dispatcher builtin is forwarded to a platform file.
GOALS = $(filter-out $(PLATFORMS) all clean help,$(MAKECMDGOALS))
# PM5 owns the fpga_pm5* targets, everything else is PM3.
mk_for = $(if $(filter fpga_pm5%,$1),$(PM5_MK),$(PM3_MK))
.PHONY: all pm3 pm5 clean help $(GOALS)
ifneq ($(GOALS),)
$(GOALS):
$(Q)$(MAKE) --no-print-directory -f $(call mk_for,$@) $@
all pm3 pm5 clean help: ;
else
all: pm3
pm3:
$(Q)$(MAKE) --no-print-directory -f $(PM3_MK) all
pm5:
$(Q)$(MAKE) --no-print-directory -f $(PM5_MK) all
clean:
$(Q)$(MAKE) --no-print-directory -f $(PM3_MK) clean
$(Q)$(MAKE) --no-print-directory -f $(PM5_MK) clean
help:
@echo "################################################################"
@echo "# FPGA build dispatcher"
@echo "#"
@echo "# make - every PM3 image (Xilinx ISE)"
@echo "# make pm5 - the PM5 bitstream (yosys/nextpnr-himbaechel)"
@echo "# make fpga_pm5_release - same, copied to client/resources"
@echo "# make <target> - routed by name, e.g. fpga_pm3_hf, fpga_pm5"
@echo "# make clean - both platforms"
@echo "################################################################"
$(Q)$(MAKE) --no-print-directory -f $(PM3_MK) help
$(Q)$(MAKE) --no-print-directory -f $(PM5_MK) help
endif