|
编译的时候是没有错误的,
我把代码烧入到ARM板调试的时候发现字符串没有传过去.
#define FLASHDIO_ADDR (unsigned int*)0xA2000000
#define EBOOT_ADDR (unsigned int*)0xA2002000
#define IPL_ADDR (unsigned int*)0xA2150000
#define MIPL_ADDR (unsigned int*)0xA2001000
#define DIAGPDK_ADDR (unsigned int*)0xA2000000
#define DATA_ADDR (unsigned int*)0xA2000000
Int32 Test_SD_Flash(Int8 argv[MAX_ARGS][MAX_LEN],Int32 argc)
{
char buffer[10]= "FLASH";
char bufferA[10]= "EBOOT";
char bufferB[10]= "IPL";
char bufferC[10]= "MIPL";
char bufferD[10]= "DIAGPDK";
char bufferE[10]= "DATA";
int a0,a1,a2,a3,a4,a5;
Test_Preamble("Write Flash Image");
a0=ReadAFile(bufferA,"NB0",0xA0000,EBOOT_ADDR);
if(a0) FMWriteFlashEBoot();
a1=ReadAFile(bufferB,"NB0",IMAGE_IPL_CODE_SIZE,IPL_ADDR);
if(a1) FMWriteFlashIPL();
a2=ReadAFile(bufferC,"NB0",0x800,MIPL_ADDR);
if(a2) FMWriteMIPL();
a3=ReadAFile(bufferD,"NB0",0x80000,DIAGPDK_ADDR);
if(a3) WriteFlashDaigBDK();
a4=ReadAFile(bufferE,"NB0",IMAGE_DATA_IMAGE_SIZE,DATA_ADDR);
if(a4) WriteFlashDatanb0();
a5=ReadAFile(buffer,"DIO",IMAGE_WINCE_CODE_SIZE,FLASHDIO_ADDR);
if(a5) WriteFlashDIO();
EdbgOutputDebugString ("SDRAM to FLASH OK\n");
Test_End(0);
return 0;
}
函数的大致意思是把手机板的NANDFLASH里的内容读到SDRAM,再做成文件格式放到SD卡里.
读NANDFLASH的函数厂商给的,分别读到FLASHDIO_ADDR ,EBOOT_ADDR...这些地址.
我出现问题的是开始时ReadAFile("EBOOT";,"NB0",0xA0000,EBOOT_ADDR);
这样直接代入字符串,参数竟然没传进去.(我自己加调试输出语句检查出来的,编译通过了)
后来改成上面这种方式就好了.不过我承认这种是偶然发生的,因为那个"NB0"总是传进去了,没有发生错误. |
|