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:
1 parent
57f200d107
commit
0151c0d710
2 files changed
+5
No files matched your search
@@ -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