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/TMS320F28075: flash can't be written

Part Number: TMS320F28075
Other Parts Discussed in Thread: C2000WARE, , TMS320F28377D, TMS320F28377S

Tool/software: Code Composer Studio

Hi Expert,

I used TI example project  below to develop  programming flash through SCI bootrom .

C:\ti\c2000\C2000Ware_3_02_00_00\device_support\f2807x\examples\cpu1\F2807x_sci_flash_kernel\cpu01

But,  it seems that flash can't be written. Read back data is 0xFFFF.  All oReturnCheck return is OK.

oReturnCheck = Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector,  (uint32 *)(sectAddress[i]));

oReturnCheck = Fapi_doBlankCheck((uint32 *)(sectAddress[i]), sectSize[i],  &oFlashStatusWord);

    Buffer[0] = 0x1234;
    Buffer[1] = 0x5678;
    Buffer[2] = 0x90ab;
    Buffer[3] = 0xcdef;
    Buffer[4] = 0x1122;
    Buffer[5] = 0x3344;
    Buffer[6] = 0x5566;
    Buffer[7] = 0x7788;


u32Index = 0x80000;



                        oReturnCheck = Fapi_issueProgrammingCommand((uint32 *)u32Index, Buffer, sizeof(Buffer), 0, 0, Fapi_AutoEccGeneration);

  
                            while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy);

                                    if(oReturnCheck != Fapi_Status_Success)
                                    {
                                       while(!SciaRegs.SCICTL2.bit.TXEMPTY) { }
                                       SciaRegs.SCITXBUF.bit.TXDT = 0x62;
                                    }
                                    else
                                    {
                                        while(!SciaRegs.SCICTL2.bit.TXEMPTY) { }
                                        SciaRegs.SCITXBUF.bit.TXDT = 0x75;
                                    }

I used other device project to program flash,  for example  TMS320F28377S  , TMS320F28377D,  it is all right, no problem  .  Only TMS320F28075  can't write. 

I found the TMS320F2807x  project  using  TMS320F2837xD  F021 API.  I doubled  the API function running incorrectly

  • Hi Lei,

    F2837xD Flash API can be used for F28075.

    What is the operating frequency and the wait-states configuration you are using?

    What is the FMSTAT value after the program operation?

    Thanks and regards,

    Vamsi

  • Hi Vamsi,

    1)I used 120MHz CLK. 

    According  to  InitSysPll(XTAL_OSC,IMULT_12,FMULT_0,PLLCLK_BY_2);   function.   I sent 20MHz external clock.

    2)

        #if CPU_FRQ_120MHZ
        Flash0CtrlRegs.FRDCNTL.bit.RWAIT = 0x2;
        #endif

    3)

    The default  project  don't inculde  FLSEM setting,  I added  below code before InitFlash(),  but  can't write still.

       //
        // Grab flash semaphore for Zone1 to enable access to flash registers.
        //
        EALLOW;
        DcsmCommonRegs.FLSEM.all = 0xA501;
        EDIS;

    4)

    The default frequency parameter is 150 in Fapi_initializeAPI,  I modified 120,  but can't solve

    oReturnCheck = Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS, 150);

  • I found the reason.    " EALLOW;   and  EDIS; "    cause  API  function  unnormally.  Thank you.