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.

TMS570LC4357: Issue in Programming EEPROM Using F021

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Hi team,


In our Application for the TMS570LC4357 processor, we are using "F021_API_CortexR4_BE_L2FMC.lib” for erasing and programming internal EEPROM.

We are following the procedure mentioned in the SPNU501G document for accessing internal EEPROM operations ( Section 5.3) and used below functions for programming and reading:

For Programming:

Fapi_issueProgrammingCommand((Uint32 *)dst,(Uint8 *)src,(Uint8)8U,0,0,Fapi_AutoEccGeneration);

Read:
Fapi_doMarginReadByByte((Uint8 *)src,(Uint8 *)dst,(Uint32) bytes,Fapi_NormalRead);

But, while programming EEPROM sectors ( after erasing the sector) we have observed that for every 8 bytes of data programmed, we are reading junk values for the first byte.

For eg. If we want to program the data as below ( at location 0xF0200000):

{​​0x11, 0x22, 0x33, 0x44, 0x11, 0x22, 0x33, 0x44, 0xAA, 0x22, 0x33, 0x44, 0x11, 0x22, 0x33, 0x44}​​,

when we read back from EEPROM, we are reading the values below:

 {​​0xA1, 0x22, 0x33, 0x44, 0x11, 0x22, 0x33, 0x44, 0xAB, 0x22, 0x33, 0x44, 0x11, 0x22, 0x33, 0x44}​​.

And Also we have observed that the memory browser does not reflect the proper data in the window, even for the erase though we are reading the correct data when it has been programmed.

Please let us know if we have to enable ECC any changes we have to in liker file ( cmd) file as shown below:

MEMORY
{
/* ROM */
VECTORS (X) : origin=0x00200020 length=0x00000020 vfill = 0xffffffff
FLASH_API (RX) : origin=0x00200040 length=0x000014C0
/*FLASH0 (RX) : origin=0x00040000 length=0x0003FFFF*/
FLASH1 (RX) : origin=0x00200040 + 0x000014C0 length=0x00200000 - 0x40 vfill = 0xffffffff
EEPROM (RW) : origin=0xF0200000 length=0x00020000

/* RAM */
STACKS (RW) : origin=0x08000000 length=0x00001C00
RAM (RW) : origin=0x08001C00 length=0x00040000
RAM_API (RW) : origin=0x08041C00 length=0x00008000
SHAREDRAM (RW) : origin=0x08049C00 length=0x00001000
}


/*----------------------------------------------------------------------------*/
/* Section Configuration */
SECTIONS
{
.intvecs : {} > VECTORS
flashAPI :
{
..\..\..\Fapi_UserDefinedFunctions.obj
--library=..\..\..\\F021_API_CortexR4_BE_L2FMC.lib (.text)
} load = FLASH_API, run = RAM_API, LOAD_START(api_load), RUN_START(api_run), SIZE(api_size)
.text align(32) : {} > FLASH1
.const align(32) : {} > FLASH1
.cinit align(32) : {} > FLASH1
.pinit align(32) : {} > FLASH1
.init_array align(32) : {} > FLASH1 /* Global constructors */
.bss : {} > RAM
.data : {} > RAM
.sysmem : {} > RAM
.sharedRAM : {} > SHAREDRAM
.eeprom : {} > EEPROM
}

  • Hello,

    Have you configure the EWAIT correctly? For HCLK=150MHz (GCLK=300MHz), the EWAIT should be 8.

    For erasing and programming EEPROM, EERPOM sectors should be enabled using different Flash API from used for main flash:

    Fapi_enableEepromBankSectors() for EEPROM

    Fapi_enableMainBankSectors() for main flash

  • Hi Wang,

    Thanks For your quick reply.

    In our application the HCLK=60MHz (GCLK=180 MHz), and we tried configuring the EWAIT to different values like 8 and apart from 8 also, but cannot see any update. To configuring the EWAIT we are just using the MACRO (#define FAPI_WRITE_EWAIT 5).

    The results we can see as:

    left side shows the value that we are programming but we are reading the junk values(as shown highlighted); continuously it repeats for every 8th byte.

    And for EEPROM as you mentioned we are using Fapi_enableEepromBankSectors() only.

  • Hello,

    What is the bank 7 used for in your application? 

    If you use bank 7 as EEPROM to store block of data, you can use TI FEE driver to write data to and read data from the EEPROM . The FEE driver is generated by HALCoGen if FEE is checked.

    The TI FEE Driver provides the following functional services:

    Initialization:

    • TI_Fee_Init

    Operations:

    • TI_Fee_WriteAsync

    • TI_Fee_WriteSync

    • TI_Fee_Read

    • TI_Fee_ReadSync

    • TI_Fee_EraseImmediateBlock

    • TI_Fee_InvalidateBlock

    • TI_Fee_Shutdown

    • TI_Fee_Cancel

    • TI_Fee_Format

    Information:

    • TI_Fee_GetStatus

    • TI_Fee_GetJobResult

    • TI_Fee_GetVersionInfo