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.

TMS320F280049: ECC error

Part Number: TMS320F280049
Other Parts Discussed in Thread: ADS131E08, UNIFLASH

Hi Vamsi,

My customer met a ECC caused NMI.

They use TMS320F280049PZSR,100PIN and CCS version 8.3.0.

It happens on 4 customers‘ board but can not be reproduced on controlCARD or launchpad.(I supposed our control card or launchpad has not connected to some external circuits,so can not run to relevant code. so it will not trigger the ECC NMI) so I think it has some thing wrong about their code.

It can be triggered by "only CANB module code" or  "only SPI module code".

SPI is basically communicated to ADS131E08.

CANA will also take the bootloader function.

For only CANB module,after loading data to CANB, the NMI interrupt is triggered during the transmission process (not completed), and among NMIFLG register in NmiIntrupt, FLUNCERR is 1.

Here is the debug window which can show the ECC error.

I searched Flash api in their code and list as below:


status = Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS, 100);

status = Fapi_setActiveFlashBank(Fapi_FlashBank0);

status = Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector,pu32Startaddr);

status = Fapi_doBlankCheck(pu32Startaddr,Sector8KB_u32length,&oFlashStatusWord);

status = Fapi_issueProgrammingCommand((uint32 *)u32Index, u16ptr+i,8,0, 0, Fapi_AutoEccGeneration);

status = Fapi_doVerify((uint32 *)u32Index,4, u32ptr+(i/2),&oFlashStatusWord);

Could you kindly point out if customer use wrong flash API? However, it can trigger ECC NMI without bootloader, just running the app code.

Customer doesn't want to share the code, if you really need it. I can share with you by email.

And could you kindly tell me where should I focus to find the root cause?

BR 

Emma

  • Emma,

    1) What is the address at which Flash ECC error occured? You can get this info from Flash ECC registers. 

    2) Once, you figure the address, please check whether that address is programmed by customer application at run time or at customer production line.

        If it is programmed by customer application at run time, then we need to focus on Flash API usage.

        If it is programmed at customer production line, then we need to focus on production program tool used by the customer.

    Once you confirm the answers for above questions, I can suggest further.

    Regards,

    Vamsi

    Flash Wiki# http://processors.wiki.ti.com/index.php/C2000_Flash_FAQ

  • Hi Vamsi,

    Thanks for your quick response.

    For question 1:

    We checked thees two resgister:

    UNC_ERR_ADDR_LOW

    UNC_ERR_ADDR_HIGH

    Unfortunately, it is not fixed.

    • If run the complete program,the address is relatively random,
    • If I block other programs and only run SPI module, it is relatively fixed at in _c_int00 ().
    • If I block other programs and only run CANB module, it may also appear in _c_int00 ().

    For question 2:

    It is application code, since they debug on the issue board use JTAG emulator to program the code.

    Look forward to your feedback.

    BR

    Emma

  • Emma,

    What tool did they use to program the device?  CCS or UniFlash?

    Did they try to search for updates in the tool and install if any?

    In UniFlash and CCS, AutoEccGeneration is enabled by default.  Please check if it is disabled.  It should be enabled to program ECC correctly.

    Thanks and regards,

    Vamsi

  • Hi Vamsi,

    Customer uses CCS  version 8.3.0. And checked this, AutoEccGeneration is enabled.

    Do they can solve the issue by updating CCS version?

    BR

    Emma

  • Emma,

    I don't think it is a tool issue then.  But I will suggest to check for updates and install if any.

    Do they have Flash API embedded in their application (which is loaded in Flash)?  If yes, does the application call Flash API functions?

    Did you check whether they initialized Flash correctly or not (check for wait-states - 4 waitstates are needed at 100MHz)?  

    Thanks and regards,
    Vamsi

  • Hi Vamsi,

    For Flash API embedded in their application, I can not find any. I will send you the bootloader code and application code via Box. Could you kindly help on it?

    For the wait-states, I insert the code here:

    #if CPU_FRQ_100MHZ
        if((ClkCfgRegs.CLKSRCCTL1.bit.OSCCLKSRCSEL == 0x0)   ||
           (ClkCfgRegs.CLKSRCCTL1.bit.OSCCLKSRCSEL == 0x2)   ||
           (ClkCfgRegs.CLKSRCCTL1.bit.OSCCLKSRCSEL == 0x3))
        {
            Flash0CtrlRegs.FRDCNTL.bit.RWAIT = 0x5;
        }
        else
        {
            Flash0CtrlRegs.FRDCNTL.bit.RWAIT = 0x4;
        }
    #endif

    I think this means they stay enough time.

    BR

    Emma

  • Emma,

    If not the application, do they have Flash API embedded in their custom boot loader? Please check.

    Thanks and regards,
    Vamsi

  • Hi Vamsi,

    Yes, here are the Flash API embedded in their custom boot loader:

    status = Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS, 100);
    
    status = Fapi_setActiveFlashBank(Fapi_FlashBank0);
    
    status = Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector,pu32Startaddr);
    
    status = Fapi_doBlankCheck(pu32Startaddr,Sector8KB_u32length,&oFlashStatusWord);
    
    status = Fapi_issueProgrammingCommand((uint32 *)u32Index, u16ptr+i,8,0, 0, Fapi_AutoEccGeneration);
    
    status = Fapi_doVerify((uint32 *)u32Index,4, u32ptr+(i/2),&oFlashStatusWord);
    

    Do they use them incorrectly?

    BR

    Emma

  • Emma,

    Commands that you copied look correct.  

    Did customer check for FMSTAT after the erase and program operations? That tells if there is any error during programming.

    Did they check the return status from erase and program commands? Did those functions return any error?

    Please suggest them to go through the Flash API wiki: http://processors.wiki.ti.com/index.php/C2000_Flash_FAQ

    This should help to debug this further.

    Thanks and regards,

    Vamsi

  • Emma,

    Any update on this?

    Thanks and regards,

    Vamsi

  • Hi Vamsi,

    You mentioned FMSTAT, so I check the flash_API app note.

    then, I check Fapi_getFsmStatus(); in the bootloader code. there are two function call this. the customized function flash_write and flash_erase.

    I attach the code segment here.

    #pragma CODE_SECTION(flash_write, "ramfuncs");
    Fapi_StatusType flash_write(Uint32 startAddr,Uint32 u16len,void *pdatasource )
    {
    
    	Uint32 i,len,u32Index,*u32ptr;
    	Uint16 *u16ptr;
    	Fapi_StatusType status;
    	Fapi_FlashStatusType flashSta; 
    	Fapi_FlashStatusWordType oFlashStatusWord;
    
    	len=startAddr+u16len;
    	u32Index = startAddr;	
    
    	//flash µØÖ· ºÏ·¨ÅжÏ
    	if (startAddr<Bzero_Sector0_start||len>0xA0000)
    	{
    		return Fapi_Error_InvalidAddress;
    	}
    		
    	u16ptr=(Uint16*)(pdatasource);
    	u32ptr=(Uint32*)(pdatasource);
    	
    	//дflash 
    	for(i=0;u32Index < len; i+= 8, u32Index+= 8)
    	{
    		ulframeIndxTemp = ulframeIndxTemp + 100;
    		status = Fapi_issueProgrammingCommand((uint32 *)u32Index, u16ptr+i,8,0, 0, Fapi_AutoEccGeneration);
    		uiFailureText = status;
    		while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy)
    		{
    			;
    		}
    		
    		if(status != Fapi_Status_Success)
    		{
    			uiJumpText1 = uiJumpText1 + 100;
    			break; 
    		}
    		
    		flashSta = Fapi_getFsmStatus();
    		if(flashSta != Fapi_Status_Success)
    		{
    			status= (Fapi_StatusType)1;
    			break;
    		}
    		
    		status = Fapi_doVerify((uint32 *)u32Index,4, u32ptr+(i/2),&oFlashStatusWord);
    		if(status != Fapi_Status_Success)
    		{ 
    			uiJumpText = uiJumpText + 100;		
    			break; 
    		}
    
    	}
    	return status;
    }
    #pragma CODE_SECTION(flash_erase, "ramfuncs");
    Fapi_StatusType flash_erase(Uint32 sectorStartAddr,Uint16 sectorNum )
    {
    	Uint16 i;
    	uint32 * pu32Startaddr;
    	Fapi_StatusType status;
    	Fapi_FlashStatusType flashSta; 
    	Fapi_FlashStatusWordType oFlashStatusWord;
    
    	//flash µØÖ· ºÏ·¨ÅжÏ
    	if (sectorStartAddr<Bzero_Sector0_start
    		||sectorStartAddr>Bone_Sector15_start
    		||(sectorStartAddr+sectorNum*0x1000)>Bone_Sector15_start)
    	{
    		return Fapi_Error_InvalidAddress;
    	}
    		
    
    	for (i = 0; i < sectorNum; ++i)
    	{		
    		//²Á³ýflash
    		
    		pu32Startaddr=(uint32 *)(sectorStartAddr+i*0x1000);
    		
    	    status = Fapi_issueAsyncCommandWithAddress(Fapi_EraseSector,pu32Startaddr);
    	    while (Fapi_checkFsmForReady() != Fapi_Status_FsmReady){}
    		if(status != Fapi_Status_Success){break;}
    	    flashSta = Fapi_getFsmStatus();
    	    if(flashSta != 0)
    		{
    			status= (Fapi_StatusType)1;
    			break;
    		}
    	    status = Fapi_doBlankCheck(pu32Startaddr,Sector8KB_u32length,&oFlashStatusWord);
    	    if(status != Fapi_Status_Success){break;}
    	
    	}
    
    	return status;
    
    }

    I am not sure they use it right or not. Could you kindly help to review that?

    BR

    Emma

  • Emma,

    They are catching the return value from the erase and program functions and also from Fapi_getFsmStatus().

    However, I don't know what they do when an error is returned from these functions.

    In the failure case (when ECC errors occur), did they check if there is any error from above functions during their boot loader execution?

    Thanks and regards,

    Vamsi

  • Hi Vamsi,

    thanks for your notification, I have asked the question to customer.

    besides, I loop the flash API user guide, and found this:

    //

    // Read FMSTAT register contents to know the status of FSM after

    // program command to see if there are any program operation related errors

    //

    oFlashStatus = Fapi_getFsmStatus();

    if(oFlashStatus != 0)

    {

    //

    //Check FMSTAT and debug accordingly

    //

    FMSTAT_Fail();

    }

    the question is I can not find the defination of FMSTAT_Fail();

    what will this function execuate?

    BR

    Emma

  • Vamsi,

    I checked with customer, they told me they will change it later, but for now. they don't think it is the root cause.

    The reason is below:

    they did not jump into the main of bootloader, just jamp to another code instead.

    for another reason, they will meet ECC error when run the code without Bootloader.

    My question is , does a ECC happend without using flash API?

    BR

    Emma

  • Emma,

    Whether it is a Flash programming tool or Flash API, if the ECC is not programmed or incorrectly programmed, ECC errors will occur.

    Please ask the customer to check whether or not they programmed ECC or not for the code where their application is branching to.  If it is not programmed correctly, they will get ECC errors.

    Thanks and regards,

    Vamsi

  • Vamsi,

     

    Vamsi Gudivada said:
    if the ECC is not programmed or incorrectly programmed,

    how to judge the ECC is not programmed correctly, I am sure they programmed it by check auto ECC Generation under download setting, on-chip flash.

    BR 

    Emma

  • Emma,

    If it is programmed using CCS On-Chip Flash tool with AutoEccGeneration enabled, ECC should be correct.

    I wonder if customer has programmed anything using Flash API without ECC.    

    If you want to know the locations for which ECC is not programmed correctly OR not programmed at all, you can load a simple code in to RAM that reads the Flash memory with ECC enabled.  Note uncorrectable ECC errors will cause NMI.  They can read the Flash ECC error registers in the NMI ISR to know the locations where ECC errors are found.  

    You said they did not jump to main of bootloader.  I wonder maybe the Flash is not initialized correctly for reads (since their custom bootloader is not executed) and hence is the issue?

    Maybe the location to which they jumped does not have ECC programmed for some reason? Please check. 

    Are these issues found immediately after the production program? OR after using the device for sometime?  

    Thanks and regards,

    Vamsi

  • Emma,

    Do you have an update on this?

    Thanks and regards,

    Vamsi

  • Vamsi,

    Thanks very much for your valuable suggestion. Now we found some not good design such as clock, reset circuit and core power supply.

    So they will do a new design. I will monitor the new design and see whether they have the similar error or not.

    BR

    Emma

     

  • Emma,

    Thank you for the update. I am closing this ticket.  If you have any related questions on similar errors after you monitor the new design, please open a new thread.

    Best regards,

    Vamsi