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.

TMS320F2800137: EEPROM

Part Number: TMS320F2800137
Other Parts Discussed in Thread: C2000WARE

Tool/software:

hi expert:

I have some questions about  emulating EEPROM with the Flash.

1)The EEPROM_Read( ) function provides functionality for reading the data and storing it into a temporary buffer.The current bank and page are found and the contents of the current page are stored in the Read_Buffer:

how to read the last some data?such as ,i have three parameters,write parameter1 in page 1,write parameter2 in page 2,i can read parameter2,but how to read parameter1?

2)i have three parameters in eeprom,write parameter1 in page 1,write parameter2 in page 2,write parameter3 in page 3,the parameter2 needs to update,so  write parameter2 in page 4?when parameter2 update many times,the last page is used,i should erase the whole pages.so all  parameters erased.

how to deal the  parameter1 and  parameter3?read the  parameter1 and  parameter3,rewrite?

  • Hello,

    1. The EEPROM_Read() function only reads the most recently written data. If you would like to read a specific page, you can modify the EEPROM_Write() function to accept the bank/page number as a parameter. 

    2. Yes, if you need to rewrite parameter 2 often and want to preserve parameter 1 and 3, you would have to rewrite them after EEPROM is erased. Does parameter 2 need to be stored in EEPROM? 

    Kind regards,

    Skyler

  • thanks

    when a parameter need to update often,Is there a good plan to handle it in eeprom?

  • Hello,

    If a parameter needs to be updated often, perhaps it is better not to keep it in EEPROM.

    Kind regards,

    Skyler

  • hi

    but in application,a error occurred,When the error  recovered, it is necessary to check the number of times of  the power is turned on . How to record the number of times of the power is turned on

  • another question:

     the EEPROM_Write() function :

    it will be written to the current page. This process continues until the last page in the selected sector is written

    Why can't it be written by setting page and banks?

  • hi:

    i have 3question:

    1) in application,a error occurred,When the error  recovered, it is necessary to check the number of times of  the power is turned on . How to record the number of times of the power is turned on

    2)

    the EEPROM_Write() function :

    it will be written to the current page. This process continues until the last page in the selected sector is written

    Why can't it be written by setting page and banks?

    3) when flash erase/program ,in FAPI_F280013x_EABI_v2.00.01.lib,Flash API uses EALLOW and EDIS internally as needed to allow/disallow writes to protected registers.

    when EDIS,it will affect the execution cycle of other interrupts,such as motor isr,How to solve this problem?

  • Hello,

    1. Are you asking this in the context of where to store this information? There are many factors to this question, it is difficult to provide an answer without more context.

    2. If you want to modify the way the EEPROM_Write() function works, you can. You can add parameters to program a specific bank/page, but you have to make sure that you don't overwrite any previously written pages without erasing them first (Flash can only be changed from a 1 -> 0 without an erase, and ECC must be considered as well). 

    3. EALLOW and EDIS are not required in the Flash API for this device. Try using the most up to date version of the Flash API (2.00.10) where they were removed. You can download the most recent version of C2000Ware to get this version of the Flash API.

    Kind regards,

    Skyler

  • Hello:

     in UDS application,there are many parameters need to update,maybe 2 sectors,how to deal with the many parameters,need to write and read?

  • Hello,

    If you need to frequently overwrite parameters stored in the emulated EEPROM, you will have to implement logic that allows you to retain certain data in-between erases. Or, you can simply re-write all the data when emulated EEPROM is erased. Repeatedly reading from emulated EEPROM is not an issue.

    Kind regards,

    Skyler

  • hello

    as you said,3. EALLOW and EDIS are not required in the Flash API for this device. Try using the most up to date version of the Flash API (2.00.10) where they were removed. You can download the most recent version of C2000Ware to get this version of the Flash API.

    but i see in Reference Guide

    TMS320F280013x/15x Flash API Version 2.00.10.00
    as follow
    Which statement is correct?
  • hello;

    i have two questions:

    1)

    as you said,3. EALLOW and EDIS are not required in the Flash API for this device. Try using the most up to date version of the Flash API (2.00.10) where they were removed. You can download the most recent version of C2000Ware to get this version of the Flash API.

    but i see in Reference Guide

    TMS320F280013x/15x Flash API Version 2.00.10.00
    as follow
    Which statement is correct?
    2)after follow funtion excuted,
    Fapi_issueBankEraseCommand((uint32 *)u32CurrentAddress); in Example_EraseBanks();
    the code have 2ms halt,or other actions(i not sure)as follow picture
    yellow:adc interrupt Cycle indication(12Khz)
    green:Example_EraseBanks() excuted.
    why have 2ms halt,or other actions?What causes it?
  • hello;

    i have three questions:

    1)

    as you said,3. EALLOW and EDIS are not required in the Flash API for this device. Try using the most up to date version of the Flash API (2.00.10) where they were removed. You can download the most recent version of C2000Ware to get this version of the Flash API.

    but i see in Reference Guide

    TMS320F280013x/15x Flash API Version 2.00.10.00
    as follow
    Which statement is correct?
    2)after follow funtion excuted,
    Fapi_issueBankEraseCommand((uint32 *)u32CurrentAddress); in Example_EraseBanks();
    the code have 2ms halt,or other actions(i not sure)as follow picture
    yellow:adc interrupt Cycle indication(12Khz)
    green:Example_EraseBanks() excuted.
    why have 2ms halt,or other actions?What causes it?
    3)there should be any read/fetch access from the Flash bank when an erase/program operation is in progress.
    what happed to mcu?reset or run some where?or other action?can you tell me?
  • Hello,

    1. After further inspection, EALLOW and EDIS are called a few times in the Flash API. However, they will not affect your motor ISRs.

    2/3. This behavior is likely occurring because the functions that are calling the Flash API are flash. Functions that call the flash API should be run from RAM, otherwise you will see this halt.

    Kind regards,

    Skyler

  • 2/3. This behavior is likely occurring because the functions that are calling the Flash API are flash. Functions that call the flash API should be run from RAM, otherwise you will see this halt.

    All flash operation are run from RAM,used #pragma CODE_SECTION(ClearFSMStatus, ".TI.ramfunc");

    why halt the mcu?

    when halt the mcu ,What are the recovery conditions?

  • Hello,

    Can you verify in the associated .map file that these functions have a RAM-based run address?

    Kind regards,

    Skyler

  • Hello

    where can find in the associated .map file that these functions have a RAM-based run address?Can you give me an example?

  • Hello,

    Thank you for providing the screenshots, it looks like the flash API functions and the functions that call the flash API are being run from RAM. We will look into this more in depth and get back to you.

    Kind regards,

    Skyler

  • Hello.

    I hope to find the cause or solve it, because we need to write EEPROm when the motor is running

  • Hello,

    We are still looking into this issue.

    Kind regards,

    Skyler

  • hi

    Have you found the cause of the problem?

  • Hello,

    The response provided in the screenshot is not a problem. Is the ISR running from the same bank?

    Kind regards,

    Skyler

  • hello

    2800137only have a bank.

    I hope to find the cause or solve it, because we need to write EEPROm when the motor is running

  • Hello,

    Can you run the ISR in RAM?

    Kind regards,

    Skyler

  • hello

    i run the ISR in RAM,but not all the subfunction runned in the ram,such as motor algorithm, a lot of code, it is impossible to run it all in RAM.

    On this MCU, other customers should also have similar requirements. What kind of solution do you provide to them?

  • Hello,

    If the motor algorithm is running in flash and the Flash API is executing, you will see this behavior. For single-bank devices, there is no way to program and execute code on the same flash bank at the same time. So, you will see this halt behavior. If you know which part of the motor control algorithm that this ISR will occur in, you can have that run in RAM and that would resolve the issue. If not, you can reduce the amount of data being written by the Flash API to try and reduce the time that the algorithm halts.

    Kind regards,

    Skyler

  • ok,thanks

    Only external eeprom can be used.