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.

不能连续擦除Flash sector

Other Parts Discussed in Thread: CONTROLSUITE

我在C:\ti\controlSUITE\device_support\f28m35x\v207\F28M35x_examples_Dual\flash_prog\m3 的示例代码中加入下面一段代码,发现不能连续的擦写sector,有时候能连续的擦除两三个sector,有时候不能,总是在Fapi_doBlankCheck报出错,参考过e2e上两个回复,

e2e.ti.com/.../1233117

e2e.ti.com/.../1204541

按照提示添加了设置:

*(int *)0x400FA160 = 0xC12F59A0;
FlashInit();

oLibInfo = Fapi_getLibraryInfo();
Fapi_setupBankSectorEnable();

都是一样,不能做连续擦除,添加代码如下:

uint32 sectorstart,num;

uint32 sectorlength;
sectorstart=0x00230000;
sectorlength=0;
for(num=6;num<oFlashBankSectors.u32NumberOfSectors;num++)
{
if(num>0)
{
sectorstart=sectorstart+sectorlength;
}
else
{sectorstart=oFlashBankSectors.u32BankStartAddress;}
sectorlength=((uint32)oFlashBankSectors.au8SectorSizes[num])*2048;
oReturnCheck = Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector,
(uint32 *)sectorstart);
// Wait until FSM is done with erase sector operation
while (Fapi_checkFsmForReady() != Fapi_Status_FsmReady){}

oReturnCheck = Fapi_doBlankCheck((uint32 *)sectorstart,
sectorlength,
&oFlashStatusWord);
if(oReturnCheck != Fapi_Status_Success)
{
//Example_Error(oReturnCheck);
}
}

  • 建议你参考flash api的例程去做

    C:\ti\controlSUITE\libs\utilities\flash_api\f28m35x\v100\example\m3

    Fapi_issueAsyncCommandWithAddress 这个函数在做擦除时就是一个扇区来做的。

    建议好好看一下这个文档,因为F021的flash操作比较严格,包括烧写时。

    F021 Flash API Reference Guide

    Eric


  • 我这个就是在例程里面,按照做的例程格式做的。 另外我使用的例程是V207,版本比C:\ti\controlSUITE\libs\utilities\flash_api\f28m35x\v100\example\m3这个例程要新