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 Flash Initialize/Program/Erase code

Other Parts Discussed in Thread: HALCOGEN

Hello,

We are using HALCOGEN tool to generate code for initialization which got setupFlash() function. Now we wanted to program and erase using registers and were referring below documents for developing our own code:

SPNU499C

SPNA148

spnu501h

Below is the algorithm used to program flash:

1. Configure FMAC register with Bank.

2. Configure FBSE register to select bank sector.

3. Enable flash write using FSMWRENA register.

4. configure FSM_CMD for clearing status.

5. Write 0x15 value to FSM_EXECUTE register to execute flash command.

6. program FADDR register with sector address.

7. Program FWPWRITE registers with data to be written.

8. configure FSM_CMD for programming.

9. Write 0x15 value to FSM_EXECUTE register to execute flash command.

when above program is executed we are getting below error bits set in FMSTAT register:

INVDAT

CSTAT

SLOCK

What could be the reason for this behavior and is there any document where the actual algorithm is captured for Flash Initialization, Program and erase?

Thanks in advance.

Thanks,

Kalyan

  • Hi Kalyan,

    Please use the flash API library for programming / erasing the on-chip Flash memories.

    Regards,
    Sunil
  • Hi Sunil,

    Thank you for confirming on usage of flash API.
    But, we have few more queries. Can you please answer them as well?
    1. As per spna148.pdf document, we tried implementing single byte program as below:

    Fapi_initializeFlashBanks(180);
    Fapi_setActiveFlashBank(Fapi_FlashBank1);

    Followed by steps mentioned in programming single byte as mentioned in spna148.pdf document.

    We don't see any error in FMSTAT and its value is 0x00, but Data is not getting programmed. Can you please confirm, do we need to add any extra steps apart from mentioned in the document?

    2. Can we get algorithm details on how to initialize Flash instead of using FAPI calls?

    Regards,
    M.Sreenivasan.