Skip to content

Commit

Permalink
Merge pull request #68 from silbe/fix-large-flash-write
Browse files Browse the repository at this point in the history
Fix writing devices with 4KiB flash
I've checked that this indeed fixes writing the whole flash on PFC161 for me.
  • Loading branch information
spth authored Mar 10, 2024
2 parents 6d0964e + 5d11e24 commit 85f5a7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fpdkcom.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ static const char FPDK_VERSCAN[] = "FREE-PDK EASY PROG - HW:%u.%u SW:%u.%u PROTO
#define FPDKCOM_CMDRSP_PROBEIC_TIMEOUT 3500
#define FPDKCOM_CMDRSP_READIC_TIMEOUT 1000
#define FPDKCOM_CMDRSP_ERASE_TIMEOUT 2000
#define FPDKCOM_CMDRSP_WRITE_TIMEOUT 2000
#define FPDKCOM_CMDRSP_WRITE_TIMEOUT 4000
#define FPDKCOM_CMDRSP_CALIBRATEIC_TIMEOUT 10000

static bool _FPDKCOM_SendCommand(const int fd, const FPDKPROTO_CMD cmd, const uint8_t* dat, const uint8_t len)
Expand Down Expand Up @@ -449,7 +449,7 @@ int FPDKCOM_IC_Write(const int fd,
write_block_clock_group_trail_clocks };

uint8_t resp[3+sizeof(uint16_t)];
if( sizeof(resp) != _FPDKCOM_SendReceiveCommandWithTimeout(fd, FPDKPROTO_CMD_WRITEIC, dat,sizeof(dat), resp, sizeof(resp), FPDKCOM_CMDRSP_READIC_TIMEOUT) )
if( sizeof(resp) != _FPDKCOM_SendReceiveCommandWithTimeout(fd, FPDKPROTO_CMD_WRITEIC, dat,sizeof(dat), resp, sizeof(resp), FPDKCOM_CMDRSP_WRITE_TIMEOUT) )
return -1;

return( resp[3] | (((int)resp[4])<<8) );
Expand Down

0 comments on commit 85f5a7b

Please sign in to comment.