Skip to content

Commit

Permalink
dpcmd.c
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Feb 15, 2022
1 parent 4aa428c commit 859f335
Show file tree
Hide file tree
Showing 25 changed files with 7 additions and 7 deletions.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified 60-dediprog.rules
100644 → 100755
Empty file.
Empty file modified ChipInfoDb.dedicfg
100644 → 100755
Empty file.
Empty file modified ChipInfoDb.h
100644 → 100755
Empty file.
Empty file modified FlashCommand.c
100644 → 100755
Empty file.
Empty file modified FlashCommand.h
100644 → 100755
Empty file.
Empty file modified IntelHexFile.c
100644 → 100755
Empty file.
Empty file modified IntelHexFile.h
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
Empty file modified Macro.h
100644 → 100755
Empty file.
Empty file modified Makefile
100644 → 100755
Empty file.
Empty file modified MotorolaFile.c
100644 → 100755
Empty file.
Empty file modified MotorolaFile.h
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified SerialFlash.c
100644 → 100755
Empty file.
Empty file modified SerialFlash.h
100644 → 100755
Empty file.
14 changes: 7 additions & 7 deletions board.c
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
Empty file modified board.h
100644 → 100755
Empty file.
Empty file modified dpcmd.c
100644 → 100755
Empty file.
Empty file modified dpcmd.h
100644 → 100755
Empty file.
Empty file modified parse.c
100644 → 100755
Empty file.
Empty file modified project.c
100644 → 100755
Empty file.
Empty file modified project.h
100644 → 100755
Empty file.
Empty file modified usbdriver.c
100644 → 100755
Empty file.
Empty file modified usbdriver.h
100644 → 100755
Empty file.

0 comments on commit 859f335

Please sign in to comment.