TI中文支持网
TI专业的中文技术问题搜集分享网站

Can't find a source file at "/tmp/TI_MKLIB4kQNZn/SRC/exit.c"

开发环境为CCS6.1,C5535加外部SPI FLASH,仿真正常,现在想把程序烧到外部flash里,采用了官网提供的TI SPI Flash Programmer和SPI Boot Files发现都无法完成下载,程序提示以下错误,求大神解救,out文件已转换为bin文件。

Can't find a source file at "/tmp/TI_MKLIB4kQNZn/SRC/exit.c"Locate the file or edit the source lookup path to include its location.

Shine:

你把SPI Boot Files在ccs6.1重新编译一下再加载新的.out试试。

Hu Schuman:

回复 Shine:

肯定是编译过的,换了ccs5.5,一样的操作,还是一样的错误。。。

Shine:

回复 Hu Schuman:

那忽略这个错呢,看数据写到flash里了没?

Hu Schuman:

回复 Shine:

忽略过,然后断电上电看有没有运行程序,发现没有,好像是没有烧进去。

Shine:

回复 Hu Schuman:

用仿真器看一下flash里的内容是否是你烧进去的代码?

Hu Schuman:

回复 Shine:

这个如何查看呢,我flash是外部的,用的spiflash_write程序下载的。

Shine:

回复 Hu Schuman:

是SPI flash,那看不了。

那只能连上仿真器,跟一下boot过程,看代码有没有加载进来?

Tony Tang:

回复 Hu Schuman:

程序没运行,可能是你的程序有问题。

spiflash_writer主函数main最后没有while(1),运行完后自然就进入exit.c退出了。上面根本就不是什么错误。

void main( void )

{ /* Initialize BSL */ EZDSP5535_init( );

/* Display test ID */ printf( "\nRunning SPI FLASH Writer…\n");

/* Call test function */ TestFail = spiflash_writer( );

/* Check for test fail */ if ( TestFail != 0 ) { /* Print error message */ printf( " FAIL… error code %d… quitting\n", TestFail ); } else { /* Print pass message */ printf( " PASS\n" ); printf( "\n***ALL Tests Passed***\n" ); } StopTest();}

而spiflash_writer函数里回读校验,又怎么会没有写进去。

Int16 spiflash_writer( ){ Uint32 i, j, pages; Uint16* pdata; Int32 fileSize = 0; FILE *fPtr; Uint16 *ramPtr; /* Read the filename from host */ printf("Enter the file Name:\r\n"); scanf("%s", fileName); fflush(stdin);

/* Open a File from the hard drive */ printf("Opening file…\r\n"); fPtr = fopen(fileName, "rb"); if(fPtr == NULL) { printf("ERROR: File %s Open failed\r\n", fileName); return 1; } fileSize = 0; // Initialize size to 0

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

/* Setup pointer in RAM for temporary storage of data */ ramPtr = (Uint16*) bootImage; if(fileSize == 0) // Check if file was found { printf("ERROR: File read failed.. Closing program.\r\n"); fclose (fPtr); return 1; } fseek(fPtr,0,SEEK_SET);

if (fileSize != fread(ramPtr, 1, fileSize, fPtr)) // Read file to ram and check if read properly { printf("WARNING: File Size mismatch.\r\n"); return 1; } fseek(fPtr,0,SEEK_SET);

/* Calculate number of pages */ pages = (fileSize / spiflash_PAGESIZE) + 1;

/* Initialize the SPI interface */ EZDSP5535_SPIFLASH_init( );

/* Erase target area in spiflash */ printf("Erasing target area…\r\n"); EZDSP5535_SPIFLASH_erase( 0, fileSize);

/* Write to SPIFLASH */ printf("Writing file…\r\n"); for ( i = 0 ; i < pages ; i++ ) { /* Write a page */ EZDSP5535_SPIFLASH_write( ((Uint32)bootImage + (i * spiflash_PAGESIZE)), i * spiflash_PAGESIZE, spiflash_PAGESIZE ); }

/* Read and verify SPIFLASH */ printf("Checking file…\r\n"); for ( i = 0 ; i < pages ; i++ ) { /* Read a page */ EZDSP5535_SPIFLASH_read( i * spiflash_PAGESIZE, ( Uint32 )rx, spiflash_PAGESIZE );

/* Check the pattern */ pdata = ( Uint16* )((Uint32)bootImage + (i * spiflash_PAGESIZE)); for ( j = 0 ; j < spiflash_PAGESIZE; j++ ) { if ( ((*pdata++) & 0xFF)!= (rx[j])) return 1; // Fail } } return 0;

Hu Schuman:

回复 Tony Tang:

1.console窗口打印出all tests passed是不是说明程序已经下载进去了?
2.仿真运行的时候管脚有输出,但是断电启动,管脚还是没有输出,我的程序是否有问题?
3.示波器上看到上电时spiclk上有5个字节加6个字节的clk信号,是否为boot信号,但是之后就没有了,5535没有去从flash里读程序?
4.5535是否有硬件管脚设置让其进入spiflash boot模式?
5.谢谢各位大神的耐心解答。

Tony Tang:

回复 Hu Schuman:

Hu Schuman1.console窗口打印出all tests passed是不是说明程序已经下载进去了?

理论上是的。

Hu Schuman3.示波器上看到上电时spiclk上有5个字节加6个字节的clk信号,是否为boot信号,但是之后就没有了,5535没有去从flash里读程序?

说明芯片bootloader有去读flash, 但是没有完成,是不是你的bin文件转换的不对啊。你是怎么转的?

Hu Schuman4.5535是否有硬件管脚设置让其进入spiflash boot模式?

不需要,C5535是按顺序从boot外设读关键字的,读到关键字才继续从该外设读数据。

赞(0)
未经允许不得转载:TI中文支持网 » Can't find a source file at "/tmp/TI_MKLIB4kQNZn/SRC/exit.c"
分享到: 更多 (0)