]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - armsrc/appmain.c
fix lf sim fpga download overwrites sim buffer (#391)
[proxmark3-svn] / armsrc / appmain.c
index 4411a0c54915778a9a29bd1dc3e2245079773c83..25285396a396ce5943cf087ae799a7a2b27f5dff 100644 (file)
@@ -1294,6 +1294,15 @@ void UsbPacketReceived(uint8_t *packet, int len)
                        break;
 
                case CMD_DOWNLOADED_SIM_SAMPLES_125K: {
+                       // iceman; since changing fpga_bitstreams clears bigbuff, Its better to call it before.
+                       // to be able to use this one for uploading data to device 
+                       // arg1 = 0 upload for LF usage 
+                       //        1 upload for HF usage
+                       if (c->arg[1] == 0)
+                               FpgaDownloadAndGo(FPGA_BITSTREAM_LF);
+                       else
+                               FpgaDownloadAndGo(FPGA_BITSTREAM_HF);
+
                        uint8_t *b = BigBuf_get_addr();
                        memcpy(b+c->arg[0], c->d.asBytes, USB_CMD_DATA_SIZE);
                        cmd_send(CMD_ACK,0,0,0,0,0);
@@ -1304,7 +1313,7 @@ void UsbPacketReceived(uint8_t *packet, int len)
                        break;
 
                case CMD_SET_LF_DIVISOR:
-                       FpgaDownloadAndGo(FPGA_BITSTREAM_LF);
+                       FpgaDownloadAndGo(FPGA_BITSTREAM_LF);
                        FpgaSendCommand(FPGA_CMD_SET_DIVISOR, c->arg[0]);
                        break;
 
Impressum, Datenschutz