This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320C6455: TMS3206455生成的bin文件烧录到flash跑不起来。

Part Number: TMS320C6455
Other Parts Discussed in Thread: TMS320C6678

1.ccs5.2正常加载DEBUG模式下编译出来的out到IRAM,可以跑起来,但是转换成bin后烧录到emifa接口的flash就跑不起来。

2.下面是我自己写的烧录代码并且烧录成功了的没报错和转换成bin的命令。

请帮忙看看有没遇到过类似的问题谢谢了!

"${CCS_INSTALL_ROOT}/utils/tiobj2bin/tiobj2bin.bat" "${BuildArtifactFileName}" "${BuildArtifactFileName}.bin" "${CG_TOOL_ROOT}/bin/ofd6x.exe" "${CG_TOOL_ROOT}/bin/hex6x.exe" "${CCS_INSTALL_ROOT}/utils/tiobj2bin/mkhex4bin.exe"

烧录代码如下

#define E_PASS 0
#define E_FAIL -1
static Uint8 tx[550];
static Uint8 rx[550];
void write_flash()
{
Int16 i;
Uint8* p8; ;
FILE *fPtr;
Int32 fileSize = 0;
Int32 no_of_pages;
Int32 no_of_sectors;
Int8 fileName[256], itype[20];
Int32 sector_size;
sector_size = 0x020000;

printf("Enter the File Name\n");
scanf("%s", fileName);
fflush(stdin);
fPtr = fopen(fileName, "rb");
if(fPtr == NULL)
{
printf("File %s Open failed\n", fileName);
return E_FAIL;
}

printf("Reading file...");
printf("This may take sometime depending on the size of the file...\n");
fflush(stdout);

// Initialize the pointer
fileSize = 0;

// Read file size
fseek(fPtr,0,SEEK_END);
fileSize = ftell(fPtr);

if(fileSize == 0)
{
printf("File read failed.. Closing APP\n");
fclose (fPtr);
return E_FAIL;
}
fseek(fPtr,0,SEEK_SET);

no_of_sectors = (fileSize/sector_size + ((fileSize % sector_size) ? 1 : 0));
FlashErase(0xb0000000,no_of_sectors*sector_size);
printf("Writing flash number of pages: %d\n", no_of_pages);
i = 0;
while(!feof(fPtr))
{
p8 = (Uint8*) tx;
if(!feof(fPtr)) {
fread(p8, 1, 512, fPtr);
}
FlashWrite(0xb0000000 + i * 512, ( Uint8 *)tx, 512);
i++;
}

fseek(fPtr,0,SEEK_SET);

printf("Reading verifying the file.. ");
fflush(stdout);

i = 0;

while(!feof(fPtr))
{
unsigned int nbytes;

if(!feof(fPtr)) {
nbytes = fread(tx, 1, 512, fPtr);
}
tx[nbytes] = '\0';

FlashRead (0xb0000000 + i * 512, (Uint8 *)rx, 512 );
rx[nbytes] = '\0';
if(strcmp((const char *)rx,(const char *)tx)!= 0) {
printf("Files did not match @ %d\n", ftell(fPtr));
goto finish;
}
i++;
}

printf("Files matched \n");

finish:
fclose(fPtr);
}