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: F021 Flash Api Using Issue

Part Number: TMS570LC4357

Hello, I've a problem using F021 Flash API with TMS570LC4357.

I'm using tms570lc4357 MCU and F021 Flash API v02.01.01 for EEPROM Eemulation Flash Bank 7. When I try to 4 byte or 8 byte write every cycle, there is no problem. The value that written into Bank 7 doesn't change. But if I try to write 2 byte, the vale of written into Bank 7 has been changing. I've read 'F021 Flash API Reference Guide' and 'Advanced F021 Flash API Erase/Program Usage' documents but I didn't see anything about this issue. Here is my code 

uint32_t for_counter_u32 = 0 ;
uint8_t temp_data_buf [8U] = {0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45, 0x45};
uint8_t write_size = 4U ;

while(for_counter_u32 < 0x00020000)
{
    Fapi_issueProgrammingCommand( (uint32_t*)(0xF0200000U + for_counter_u32),
    temp_data_buf ,
    write_size ,
    NULL ,
    0U ,
    Fapi_DataOnly );

    for_counter_u32 += write_size;
}

write_size = 4U;

write_size = 2U;

  • Hi Burak,

    We started working on your issue now and will provide an update ASAP.

    --
    Thanks & regards,
    Jagadish.

  • Hi Burak,

    Apologies for the delay.

    I just did your code debug and i could see the behavior you are mentioning. Give me some more time for debug and provide you an update.

    --
    Thanks & regards,
    Jagadish.

  • Thank you for your interest. I also have a another question regarding this issue. In these picture I shared, the Flash Bank 7 area fully initialized with the value 0xFFFFFFFF. In this case, Fapi_issueProgrammingCommand(...) function work fine in Fapi_DataOnly mode. When the Flash Bank 7 is used, I'm ereasing fully of the Bank 7 area but new values in the Bank 7 don't be 0xFFFFFFFF. After that if I use Fapi_issueProgrammingCommand(...)  in Fapi_DataOnly mode (bytes of writing size doesn't matter,  8 byte write doesn't work correctly either), the value in Flash Bank 7 is not correct.

    I think the Fapi_issueProgrammingCommand(...) function doesn't work fine in Fapi_DataOnly mode. In my application, I need to use Fapi_DataOnly mode because if I use write in auto generation ECC mode, I can't use same flash bank address to write operation in twice (actually the function returns with Fapi ok but after the writing operation, destination address does not change). In my algorithm, sometimes I need to write same Flash Bank address. Also, since I have error detection, I don't need to use ecc.

    What exactly is Fapi_DataOnly mode? In the shared documents, I can't clearly understand the difference between data only and auto ecc generation. Unfortunately, there is no documentation on FSM itself. So I have to use Fapi functions.

    Note: If I want to use the same Flash Bank addess, I have to clear Flash Bank 7. Sometimes I don't need to do that because of the types of gate using in the Flash Memory ( 1 -> 0 : write operation; 0 -> 1 clear operation).

    Thanks & regards.

  • Hi Burak,

    This is expected behavior only, and with will happen due to ECC bit corrections. Plese refer below thread to understand 

    (+) TMS570LC4357: QS on ECC function - Arm-based microcontrollers forum - Arm-based microcontrollers - TI E2E support forums

    --

    Thanks & regards,
    Jagadish.

  • Hello,

    As far as I understand from the link you shared on this subject, I cannot disable flash ECC even if I use the Fapi_disableAutoEccCalculation(...) function. Flash ECC turns on when the code starts executing and I cannot disable Flash ECC. Is this true ?

    I use linker file writing to write 0xFF Flash Bank 7, but I don't think this is correct behavior unless I can do this again during the life of the program.

    In the code example above, my problem isn't solved even if the memory is completely 0xFFFFFFFF.

    Thanks & regards.

  • As far as I understand from the link you shared on this subject, I cannot disable flash ECC even if I use the Fapi_disableAutoEccCalculation(...) function. Flash ECC turns on when the code starts executing and I cannot disable Flash ECC. Is this true ?

    Yes it is true for LC4357.

    I use linker file writing to write 0xFF Flash Bank 7, but I don't think this is correct behavior unless I can do this again during the life of the program.

    In the code example above, my problem isn't solved even if the memory is completely 0xFFFFFFFF.

    That is correct.