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/TMS320F28377D: DCSM OTP programming only successfully on CPU1 zone1

Part Number: TMS320F28377D


Tool/software: Code Composer Studio

Hi expert,

I used flash API function through Bootrom SCI to program TMS320F28377D flash and dcsm otp.  Now,  I  can program CPU1 flash and CPU2 flash successfully. 

However,  when I tested  dcsm otp programming,  only CPU1 zone1  successfully. 

Detail:

(1) CPU1 dcsm otp zone1

Z1-LINKPOINTER 3  value is 0xFFFFFFF1  (  writed by mistake during testing)

Z1-PSWDLOCK value is 0xFFFFFFF1

Z1-BOOTCTRL value is 0x0B5A

ZoneSelectBlock1( address 0x78020)

Zx-GRABRAM  value is 0xFFFF5555

Zx-GRABSECT value is 0xF5555555

Zx-CSMPSWD[0,1,2,3] value is 128-bit password

Other words are 0xFFFF

Programming these dcsm otp are right,  read back ok.

(2)  CPU1 dcsm otp zone2  ,  CPU2 dcsm otp zone1,   CPU2 dcsm otp zone2

On the three zones,  I tried to change  PSWDLOCK and  GRABRAM  values,  but read back values were all 0xFFFFFFFF.

I used standard  API function,  and  Fapi_Status is return success

Fapi_issueProgrammingCommand(DstAddr,SrcAddr,8,0,0,Fapi_AutoEccGeneration);

while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy);

oReturnCheck = Fapi_Status_Success

  • Hi,

    You have programmed LINKPOINTER3 value 0xFFFFFFF1  which is not valid. What about LINKPOINTER1 and LINKPOINTER2 ? Are these correct and remain to default value of 0xFFFF_FFFF ?

    For Zone2 and CPU2 settings, have you checked the map file to confirm that those section are used in map file?

    Regards,

    Vivek Singh

  • Hi Vivek,

    LINKPOINTER1 and LINKPOINTER2 remain to default value of 0xFFFF_FFFF.

    I didn't use map file to define flash and dcsm otp.  I  downloaded  program API algorithm to RAM  through SCI bootloader.  Then sent data to RAM ,  and  run program API algorithm  in RAM. 

    code:

        u32Index = 0x78000;
    
            for(k=0; k < 0x80; k++)
            {
                for(i=0; i < 8; i++)
                {
                    wordData = 0x0000;
                    byteData = 0x0000;
                    while(SciaRegs.SCIRXST.bit.RXRDY != 1) { }
                    wordData = SciaRegs.SCIRXBUF.bit.SAR;
                    while(SciaRegs.SCIRXST.bit.RXRDY != 1) { }
                    byteData = SciaRegs.SCIRXBUF.bit.SAR;
                    // form the wordData from the MSB:LSB
                    wordData |= (byteData << 8);
                    Buffer[i] = wordData;
                }
    
           //     if(k==0x40)
            //    {
            //        DcsmCommonRegs.FLSEM.all = 0xA502;
             //   }
    
                if((k==0x3)||(k==0x43))
                {
                    u32Index+= 4;
    
                    Buffer[0] = Buffer[4];
                    Buffer[1] = Buffer[5];
                    Buffer[2] = Buffer[6];
                    Buffer[3] = Buffer[7];
    
                    oReturnCheck = Fapi_issueProgrammingCommand((uint32 *)u32Index, Buffer, 4, 0, 0, Fapi_AutoEccGeneration);
    
                    u32Index+= 4;
                }
    
                else
                {
                    oReturnCheck = Fapi_issueProgrammingCommand((uint32 *)u32Index, Buffer, 8, 0, 0, Fapi_AutoEccGeneration);
    
                    u32Index+= 8;
                }
    
             //   oReturnCheck = Fapi_issueProgrammingCommand((uint32 *)u32Index, Buffer, 8, 0, 0, Fapi_AutoEccGeneration);
             //   oReturnCheck = Fapi_issueProgrammingCommand((uint32 *)u32Index, Buffer, 16, 0, 0, Fapi_DataOnly);
    
                // Wait until the Flash program operation is over
                while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy);
    
                if(oReturnCheck != Fapi_Status_Success)
                {
                  // Check Flash API documentation for possible errors
                //   Example_Error(oReturnCheck);
                   while(!SciaRegs.SCICTL2.bit.TXEMPTY) { }
                   SciaRegs.SCITXBUF.bit.TXDT = 0x62;
               //    SciaRegs.SCITXBUF.bit.TXDT = oReturnCheck;
                }
                else
                {
                    while(!SciaRegs.SCICTL2.bit.TXEMPTY) { }
                    SciaRegs.SCITXBUF.bit.TXDT = 0x58;
                }
    
    
            //    u32Index+= 8;
    
            }
    

    When  u32Index = 0x80000;  wirte to flash,  there was  no problem.

  • Hi,

    Are there any other suggestion about why can't program otp successfully on zone2?

  • Hi Fang,

    Can you share the CPU1  Zone2 security setting which you are trying to program? Also if you could connect to CCS and provide the snapshot of CCS memory watch view for Zone2 security setting (0x78200), it'll be helpful.

    Regards,

    Vivek Singh

  • Hi Fang,

    Can you share the security setting as requested in last post ? If you already resolved the issue then please mark is "Resolved".

    Regards,

    Vivek Singh