From 859f335c9c340d09488abbcfdb22c1ae769575bc Mon Sep 17 00:00:00 2001 From: root Date: Tue, 15 Feb 2022 10:23:50 +0800 Subject: [PATCH] dpcmd.c --- .gitignore | 0 60-dediprog.rules | 0 ChipInfoDb.dedicfg | 0 ChipInfoDb.h | 0 FlashCommand.c | 0 FlashCommand.h | 0 IntelHexFile.c | 0 IntelHexFile.h | 0 LICENSE | 0 Macro.h | 0 Makefile | 0 MotorolaFile.c | 0 MotorolaFile.h | 0 README.md | 0 SerialFlash.c | 0 SerialFlash.h | 0 board.c | 14 +++++++------- board.h | 0 dpcmd.c | 0 dpcmd.h | 0 parse.c | 0 project.c | 0 project.h | 0 usbdriver.c | 0 usbdriver.h | 0 25 files changed, 7 insertions(+), 7 deletions(-) mode change 100644 => 100755 .gitignore mode change 100644 => 100755 60-dediprog.rules mode change 100644 => 100755 ChipInfoDb.dedicfg mode change 100644 => 100755 ChipInfoDb.h mode change 100644 => 100755 FlashCommand.c mode change 100644 => 100755 FlashCommand.h mode change 100644 => 100755 IntelHexFile.c mode change 100644 => 100755 IntelHexFile.h mode change 100644 => 100755 LICENSE mode change 100644 => 100755 Macro.h mode change 100644 => 100755 Makefile mode change 100644 => 100755 MotorolaFile.c mode change 100644 => 100755 MotorolaFile.h mode change 100644 => 100755 README.md mode change 100644 => 100755 SerialFlash.c mode change 100644 => 100755 SerialFlash.h mode change 100644 => 100755 board.c mode change 100644 => 100755 board.h mode change 100644 => 100755 dpcmd.c mode change 100644 => 100755 dpcmd.h mode change 100644 => 100755 parse.c mode change 100644 => 100755 project.c mode change 100644 => 100755 project.h mode change 100644 => 100755 usbdriver.c mode change 100644 => 100755 usbdriver.h diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/60-dediprog.rules b/60-dediprog.rules old mode 100644 new mode 100755 diff --git a/ChipInfoDb.dedicfg b/ChipInfoDb.dedicfg old mode 100644 new mode 100755 diff --git a/ChipInfoDb.h b/ChipInfoDb.h old mode 100644 new mode 100755 diff --git a/FlashCommand.c b/FlashCommand.c old mode 100644 new mode 100755 diff --git a/FlashCommand.h b/FlashCommand.h old mode 100644 new mode 100755 diff --git a/IntelHexFile.c b/IntelHexFile.c old mode 100644 new mode 100755 diff --git a/IntelHexFile.h b/IntelHexFile.h old mode 100644 new mode 100755 diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/Macro.h b/Macro.h old mode 100644 new mode 100755 diff --git a/Makefile b/Makefile old mode 100644 new mode 100755 diff --git a/MotorolaFile.c b/MotorolaFile.c old mode 100644 new mode 100755 diff --git a/MotorolaFile.h b/MotorolaFile.h old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/SerialFlash.c b/SerialFlash.c old mode 100644 new mode 100755 diff --git a/SerialFlash.h b/SerialFlash.h old mode 100644 new mode 100755 diff --git a/board.c b/board.c old mode 100644 new mode 100755 index 1d28205..920f651 --- a/board.c +++ b/board.c @@ -790,7 +790,7 @@ bool EncrypFirmware(unsigned char* vBuffer, unsigned int Size, int Index) { unsigned char vUID[16]; unsigned int i = 0; - if (ReadOnBoardFlash(vUID, true, Index) == false) + if (ReadOnBoardFlash(vUID, false, Index) == false) return false; for (i = 0; i < 16; i++) vBuffer[i] = vBuffer[i] ^ vUID[i]; @@ -802,6 +802,7 @@ bool EncrypFirmware(unsigned char* vBuffer, unsigned int Size, int Index) bool UpdateSF600Flash(const char* sFilePath, int Index) { + printf(" evy UpdateSF600Flash\n"); CNTRPIPE_RQ rq; unsigned char* pBuffer; int pagenum = 0; @@ -818,16 +819,14 @@ bool UpdateSF600Flash(const char* sFilePath, int Index) } fseek(pFile, 0, SEEK_SET); - lSize = fread((unsigned char*)&fw_info, 1, sizeof(FW_INFO), pFile); + lSize = fread((unsigned char*)&fw_info, 1, sizeof(FW_INFO), pFile); if (lSize != sizeof(FW_INFO)) printf("Possible read length error %s\n", sFilePath); - pBuffer = (unsigned char*)malloc(fw_info.FirstSize); fseek(pFile, fw_info.FirstIndex, SEEK_SET); - lSize = fread(pBuffer, 1, fw_info.FirstSize, pFile); + lSize = fread(pBuffer, 1, fw_info.FirstSize, pFile); if (lSize != fw_info.FirstSize) printf("Possible read length error %s\n", sFilePath); - fclose(pFile); EncrypFirmware(pBuffer, fw_info.FirstSize, Index); @@ -880,6 +879,7 @@ bool UpdateSF600Flash(const char* sFilePath, int Index) bool UpdateSF600Flash_FPGA(const char* sFilePath, int Index) { + printf(" evy UpdateSF600Flash_FPGA\n"); CNTRPIPE_RQ rq; unsigned char* pBuffer; int pagenum = 0; @@ -956,14 +956,14 @@ bool UpdateSF600Flash_FPGA(const char* sFilePath, int Index) } bool UpdateFirmware(const char* sFolder, int Index) -{ +{ bool bResult = true; unsigned int UID = 0; unsigned char ManID = 0; // read status if ((g_bIsSF600 == true) || (g_bIsSF700 == true)) return UpdateSF600Firmware(sFolder, Index); - + dediprog_set_spi_voltage(g_Vcc, Index); if (g_firmversion > 0x040107) // 4.1.7 diff --git a/board.h b/board.h old mode 100644 new mode 100755 diff --git a/dpcmd.c b/dpcmd.c old mode 100644 new mode 100755 diff --git a/dpcmd.h b/dpcmd.h old mode 100644 new mode 100755 diff --git a/parse.c b/parse.c old mode 100644 new mode 100755 diff --git a/project.c b/project.c old mode 100644 new mode 100755 diff --git a/project.h b/project.h old mode 100644 new mode 100755 diff --git a/usbdriver.c b/usbdriver.c old mode 100644 new mode 100755 diff --git a/usbdriver.h b/usbdriver.h old mode 100644 new mode 100755