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.

FEE driver on TMS570LS3137

Other Parts Discussed in Thread: TMS570LS3137, HALCOGEN

Hi All,

I'm trying to use the FEE driver with a TMS570LS3137.

I call TI_Fee_Init() and can see that the Flash memory at 0xF0200000 has been initialised with the correct headers, but doing a TI_Fee_WriteSync() doesn't seem to add any blocks.

In the init of my main I have:

	/* Initialize FEE. This will create Virtual sectors, initialize global variables etc.*/
	TI_Fee_Init();
	do
	{
		TI_Fee_MainFunction();
		FeeStatus=TI_Fee_GetStatus(0);
	}
	while(FeeStatus!= IDLE);

Then in my main loop I have:

		TI_Fee_MainFunction();
		FeeStatus=TI_Fee_GetStatus(0);
		if((FeeStatus == IDLE) && (CtrlParams.FlashEEControl == 1))
		{
			/* Write the block into EEP Synchronously. Write will not happen if data is same. */
			TI_Fee_WriteSync(1, (uint8 *) &Params);
			CtrlParams.FlashEEControl = 2;
		}
		FeeStatus=TI_Fee_GetStatus(0);
		if((FeeStatus == IDLE) && (CtrlParams.FlashEEControl == 2))
		{
			/* Write the block into EEP Synchronously. Write will not happen if data is same. */
			TI_Fee_WriteSync(2, (uint8 *) &CtrlParams);
			CtrlParams.FlashEEControl = 3;
		}

My virtual sector and block configuration in ti_fee_cfg.c is:

const Fee_VirtualSectorConfigType Fee_VirtualSectorConfiguration[TI_FEE_NUMBER_OF_VIRTUAL_SECTORS] =
{

    /* Virtual Sector 1 */
    {
       /* Virtual sector number */      1U,
       /* Bank                  */      7U,      
       /* Start Sector          */      (Fapi_FlashSectorType)0U,
       /* End Sector            */      (Fapi_FlashSectorType)0U
    },
    /* Virtual Sector 2 */
    {
        /* Virtual sector number */     2U,
        /* Bank                  */     7U,
        /* Start Sector          */     (Fapi_FlashSectorType)1U,            
		/* End Sector            */     (Fapi_FlashSectorType)1U
    }
    ,
    /* Virtual Sector 3 */
    {
        /* Virtual sector number */     3U,
        /* Bank                  */     7U,     
        /* Start Sector          */     (Fapi_FlashSectorType)2U,
        /* End Sector            */     (Fapi_FlashSectorType)2U     
    }
    ,
    /* Virtual Sector 4 */
    {
        /* Virtual sector number */     4U,
        /* Bank                  */     7U,
        /* Start Sector          */     (Fapi_FlashSectorType)3U,
        /* End Sector            */     (Fapi_FlashSectorType)3U        
    }
  
};


/* Block Configurations         */
/* SourceId : HL_Fee_SourceId_2 */
/* DesignId : HL_FEE_DesignId_3, HL_FEE_DesignId_8 */
/* Requirements : HL_FEE_SR2, HL_FEE_SR3, HL_FEE_SR4, HL_FEE_SR6, HL_FEE_SR85, HL_FEE_SR86
                  HL_FEE_SR87, HL_FEE_SR88, HL_FEE_SR89, HL_FEE_SR90, HL_FEE_SR91 */
const Fee_BlockConfigType Fee_BlockConfiguration[TI_FEE_NUMBER_OF_BLOCKS] =
{
        /*      Block 1 */
        {
               /* Block number                          */     1U, 
               /* Block size                            */     (NUM_OF_STORED_EE_PARAMS * 4)/*200U*/,
               /* Block immediate data used             */     TRUE,
               /* Number of write cycles                */     0x8U,
               /* Device Index                          */     0x00000000U,
               /* Number of DataSets                    */     1U,			   
               /* EEP number                            */     1U			   
        }

        ,
        /*      Block 2 */
        {
               /* Block number                          */     2U, 
               /* Block size                            */     (NUM_OF_STORED_EE_CANPARAMS * 4)/*200U*/,
               /* Block immediate data used             */     TRUE,			   
               /* Number of write cycles                */     0x8U,
               /* Device Index                          */     0x00000000U,
               /* Number of DataSets                    */     1U,		   
               /* EEP number                            */     1U			   
        }
		,
		/* If project needs more than 16 blocks, add additional blocks here and also 
           modify TI_FEE_TOTAL_BLOCKS_DATASETS and TI_FEE_NUMBER_OF_BLOCKS in ti_fee_cfg.h 	*/
/* USER CODE BEGIN (1) */
/* USER CODE END */
 
};

Should this work, or am I setting something up incorrectly?

There seems to be confusing use of EEP numbers of 0/1 and 1/2 in the sample code and documents.

Can anyone offer any pointers?

Regards, Ian.