Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a309093
Allow HEX/S19 file size up to 256M
iagranat Apr 16, 2024
3de800c
Merge pull request #81 from iagranat/master
Benwang217 Apr 17, 2024
b48d742
Add macOS compatibility
superjeng1 Apr 24, 2024
25e8c97
Update ChipInfoDb.dedicfg
Benwang217 May 10, 2024
553dd08
Update ChipInfoDb.dedicfg
Benwang217 May 28, 2024
9eb6a4a
Update ChipInfoDb.dedicfg
Benwang217 May 28, 2024
290a7c2
Update ChipInfoDb.dedicfg
Benwang217 May 28, 2024
a4c06ab
Update ChipInfoDb.dedicfg
Benwang217 Jun 27, 2024
15e0195
Disable forcing of default compiler
tym2k1 Jul 8, 2024
4dd27bd
Merge branch 'DediProgSW:master' into macos-compat
superjeng1 Jul 11, 2024
436ac5c
Fix flashing with muliple dediprogs
jkaterberg Jul 11, 2024
55b4013
Makefile: add conditional stripping
tym2k1 Jul 22, 2024
6b01b33
Merge pull request #83 from superjeng1/macos-compat
Benwang217 Jul 23, 2024
91f990f
Merge pull request #88 from tym2k1/add_nostrip_var
Benwang217 Jul 23, 2024
b1fbcbc
Merge pull request #86 from tym2k1/master
Benwang217 Jul 23, 2024
7e82245
Merge pull request #87 from jkaterberg/master
Benwang217 Jul 30, 2024
7fd01ee
Update dpcmd.c
Benwang217 Sep 13, 2024
11c3d01
Initial FreeBSD build support
emaste Oct 8, 2024
56ca673
Print actual OS name, not always Linux
emaste Oct 8, 2024
bff9925
Merge pull request #91 from emaste/freebsd
Benwang217 Oct 9, 2024
5fe3eb6
Add a FreeBSD check around including the sys/limits.h file
Oct 23, 2024
c75fbd5
Update readme to indicate that pkg-config is required for linking
Oct 23, 2024
24ce9af
Merge pull request #93 from jgstroud/fix_compile
Benwang217 Oct 24, 2024
e9416f6
Update README.md
Benwang217 Nov 14, 2024
42edbcc
Update dpcmd.c
Benwang217 Nov 14, 2024
8777b9c
Update project.c
Benwang217 Nov 14, 2024
3c93e57
1. Synchronize Linux chip database with Windows(UTF16)
Benwang217 Feb 26, 2025
fef1f8e
Update chip database
Benwang217 Feb 26, 2025
a1558fb
Correct F50L2G41XA parameters in ChipInfoDb.dedicfg
Benwang217 Feb 26, 2025
135655b
Update chip database
Benwang217 Apr 30, 2025
9eaffcc
dpcmd: Don't crash when an invalid long option is supplied
nzmsv Jun 9, 2025
8e613e0
Fix W25Q256FV read issue
Benwang217 Jul 17, 2025
eb4641e
Update chip database
Benwang217 Jul 22, 2025
ede7bc4
Merge pull request #97 from nzmsv/master
Benwang217 Aug 11, 2025
27597f3
1. Update chip database
Benwang217 Nov 26, 2025
172e51d
Merge branch 'master' of https://github.com/DediProgSW/SF99Linux
Benwang217 Nov 26, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified ChipInfoDb.dedicfg
Binary file not shown.
3 changes: 2 additions & 1 deletion ChipInfoDb.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ int Dedi_Search_Chip_Db(long RDIDCommand, long UniqueID, CHIP_INFO* Chip_Info, i
int Dedi_Search_Chip_Db(char* TypeName, long RDIDCommand, long UniqueID, CHIP_INFO* Chip_Info, int search_all);
#endif
int Dedi_Search_Chip_Db_ByTypeName(char* TypeName, CHIP_INFO* Chip_Info);
FILE* openChipInfoDb(void);
//FILE* openChipInfoDb(void);
bool GetChipDbPath(char *Path);

#endif
91 changes: 91 additions & 0 deletions FlashCommand.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,94 @@ int FlashCommand_SendCommand_SetupPacketForBulkRead(struct CAddressRange* AddrRa
// send rq via control pipe
return OutCtrlRequest(&rq, vInstruction, rq.Length, Index);
}

int FlashCommand_SendCommand_SetupPacketForBulkReadNAND(unsigned int dwAddr, unsigned int PageNum, unsigned char modeRead,WORD pageSize, WORD blockPages, unsigned char ReadCom,unsigned char AddrLen, unsigned char ReadDummyLen,unsigned char nCA, int USBIndex)
{
unsigned char vInstruction[18];
vInstruction[0]=(dwAddr & 0xff) ;
vInstruction[1]=((dwAddr>>8) & 0xff);
vInstruction[2]=((dwAddr>>16) & 0xff);
vInstruction[3]=((dwAddr>>24) & 0xff);

//dwLength
vInstruction[4]=((unsigned char)(PageNum & 0xff)); // lowest byte of length : page number
vInstruction[5]=((unsigned char)( (PageNum >> 8) & 0xff)); // highest byte of length: page number
vInstruction[6]=((unsigned char)( (PageNum >> 16) & 0xff) );
vInstruction[7]=((unsigned char)( (PageNum >> 24) & 0xff) );

//dwMode
vInstruction[8]=(modeRead);
vInstruction[9]=(modeRead>>8);

//pagesize
vInstruction[10]=((unsigned char)(pageSize));
vInstruction[11]=((unsigned char)(pageSize>>8));

//blockpages
vInstruction[12]=((unsigned char)(blockPages));
vInstruction[13]=((unsigned char)(blockPages>>8));

vInstruction[14]=((unsigned char)(ReadCom));//cmd

vInstruction[15]=((unsigned char)AddrLen);//addrLen

vInstruction[16]=((unsigned char)(ReadDummyLen));

vInstruction[17]=((unsigned char)nCA);

CNTRPIPE_RQ rq ;
rq.Function = URB_FUNCTION_VENDOR_ENDPOINT ;
rq.Direction = VENDOR_DIRECTION_OUT ;
rq.Request = DTC_READ_NAND ;
rq.Value = 0 ;
rq.Index = 0 ;
rq.Length = (unsigned long)(sizeof(vInstruction)) ;//40

// send rq via control pipe
return OutCtrlRequest(&rq, vInstruction,rq.Length,USBIndex);
}

bool FlashCommand_SendCommand_SetupPacketForBulkWriteNAND(unsigned int dwAddr, size_t dwLength,unsigned char modeWrite,WORD pageSize, WORD blockPages, unsigned char WriteCom,unsigned char AddrLen, unsigned char WriteDummyLen,unsigned char nCA, int USBIndex)
{
unsigned char vInstruction[40]={0};
//dwAddr;
vInstruction[0]=(dwAddr & 0xff);
vInstruction[1]=((dwAddr>>8) & 0xff);
vInstruction[2]=((dwAddr>>16) & 0xff);
vInstruction[3]=((dwAddr>>24) & 0xff);

//dwLength
vInstruction[4]=((unsigned char)(dwLength & 0xff)); // lowest byte of length : page number
vInstruction[5]=((unsigned char)( (dwLength >> 8) & 0xff)); // highest byte of length: page number
vInstruction[6]=((unsigned char)( (dwLength >> 16) & 0xff) );
vInstruction[7]=((unsigned char)( (dwLength >> 24) & 0xff) );

//dwMode
vInstruction[8]=((unsigned char)modeWrite);
vInstruction[9]=((unsigned char)(modeWrite>>8));

//pagesize
vInstruction[10]=((unsigned char)pageSize);
vInstruction[11]=((unsigned char)(pageSize>>8));

//blockpages
vInstruction[12]=(blockPages);
vInstruction[13]=((unsigned char)(blockPages>>8));
vInstruction[14]=(WriteCom);//cmd
vInstruction[15]=(AddrLen);//addrLen
vInstruction[16]=(4);
vInstruction[17]=(nCA);

CNTRPIPE_RQ rq ;

rq.Function = URB_FUNCTION_VENDOR_ENDPOINT ;
rq.Direction = VENDOR_DIRECTION_OUT ;
rq.Request = WRITE_NAND ;
rq.Value = 0 ;
rq.Index = 0 ;
rq.Length = sizeof(vInstruction);

// send rq via control pipe
return OutCtrlRequest(&rq, vInstruction,rq.Length,USBIndex);
}

3 changes: 3 additions & 0 deletions FlashCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@ int FlashCommand_SendCommand_SetupPacketForBulkWrite(struct CAddressRange* AddrR
int FlashCommand_SendCommand_SetupPacketForAT45DBBulkWrite(struct CAddressRange* AddrRange, unsigned char modeWrite, unsigned char WriteCom, int Index);

int FlashCommand_SendCommand_SetupPacketForBulkRead(struct CAddressRange* AddrRange, unsigned char modeRead, unsigned char ReadCom, unsigned int AddrLen, unsigned int DummyLen, int Index);
int FlashCommand_SendCommand_SetupPacketForBulkReadNAND(unsigned int dwAddr, unsigned int PageNum, unsigned char modeRead,WORD pageSize, WORD blockPages, unsigned char ReadCom,unsigned char AddrLen, unsigned char ReadDummyLen,unsigned char nCA, int USBIndex);
bool FlashCommand_SendCommand_SetupPacketForBulkWriteNAND(unsigned int dwAddr, size_t dwLength,unsigned char modeWrite,WORD pageSize, WORD blockPages, unsigned char WriteCom,unsigned char AddrLen, unsigned char WriteDummyLen,unsigned char nCA, int USBIndex);


#endif //FLASHCOMMANDS
Loading