mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-05-12 11:18:11 -07:00
fix(fpga): add FpgaResetBitstream() to force re-initialization
After aggressive field cycling (e.g. tear-off attacks), the FPGA's internal SSC/DMA state can become corrupted even though the bitstream is technically loaded. FpgaDownloadAndGo() caches downloaded_bitstream and skips re-download if it matches, so subsequent commands fail silently or hang. Add FpgaResetBitstream() which sets downloaded_bitstream to FPGA_BITSTREAM_UNKNOWN, forcing the next FpgaDownloadAndGo() to perform a complete reload.
This commit is contained in:
@@ -630,6 +630,10 @@ int FpgaGetCurrent(void) {
|
||||
return downloaded_bitstream;
|
||||
}
|
||||
|
||||
void FpgaResetBitstream(void) {
|
||||
downloaded_bitstream = FPGA_BITSTREAM_UNKNOWN;
|
||||
}
|
||||
|
||||
// Turns off the antenna,
|
||||
// log message
|
||||
// if HF, Disable SSC DMA
|
||||
|
||||
@@ -172,6 +172,7 @@ void SetupSpi(int mode);
|
||||
bool FpgaSetupSscDma(uint8_t *buf, uint16_t len);
|
||||
void Fpga_print_status(void);
|
||||
int FpgaGetCurrent(void);
|
||||
void FpgaResetBitstream(void);
|
||||
void SetAdcMuxFor(uint32_t whichGpio);
|
||||
|
||||
// extern and generel turn off the antenna method
|
||||
|
||||
Reference in New Issue
Block a user