diff --git a/armsrc/appmain.c b/armsrc/appmain.c index 186f5a654..d4893359a 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -1123,7 +1123,13 @@ static void PacketReceived(PacketCommandNG *packet) { break; } case CMD_LF_EM4X50_SIM: { - em4x50_sim(); + //----------------------------------------------------------------------------- + // Note: we call FpgaDownloadAndGo(FPGA_BITSTREAM_LF) here although FPGA is not + // involved in dealing with emulator memory. But if it is called later, it might + // destroy the Emulator Memory. + //----------------------------------------------------------------------------- + FpgaDownloadAndGo(FPGA_BITSTREAM_LF); + em4x50_sim((uint8_t *)packet->data.asBytes); break; } case CMD_LF_EM4X50_READER: { diff --git a/armsrc/em4x50.h b/armsrc/em4x50.h index 33c18e794..12f0a64d8 100644 --- a/armsrc/em4x50.h +++ b/armsrc/em4x50.h @@ -24,7 +24,7 @@ void em4x50_writepwd(em4x50_data_t *etd); void em4x50_read(em4x50_data_t *etd); void em4x50_brute(em4x50_data_t *etd); void em4x50_login(uint32_t *password); -void em4x50_sim(void); +void em4x50_sim(uint8_t *filename); void em4x50_reader(void); void em4x50_chk(uint8_t *filename);