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.

TMS570LS3137: Work Around for Errata FMC#80

Part Number: TMS570LS3137

Hello , 

Writing bulk data of 1.5 MB to Bank 1 starting at address 0x00260000 Flash controller fails to write . 

I am implementing Boot loader to Erase Bank 1, and write bulk data at once  the Erase operation works with out any failure .

While Writing to the Flash full data of 1.5 MB is received and stored in EMIF RAM ( 8 MB ) and at once written to FLASH Bank 1 using library F021_API_CortexR4_BE.lib and API

Flash_registers.FBPROT=1;
status = Fapi_setActiveFlashBank((Fapi_FlashBankType)0x01U);

status = Fapi_enableMainBankSectors(0xFFFFU);        

Fapi_issueProgrammingCommand((uint32_t *)dst, ( 0x00180000)

(uint8_t *)src, ( 0x80000000 )
(uint8_t) bytes_size_to_write, ( full 1.5 MB size )
0,
0,
Fapi_AutoEccGeneration);

Writing address 0x00180000 to 0x00260000 there are not errors in writing the data to Flash . Starting address 0x00260000 the Flash controller does not write to the Flash it aborts all the time . 

Should I implement additional logic for writing to Bank 1 address 0x00260000  to 0x00300000 .

ERRATA FMC#80 Abort on Accesses Switching Between two Banks . A 3MB device that is comprised of two 1.5MB flash banks may generate an abort if an access to bank 0 is followed by an access between 1.5MB and 2MB (in bank 1). Likewise, the device may generate an abort if an access to bank 1 is followed by an access between 1MB and 1.5MB (in bank 0).

the Flash related code is executing in RAM 

flashAPI :

{

boot_udf.obj (.text,.const)
boot_flash.obj (.text,.const)
Boot_Erase.obj (.text,.const)
Boot_Emif_Write_Data.obj (.text,.const)

--library= F021_API_CortexR4_BE.lib <*.obj > (.text,.const,.bss,.data)

} load = FLASH_API, run = SRAM, LOAD_START(__SEC_OEM_UNSAFE_LOAD_START), RUN_START(__SEC_OEM_UNSAFE_RUN_START), SIZE(__SEC_OEM_UNSAFE_RUN_SIZE), crc_table(_Bootloader_firmware_image_crc_table, algorithm=TMS570_CRC64_ISO)

  • Hello Chandre,

    Please change the "bytes_size_to_write" from full size of 1.5MB to 16 bytes.

    while( SizeInBytes > 0)

    {

    Fapi_issueProgrammingCommand((uint32_t *)dst,

    (uint8_t *)src,

    (uint32_t) bytes,      //use 16 bytes rather than 1.5MB

    0,

    0,

    Fapi_AutoEccGeneration);

    while( FAPI_CHECK_FSM_READY_BUSY == Fapi_Status_FsmBusy );

    while(FAPI_GET_FSM_STATUS != Fapi_Status_Success);

    src += bytes;

    dst += bytes;

    SizeInBytes -= bytes;

    if ( SizeInBytes < 16){

         bytes = SizeInBytes;

    }

    }

  • Thanks Mr. Q J Wang ,

    Flashing Works with the suggested change.