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

TMS320C5517: nandflash 烧录

Part Number:TMS320C5517

自制板,参照5517EVM

按照SPRUHW2,使用hex55生成bin后,使用programmer下载后,没有提示完成,不知道是什么原因

Shine:

是不是bin文件很大还没烧写完?请问在EVM板上能成功烧写吗?自制板子的nand flash和EVM板一样吗?

,

WilliamFang:

我现在手头上没有EVM,能否帮我测试一下

,

Shine:

抱歉,C55x是很老的系列,我手头没有EVM板。您可以先尝试烧写一个小的bin文件看有没有问题。

,

WilliamFang:

嗯嗯,你说的没错,我换了一个,就可以烧录了。但是我怎么可以把bin改小呢?

另外,烧录跟cmd,gel文件有关吗?

有没有相关文档啊?谢谢

,

Shine:

请问您的bin文件多大?超过nand flash了?

,

Shine:

WilliamFang 说:另外,烧录跟cmd,gel文件有关吗?

gel文件和cmd文件没有关系,GEL文件只有在ccs调试环境下使用。如果GEL文件里有初始化板子的代码,在脱机时需要把这部分代码搬移到应用程序中。

,

WilliamFang:

bin只有68K,应该没有超过nand的容量,但是换了一个小于64K的bin就可以烧,是哪里限制了吗?

,

Shine:

建议用仿真器跟踪一下代码,在nand_flash.c处设置断点,看运行到哪里出错了。nand_flash.c

* Write the Boot-image to the NAND **************************************************************************/ if (inputFileName[0] == '\0') { printf("Opening flashimg.bin…\n"); pInputFile = fopen("flashimg.bin","rb"); } else { printf("Opening %s…\n", inputFileName); pInputFile = fopen(inputFileName, "rb"); } if (pInputFile == NULL) { printf("ERROR: Input file could not be opened\n"); exit(0); } else { printf("Input file opened\n"); }

/* Read all data from file and write it to the device (write full sectors) */ printf("Writing Boot-image to NAND…\n"); pTempSector = &nand_temp_sector[0]; addr = 0; nand_sector = nand_page * pNand->sectorsPerPage; while (!feof(pInputFile)) { rcv_count = fread(FileData, 1, 2, pInputFile); if (rcv_count == 0) { break; /* no more data to read */ } if ((rcv_count & 1) != 0) { printf("ERROR: Input File has an odd number of bytes (invalid)\n"); exit(1); } *pTempSector++ = (FileData[0] << 8) | FileData[1]; addr++; if ((addr%0x100) == 0) { printf("Programming… [TotalSize=%ld (0x%lX)]\n", addr, addr); if (pAtaDrive->AtaWriteSector(nand_sector-1, pAtaDrive->pAtaMediaState, (AtaUint16 *)&nand_temp_sector[0], 0)) { printf("ERROR in AtaWriteSector\n"); for (;;); } nand_sector++; pTempSector = &nand_temp_sector[0]; } } /* If there is unwritten data, write the last sector */ if (pTempSector != &nand_temp_sector[0]) { printf("Programming… [TotalSize=%ld (0x%lX)]\n", addr, addr); if (pAtaDrive->AtaWriteSector(nand_sector-1, pAtaDrive->pAtaMediaState, (AtaUint16 *)&nand_temp_sector[0], 0)) { printf("ERROR in AtaWriteSector\n"); for (;;); } } /* Flush the last sector */ printf("Flushing Data…\n"); if (pAtaDrive->AtaWriteSectorFlush(pAtaDrive->pAtaMediaState)) { printf("ERROR in AtaWriteSectorFlush\n"); for (;;); }

fclose(pInputFile);

printf("done\n");

,

WilliamFang:

我单步了一下,发现在这个位置,返回值等于0,然后就跳出了

rcv_count = fread(FileData, 1, 2, pInputFile); if (rcv_count == 0) { break; /* no more data to read */ }

有没有关于这个函数的说明,为什么会返回0

,

WilliamFang:

WilliamFang 说:

我单步了一下,发现在这个位置,返回值等于0,然后就跳出了

rcv_count = fread(FileData, 1, 2, pInputFile); if (rcv_count == 0) { break; /* no more data to read */ }

有没有关于这个函数的说明,为什么会返回0

我尝试把这一段屏蔽掉,又会卡在这里

if (pAtaDrive->AtaWriteSector(nand_sector-1, pAtaDrive->pAtaMediaState, (AtaUint16 *)&nand_temp_sector[0], 0)) { printf("ERROR in AtaWriteSector\n"); for (;;); }

我这到底是哪出问题了?

,

WilliamFang:

我又把原先大于64KB的bin文件重新编辑,删除了部分内容,以验证,是不是有哪里限制了64KB的容量

实测,这样就能烧入了

addr++; if ((addr%0x100) == 0) { printf("Programming… [TotalSize=%ld (0x%lX)]\n", addr, addr);

也就是说,这个addr不能超过0x8000

但是这个是unsigned long,应该也不会超啊

我不明白是哪里限制了,请帮忙排查一下,谢谢

,

Shine:

看到下面有个帖子类似的问题。https://e2e.ti.com/support/processors-group/processors/f/processors-forum/272412/flash-writing-problem/953334请试一下附件Spectrum Digital公司提供的的烧写程序。flash_programming.zip

,

WilliamFang:

我将附件中的programmer.out加载后,烧录bin文件,效果与之前一致

原帖是说.ezdsp5555.out有效,应该是指ezDSP5535吧,

我又查了一下,这个ezDSP5535只有spiflash,而另一款c5515 ezdsp只有norflash

而我用的是NANDFLASH,所以这两个out文件也用不了

能不能帮我向英文论坛那边咨询一下,NANDFLASH大于64K,有没有办法烧录

谢谢

,

Shine:

我升级到e2e了,但不一定有回复,C5000已经不怎么支持了。https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1050731/tms320c5517-programmer-out-can-t-burn-64k-bin-file-to-nand-flash

,

WilliamFang:

谢谢

,

Shine:

另外,看一下工程里是否用的large memory和rts55x.lib编译的,一般使用small memory会有64k的限制。

,

WilliamFang:

是的

,

Shine:

那这样配置对的。

,

Shine:

e2e工程师有回复了,是fread函数本身的限制。

You are correct. The fread() in rts55.lib does have size limitation of 64KB, because the num_left and num_read used in fread.c (rtssrc.zip in ccs\tools\compiler\C5500 Code Generation Tools 4.4.1\lib) is size_t which is unsigned int which is uint16.  

,

WilliamFang:

谢谢,我试一下

赞(0)
未经允许不得转载:TI中文支持网 » TMS320C5517: nandflash 烧录
分享到: 更多 (0)