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.

F28M36开发板,调用Flash API中的擦除函数,第一次擦除成功,第二次擦除失败。



TI工程师:

您好!最近我在F28M36X开发板上移植TI官方提供的F28M35X串口固件升级项目时,遇到一个问题。具体是项目移植成功后,我在第一次升级固件成功。但是在第二次升级固件时,升级失败,经过定位发现是在调用Flash API中的擦除函数失败,导致程序跑入死循环。现在遇到的问题:第一次固件升级时调用Flash擦除函数时成功,第二次固件升级时调用确是失败。请问,您知道什么原因导致?

  • 你好,调用擦除函数失败系统会报什么错吗?比如返回什么错误码?死循环具体是哪个?
  • 非常高兴您能帮助我解答,我在CCS单步运行程序时,并不会报错。但是,将bootloader烧录到flash中后,通过Labview UI与开发板进行命令。开发板上的APP接收到升级指令后,跳转进入bootloader,进行串口接收程序和flash擦除、编程。错误码我不知道从哪里获得,但是我通过oFlashStatus =Fapi_getFsmStatus();得出oFlashStatus=46 00 01 31; 死循环是进入Example_Error(oReturnCheck);
    代码如下:
    // Erase Sector L
    // Sector N has the CKFA code so leave it programmed
    oReturnCheck = Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector,
    (uint32 *)Bzero_SectorM_start);

    // Wait until FSM is done with erase sector operation
    while (Fapi_checkFsmForReady() != Fapi_Status_FsmReady){}

    // Verify that Sector L is erased. The Erase step itself does a verify
    // as it goes. This verify is a 2nd verification that can be done.
    oReturnCheck = Fapi_doBlankCheck((uint32 *)Bzero_SectorM_start,
    Bzero_16KSector_u32length,
    &oFlashStatusWord);



    if(oReturnCheck != Fapi_Status_Success)
    {
    //Check Flash API documentation for possible errors
    //If Erase command fails, use Fapi_getFsmStatus() function to get
    // the FMSTAT register contents
    //to see if any of the EV bit, ESUSP bit, CSTAT bit or VOLTSTAT
    //bit is set (Refer to API documentation for more details)
    oFlashStatus = Fapi_getFsmStatus();
    UARTSend((unsigned char *)oFlashStatus, 4);
    Example_Error(oReturnCheck);
    }
  • 额,有点抱歉,没太接触过基于labview的程序升级,看了下似乎并没有什么能提供给你的建议。你看是否方便转往我们英文E2E论坛去咨询一下国外的其他工程师?可以在以下论坛发帖咨询:
    e2e.ti.com/.../171
  • 好的,非常感谢您。请问常见的flash编程出错的原因有哪些?