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.

flash eeprom emulation

Other Parts Discussed in Thread: HALCOGEN, TMS570LS3137

Hi all,

I am trying to write in Flash emulated eeprom (TMS570LS313) using F021 API library but the problem is whenever i try to use "Fapi_issueProgrammingCommand" CSTAT flag is raised. It looks like it is a generic error not specified to something specific.

Anyone had similar issues?

  • Hany,
    Are you using the HalCoGen FEE driver code, or are you writing your own FEE driver on top of the F021 API.
    Which version of the F021 API are you using?
    If using the HalCoGen FEE - which version of HalCoGen are you using?
  • Hi Anthony,

    I am writing my own driver using F021 API version 2.01.01. The problem is now solved, i had a problem with enabling sectors of the EEPROM bank.
    However i still have some questions:

    -  It is mentioned in the API reference guide that for devices using L2FMC controller some APIs need to be executed from RAM or while in privileged mode, i am using TMS570LS3137 which i guess has L2FMC controller (does it?) and the program seems to be working fine without special execution methods, i wonder why is that.

    - I have a problem relating wait states of FSM to the used system frequency (HCLK), i saw somewhere in the forums that when using 160MHz wait states should be 3 but i dont understand why. Could you provide more reference regarding the state machine since it is not mentioned in the device datasheet.

    - I am using IAR EWARM compiler, everytime i flash the controller i get a message that some source files are missing (program.c, fsm.enableeepromsectors.c ..) and asking for alternative files. Although it is running well but i wonder if this could affect the functionality of some of the APIs in the future.

    - I understand that it is possible to write up to the bank width bytes (16 in my case) and only read 4 bytes per time. Is there a possible way to write more, a whole sector maybe and read more data each time?

    I am just trying to write in the Flash emulated eeprom to get used to how the library is working and everything.

    Thanks in advance
    Hany

  • Hany,

    -  It is mentioned in the API reference guide that for devices using L2FMC controller some APIs need to be executed from RAM or while in privileged mode, i am using TMS570LS3137 which i guess has L2FMC controller (does it?) and the program seems to be working fine without special execution methods, i wonder why is that.

    The LS3137 has flash on the tightly coupled interface of the CPU core, so no you don't have the L2FMC.
    The device w. the L2FMC is the LS4357 which has I$/D$ and both SRAM and Flash are in level 2 memory .. not tightly coupled to the CPU.

    - I have a problem relating wait states of FSM to the used system frequency (HCLK), i saw somewhere in the forums that when using 160MHz wait states should be 3 but i dont understand why. Could you provide more reference regarding the state machine since it is not mentioned in the device datasheet.

    This chart from the datasheet shows you how many wait states you need versus CPU frequency:

    - I am using IAR EWARM compiler, everytime i flash the controller i get a message that some source files are missing (program.c, fsm.enableeepromsectors.c ..) and asking for alternative files. Although it is running well but i wonder if this could affect the functionality of some of the APIs in the future.

    Really don't know what to say about this.   Sounds like there might be a problem w. the project itself if it is looking for source files that it can't find.

    You need to find out why the project thinks these source files should exist then we could comment.    I can't tell you about the F021 API future development but I would say expect it to be static / done and in maintenance.  I don't expect new features as the product is production status.

    - I understand that it is possible to write up to the bank width bytes (16 in my case) and only read 4 bytes per time. Is there a possible way to write more, a whole sector maybe and read more data each time?

    No just 144 bits at a time..   This is a function of the on-chip 'buffer' so the only way to do a sector is in increments of 144 bits.

  • Hi Anthony,

    Thanks for your help regarding emulated flash, it is working fine. I am now trying to write/erase in flash bank 1 (Basically i am trying to write a bootloader) and i have couple of questions.

    1- I am able to write some values as shown in blue circle (sorry if it looks ugly), but i can not write in addresses with hyphens (first 8 bytes of 0x00180000). Is it mentioned somewhere in the data sheet that these are reserved places or something?

    2- I noticed it is not necessary to execute the functions from RAM to write in Flash bank 1, is it the same when i try to erase/write in same bank i am executing from? I will appreciate it if you could provide me with any application notes regarding possible program flow in such cases.

    3- Do i have to copy the whole library to the RAM or only the APIs? This is my first time to deal with such issues.

    Thanks in advance 
    Hany