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.

TMS320F28075: Fapi_issueProgrammingCommand failed to burn data into flash

Part Number: TMS320F28075
Other Parts Discussed in Thread: C2000WARE

Hi Team,

 Code-1: Global variable declaration 

#pragma DATA_SECTION(Buffer,"BufferDataSection");
uint16   Buffer[WORDS_IN_FLASH_BUFFER + 1];
uint32   *Buffer32 = (uint32 *)Buffer;

Code-2:cmd: Section definitions

BufferDataSection : > RAMD1, PAGE = 1, ALIGN(8)

Code-3: Code that burns the module 

EALLOW;
	for(i=0,j=0;i<BLOCK_WORD;i++)
	{
		Buffer[i] = (flsInfo.flashData[(i*2)+1]<<8)+(flsInfo.flashData[i*2]);//deal 1024bit DATA,pack 512bit into Buffer
		j++;
		if(j >= 8)
		{
			j = 0;
			oReturnCheck = Fapi_issueProgrammingCommand((unsigned long *)(flsInfo.flashaddress+i-7),
			(unsigned int *)(Buffer+i-7),8, 0, 0, Fapi_AutoEccGeneration);
			
			while(Fapi_checkFsmForReady() == Fapi_Status_FsmBusy);
			
			if(oReturnCheck != Fapi_Status_Success)
			{
			// Check Flash API documentation for possible errors
#if 1
				ESTOP0;
#endif
				break;
			}

			oFlashStatus = Fapi_getFsmStatus();
			if(oFlashStatus != 0)
			{
				ErrFlag = 1;
#if 1
				debugarr[5]++;
				//debugarr[6] = oFlashStatus;
				ESTOP0;
#endif
				break;
			}

			oReturnCheck = Fapi_doVerify((uint32 *)(flsInfo.flashaddress+i-7),4, (Buffer32+i-7)+((i-7)/2),&oFlashStatusWord);
			if(oReturnCheck != Fapi_Status_Success)
			{
			    debugarr[6] = oReturnCheck;
			    debugarr[7] = 1;
			    ESTOP0;
				break;
			}
			//SysCtl_serviceWatchdog_28075();
		}   // if-end
		SysCtl_serviceWatchdog_28075();
	}   // for

	EDIS;

Issue:

After executing Fapi_issueProgrammingCommand, API does not return an error, but indicates an error during calibration. The wrong location is 0x84000 and the expected burn data does not match the actual read data.

Data in actual flash: 

Data in buffer: 

Could you help check this case? Thanks.

Best Regards,

Cherry

  • Hi Cherry,

    Thank you for approaching us.

    I may not able to review and debug your code.  I can suggest a few things to help debug:

    1) Try programming only the locations that are in question using the intended data and see whether it programs correctly or not.

    2) In the memory window snapshot that you provided, looks like all the locations got erased - especially the red color tells me that those locations got erased before you took the snapshot.  Maybe your code has an erase after the program - can you check?

    Thanks and regards,
    Vamsi

  • Hi Vamsi,

    Thank you for the support.

    The original issue because the flash D region was not erased successfully, an unknown error was triggered when writing flash, causing flash to be erased unexpectedly. 

    The problem now is that during the process of erasing area F of flash, an interrupt_illegalOperationHandler() is entered, when the area F data has been erased, but an abort is entered. The customer's project is a version of the library function, and it is temporarily impossible to port directly the official routines of the bit fields. So they would like to know if there is a library function version flash routine for reference.

    Thanks and regards,

    Cherry

  • Hi Cherry,

    When you say unknown error, do you mean to say that flash API returned an unknown error?  And are you saying that the original issue that you reported in this post is now resolved?  If yes, how did that resolve?  Is that a supply voltage issue?  Or some flash access happened during the program/erase?  

    Regarding the new problem that you mentioned:  Since you mentioned that an illegal interrupt occurred, can you confirm whether the flash API is being executed from flash or RAM?  It should be executed from RAM as mentioned in the flash API guide (shown in the flash API usage example as well).  Please note any functions that call the flash API library functions also must be executed from RAM on this device. 

    Regarding the library function version:  I did not understand this.  Could you please explain this in detail?

    Thanks and regards,
    Vamsi

  • Hi Vamsi,

    Regarding the library function version:  I did not understand this.  Could you please explain this in detail?

    Under the C2000Ware_4_03_00_00 folder, there are two example folders for driverlib and device_support. The associated routines for flash exist only under the device_support folder, where the initialization hardware uses the form bit_field.

    The customer would like to know if there is a flash routine that initializes the hardware directly in the form of driverlib.

    Thanks and regards,

    Cherry

  • Hi Cherry,

    Please take a look at Flash_initModule() provided at C2000Ware_5_00_00_00\driverlib\f2807x\driverlib\flash.c

    Is this the one that you are looking for?

    Thanks and regards,

    Vamsi 

  • Cherry,

    Can I assume that this issue is resolved since I did not hear back from you?

    Thanks and regards,

    Vamsi