INCOMPATIBLE PP CODE AND NP CODE!
是的,楼上的版主大大,我测试了您提供的那个71238a11.rar文件,刷到一半就提示image文件不对,当时我以为没有刷新成功,应该没有刷东西进去,并且当时我以telnet的方式还可以登录,并且进去flashfs看了ls的目录,NPimage及image文件的属性是fix的,所以我就没有引起注意,直到看了你的回复,我才去查这个incompatible单词的意思,才明白这个是"不兼容"的意思,看来这回是挂了. :(
按R键没有重启,按住SPACE键加电,它的提示还是一样的.我试了用XMODEM协议,没有办法重新传送正确的固件进去,这回是不是真的没有得救了?
附后,我找来的一段资料
Software Driver
SST39VF080
8 Mbit Multi-Purpose Flash
May 2003
ABOUT THE SOFTWARE
This application note provides a software driver example for 39VF080 8 Mbit
Multi-Purpose Flash, that can be used in any microprocessor based system.
Software driver example routines provided in this document utilize high-level
"C" programming language for broad platform support. In many cases, software
driver routines can be inserted "as is" into the main body of code being
developed by the system software developers. Extensive comments are included
in each routine to describe the function of each routine. The software driver
routines in "C" can be used with many microprocessors and microcontrollers.
ABOUT THE SST39VF080
Companion product datasheet for the 39VF080 should be reviewed in conjunction
with this application note for a complete understanding of the device.
The C code in this document contains the following routines, which are listed
in this order:
Name Function
------------------------------------------------------------------
Check_SST_39VF080 Check manufacturer and device ID
CFI_Query CFI Query Entry/Exit command sequence
Erase_One_Sector Erase a sector of 4096 bytes
Erase_One_Block Erase a block of 64K bytes
Erase_Entire_Chip Erase the contents of the entire chip
Program_One_Byte Alter data in one byte
Program_One_Sector Alter data in 4096 byte sector
Program_One_Block Alter data in 64K byte block
Check_Toggle_Ready End of internal program or erase detection using
Toggle bit
Check_Data_Polling End of internal program or erase detection using
Data# polling
"C" LANGUAGE DRIVERS
/***********************************************************************/
/* Copyright Silicon Storage Technology, Inc. (SST), 1994-2003 */
/* Example "C" language Driver of 39VF080 8 Mbit Multi-Purpose Flash */
/* Nelson Wang, Silicon Storage Technology, Inc. */
/* */
/* Revision 1.0, May 28, 2003 */
/* */
/* This file requires these external "timing" routines: */
/* */
/* 1.) Delay_150_Nano_Seconds */
/* 2.) Delay_25_Milli_Seconds */
/* 3.) Delay_100_Milli_Seconds */
/***********************************************************************/
#define FALSE 0
#define TRUE 1
#define SECTOR_SIZE 4096 /* Must be 4096 bytes for 39VF080 */
#define BLOCK_SIZE 65536 /* Must be 64K bytes for 39VF080 */
#define SST_ID 0xBF /* SST Manufacturer';s ID code */
#define SST_39VF080 0xD8 /* SST39VF080 device code */
typedef unsigned char BYTE;
typedef unsigned int WORD;
/* -------------------------------------------------------------------- */
/* EXTERNAL ROUTINES */
/* -------------------------------------------------------------------- */
extern void Delay_150_Nano_Seconds();
extern void Delay_25_Milli_Seconds();
extern void Delay_100_Milli_Seconds();
/************************************************************************/
/* PROCEDURE: Check_SST_39VF080 */
/* */
/* This procedure decides whether a physical hardware device has a */
/* SST39VF080 8 Mbit Multi-Purpose Flash installed or not. */
/* */
/* Input: */
/* None */
/* */
/* Output: */
/* return TRUE: indicates a SST39VF080 */
/* return FALSE: indicates not a SST39VF080 */
/************************************************************************/
int Check_SST_39VF080()
{
BYTE far *Temp;
BYTE SST_id1;
BYTE far *Temp1;
BYTE SST_id2;
int ReturnStatus;
/* Issue the Software Product ID code to 39VF080 */
Temp1 = (BYTE far *)0xC0005555; /* set up address to be C000:5555h */
*Temp1= 0xAA; /* write data 0xAA to the address */
Temp1 = (BYTE far *)0xC0002AAA; /* set up address to be C000:2AAAh */
*Temp1= 0x55; /* write data 0x55 to the address */
Temp1 = (BYTE far *)0xC0005555; /* set up address to be C000:5555h */
*Temp1= 0x90; /* write data 0x90 to the address */
Delay_150_Nano_Seconds(); /* insert delay time = Tida */
/* Read the product ID from 39VF080 */
Temp = (BYTE far *)0xC0000000; /* set up address to be C000:0000h */
SST_id1 = *Temp; /* get first ID byte */
SST_id1 = SST_id1 & 0x00FF; /* mask of higher byte */
Temp1 = (BYTE far *)0xC0000001; /* set up address to be C000:0001h */
SST_id2 = *Temp1; /* get second ID byte */
/* Determine whether there is a SST39VF080 installed or not */
if ((SST_id1 == SST_ID) && (SST_id2 ==SST_39VF080))
ReturnStatus = TRUE;
else
ReturnStatus = FALSE;
/* Issue the Soffware Product ID Exit code thus returning the 39VF080 */
/* to the read operating mode */
Temp1 = (BYTE far *)0xC0005555; /* set up address to be C000:5555h */
*Temp1 = 0xAA; /* write data 0xAA to the address */
Temp1 = (BYTE far *)0xC0002AAA; /* set up address to be C000:2AAAh */
*Temp1 = 0x55; /* write data 0x55 to the address */
Temp1 = (BYTE far *)0xC0005555; /* set up address to be C000:5555h */
*Temp1 = 0xF0; /* write data 0xF0 to the address */
Delay_150_Nano_Seconds(); /* insert delay time = Tida */
return(ReturnStatus);
}
/************************************************************************/
/* PROCEDURE: CFI_Query */
/* */
/* This procedure should be used to query for CFI information */
/* */
/* Input: */
/* None */
/* */
/* Output: */
/* None */
/************************************************************************/
void CFI_Query()
{
BYTE far *Temp1;
/* Issue the Software Product ID code to 39VF080 */
Temp1 = (BYTE far *)0xC0005555; /* set up address to be C000:5555h */
*Temp1= 0xAA; /* write data 0xAA to the address */
Temp1 = (BYTE far *)0xC0002AAA; /* set up address to be C000:2AAAh */
*Temp1= 0x55; /* write data 0x55 to the address */
Temp1 = (BYTE far *)0xC0005555; /* set up address to be C000:5555h */
*Temp1= 0x98; /* write data 0x98 to the address */
Delay_150_Nano_Seconds(); /* insert delay time = Tida */
/* --------------------------------- */
/* Perform all CFI operations here */
/* NOTE: no sample code provided */
/* --------------------------------- */
/* Issue the CFI Exit code thus returning the 39VF080 */
/* to the read operating mode */
Temp1 = (BYTE far *)0xC0005555; /* set up address to be C000:5555h */
*Temp1 = 0xAA; /* write data 0xAA to the address */
Temp1 = (BYTE far *)0xC0002AAA; /* set up address to be C000:2AAAh */
*Temp1 = 0x55; /* write data 0x55 to the address */
Temp1 = (BYTE far *)0xC0005555; /* set up address to be C000:5555h */
*Temp1 = 0xF0; /* write data 0xF0 to the address */
Delay_150_Nano_Seconds(); /* insert delay time = Tida */
}
/************************************************************************/
/* PROCEDURE: Erase_One_Sector */
/* */
/* This procedure can be used to erase a total of 4096 bytes. */
/* */
/* Input: */
/* Dst DESTINATION address where the erase operation starts */
/* */
/* Output: */
/* NONE */
/************************************************************************/
void Erase_One_Sector (BYTE far *Dst)
{
BYTE far *Temp;
/* Issue the Sector Erase command to 39VF080 */
Temp = (BYTE far *)0xC0005555; /* set up address to be C000:5555h */
*Temp = 0xAA; /* write data 0xAA to the address */
Temp = (BYTE far *)0xC0002AAA; /* set up address to be C000:2AAAh */
*Temp = 0x55; /* write data 0x55 to the address */
Temp = (BYTE far *)0xC0005555; /* set up address to be C000:5555h */
*Temp = 0x80; /* write data 0x80 to the address */
Temp = (BYTE far *)0xC0005555; /* set up address to be C000:5555h */
*Temp = 0xAA; /* write data 0xAA to the address */
Temp = (BYTE far *)0xC0002AAA; /* set up address to be C000:2AAAh */
*Temp = 0x55; /* write data 0x55 to the address */
Temp = Dst; /* set up starting address to be erased */
*Temp = 0x30; /* write data 0x30 to the address */
Delay_25_Milli_Seconds(); /* Delay time = Tse */
}
/************************************************************************/
/* PROCEDURE: Erase_One_Block */
/* */
/* This procedure can be used to erase a total of 64K words. */
/* */
/* Input: */
/* Dst DESTINATION address where the erase operation starts */
/* */
/* Output: */
/* NONE */
/************************************************************************/
void Erase_One_Block (BYTE far *Dst)
{
BYTE far *Temp;
/* Issue the Sector Erase command to 39VF080 */
Temp = (BYTE far *)0xC0005555; /* set up address to be C000:5555h */
*Temp = 0xAA; /* write data 0xAA to the address */
Temp = (BYTE far *)0xC0002AAA; /* set up address to be C000:2AAAh */
*Temp = 0x55; /* write data 0x55 to the address */
Temp = (BYTE far *)0xC0005555; /* set up address to be C000:5555h */
*Temp = 0x80; /* write data 0x80 to the address */
Temp = (BYTE far *)0xC0005555; /* set up address to be C000:5555h */
*Temp = 0xAA; /* write data 0xAA to the address */
Temp = (BYTE far *)0xC0002AAA; /* set up address to be C000:2AAAh */
*Temp = 0x55; /* write data 0x55 to the address */
Temp = Dst; /* set up starting address to be erased */
*Temp = 0x50; /* write data 0x50 to the address */
Delay_25_Milli_Seconds(); /* Delay time = Tbe */
}
/************************************************************************/
/* PROCEDURE: Erase_Entire_Chip */
/* */
/* This procedure can be used to erase the entire chip. */
/* */
/* Input: */
/* NONE */
/* */
/* Output: */
/* NONE */
/************************************************************************/
void Erase_Entire_Chip()
{
BYTE far *Temp;
/* Issue the Chip Erase command to 39VF080 */
Temp = (BYTE far *)0xC0005555; /* set up address to be C000:5555h */
*Temp = 0xAA; /* write data 0xAA to the address */
Temp = (BYTE far *)0xC0002AAA; /* set up address to be C000:2AAAh */
*Temp = 0x55; /* write data 0x55 to the address */
Temp = (BYTE far *)0xC0005555; /* set up address to be C000:5555h */
*Temp = 0x80; /* write data 0x80 to the address */
Temp = (BYTE far *)0xC0005555; /* set up address to be C000:5555h */
*Temp = 0xAA; /* write data 0xAA to the address */
Temp = (BYTE far *)0xC0002AAA; /* set up address to be C000:2AAAh */
*Temp = 0x55; /* write data 0x55 to the address */
Temp = (BYTE far *)0xC0005555; /* set up address to be C000:5555h */
*Temp = 0x10; /* write data 0x10 to the address */
Delay_100_Milli_Seconds(); /* Delay Tsce time */
}
/************************************************************************/
/* PROCEDURE: Program_One_Byte */
/* */
/* This procedure can be used to program ONE byte of data to the */
/* 39VF080. */
/* */
/* NOTE: It is necessary to first erase the sector containing the */
/* byte to be programmed. */
/* */
/* Input: */
/* Src The BYTE which will be written to the 39VF080 */
/* Dst DESTINATION address which will be written with the */
/* data passed in from Src */
/* */
/* Output: */
/* None */
/************************************************************************/
void Program_One_Byte (BYTE Src, BYTE far *Dst)
{
BYTE far *Temp;
BYTE far *DestBuf;
DestBuf = Dst;
Temp = (BYTE far *)0xC0005555; /* set up address to be C000:555h */
*Temp = 0xAA; /* write data 0xAA to the address */
Temp = (BYTE far *)0xC0002AAA; /* set up address to be C000:2AAAh */
*Temp = 0x55; /* write data 0x55 to the address */
Temp = (BYTE far *)0xC0005555; /* set up address to be C000:5555h */
*Temp = 0xA0; /* write data 0xA0 to the address */
*DestBuf = Src; /* transfer the byte to destination */
Check_Toggle_Ready(DestBuf); /* wait for TOGGLE bit to get ready */
}
/************************************************************************/
/* PROCEDURE: Program_One_Sector */
/* */
/* This procedure can be used to program a total of 4096 bytes of data */
/* to the SST39VF080. */
/* */
/* NOTES: 1. It is necessary to first erase the sector before the*/
/* programming. */
/* 2. This sample code assumes the destination address passed*/
/* from the calling function is the starting address of the*/
/* sector.*/
/* */
/* Input: */
/* Src SOURCE address containing the data which will be */
/* written to the 39VF080 */
/* Dst DESTINATION address which will be written with the */
/* data passed in from Src */
/* */
/* Output: */
/* None */
/************************************************************************/
void Program_One_Sector (BYTE far *Src, BYTE far *Dst)
{
BYTE far *SourceBuf;
BYTE far *DestBuf;
int Index;
SourceBuf = Src;
DestBuf = Dst;
Erase_One_Sector(Dst); /* erase the sector first */
for (Index = 0; Index < SECTOR_SIZE; Index++)
{
/* transfer data from source to destination */
Program_One_Byte( *SourceBuf, DestBuf);
++DestBuf;
++SourceBuf;
}
}
/************************************************************************/
/* PROCEDURE: Program_One_Block */
/* */
/* This procedure can be used to program a total of 64k bytes of data */
/* to the SST39VF080. */
/* */
/* NOTES: 1. It is necessary to first erase the block before the*/
/* programming. */
/* 2. This sample code assumes the destination address passed*/
/* from the calling function is the starting address of the*/
/* block.*/
/**/
/* Input: */
/* Src SOURCE address containing the data which will be */
/* written to the 39VF080 */
/* Dst DESTINATION address which will be written with the */
/* data passed in from Src */
/* */
/* Output: */
/* None */
/************************************************************************/
void Program_One_Block (BYTE far *Src, BYTE far *Dst)
{
BYTE far *SourceBuf;
BYTE far *DestBuf;
int Index;
SourceBuf = Src;
DestBuf = Dst;
Erase_One_Block(Dst); /* erase the sector first */
for (Index = 0; Index < BLOCK_SIZE; Index++)
{
/* transfer data from source to destination */
Program_One_Byte( *SourceBuf, DestBuf);
++DestBuf;
++SourceBuf;
}
}
/************************************************************************/
/* PROCEDURE: Check_Toggle_Ready */
/* */
/* During the internal program cycle, any consecutive read operation */
/* on DQ6 will produce alternating 0';s and 1';s (i.e. toggling between */
/* 0 and 1). When the program cycle is completed, DQ6 of the data will */
/* stop toggling. After the DQ6 data bit stops toggling, the device is */
/* ready for next operation. */
/* */
/* Input: */
/* Dst Must already be set-up by the caller */
/* */
/* Output: */
/* None */
/************************************************************************/
void Check_Toggle_Ready (BYTE far *Dst)
{
BYTE Loop = TRUE;
BYTE PreData;
BYTE CurrData;
unsigned long TimeOut = 0;
PreData = *Dst;
PreData = PreData & 0x40;
while ((TimeOut< 0x07FFFFFF) && (Loop))
{
CurrData = *Dst;
CurrData = CurrData & 0x40;
if (PreData == CurrData)
Loop = FALSE; /* ready to exit the while loop */
PreData = CurrData;
TimeOut++;
}
}
/************************************************************************/
/* PROCEDURE: Check_Data_Polling */
/* */
/* During the internal program cycle, any attempt to read DQ7 of the */
/* last byte loaded during the page/byte-load cycle will receive the */
/* complement of the true data. Once the program cycle is completed, */
/* DQ7 will show true data. */
/* */
/* Input: */
/* Dst Must already be set-up by the caller */
/* True Data is the original (true) data */
/* */
/* Output: */
/* None */
/************************************************************************/
void Check_Data_Polling (BYTE far *Dst, BYTE TrueData)
{
BYTE Loop = TRUE;
BYTE CurrData;
unsigned long TimeOut = 0;
TrueData = TrueData & 0x80;
while ((TimeOut< 0x07FFFFFF) && (Loop))
{
CurrData = *Dst;
CurrData = CurrData & 0x80;
if (TrueData == CurrData)
Loop = FALSE; /* ready to exit the while loop */
TimeOut++;
}
}
[br][br]-=-=-=- 以下内容由 天涯 在 2006年07月12日 08:25am 时添加 -=-=-=-
对了,当时刷新不成功的时候,我就想反正测试一个也是试,就多试几个,就试了上海贝尔的那个6开头的那个,完整我记不得了,还有中兴831的那个V2.9f的,都不成功.
上面这段程序,是不是可以改成FLASH程序?然后用接数据线的办法把固件给直接刷回去? |