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.
可以在ccs post build指令转换成bin文件:
Hex转换工具详细描述可参考 章节11 Hex Conversion Utility Description:
https://www.ti.com/lit/ug/spru186w/spru186w.pdf
e2e.ti.com/.../680588
生成bin文件了,但是刷机后系统跑不起来,用仿真器加载是可以的,是烧录到emifa flash的0xb0000000地址吗?
刷机调用的是代码里自带的flash擦除和写的函数,所以需要转换为bin格式的吧
我对该型号不是很熟悉,请问是看到有过类似的讨论吗?是否直接转换成.bin就可以我不太确定,可能得先确认一格式的问题。
如果格式没有问题,是用的哪个烧写程序,程序中一般会指定烧写到flash的起始地址,例如0地址开始。
这是我写的刷机代码,都执行成功了的。百度上面记得以前看过,生成bin烧录到flash起始地址oxb0000000地址。你在帮忙确认下呢,谢谢了。
#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];
unsigned long 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);
}
我把tcf文件和cmd改成加载到FLASH编译出来的的bin有2.4GB,但是out只有2MB,cmd和tcf改成IRAM的编出来的就只有700KB
1.boot模式是硬件决定的吧?应该没问题,因为板子以前都能跑起来,只是刷了软件起不来。
2.另外仿真器可以调试从flash启动的程序吗,要怎么设置呢?我只知道加载到内存来调试
1.load symbol以后,pc指向B0000000就是emifa地址
2.然后单步运行到B0000024就卡住了,再点PC就是0x00000000开始跑