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.

TMS570LS0332: TMS570LS0332

Part Number: TMS570LS0332

Hi,

I am using TMS570LS0332 in my design. I would like to store some data in the FEE sectors of the controller.  We have our own state machine for writing to FEE memory of the controller which runs in the background. I have the following questions.

1. Is it good enough to initialize the FEE sectors once per power cycle?


Fapi_StatusType initBank = Fapi_initializeFlashBanks(FEEDRIVER_SYS_CLOCK_IN_MHZ);
Fapi_StatusType activateBank = Fapi_setActiveFlashBank(Fapi_FlashBank7);
Fapi_StatusType enableBank = Fapi_enableEepromBankSectors(FEEDRIVER_FEE_SECTOR_LOCATIONS,0x00000000U);

2. What would happen if we try to access a memory location in a sector which is either in erase or program operation?

Thanks & Best regards,

Sreekanth challa

  • Hello,
    Bellow are quotes from F021 Flash API reference guide (SPNU501G) which is under F021 Flash API\version folder:
    - Fapi_initializeFlashBanks - Before using any asynchronous command, program or read functions, the function Fapi_initializeFlashBanks() must be called to correctly initialize the Flash Memory controller;
    - Before performing a Flash erase or program operation for the first time or on a different Bank than is the current active Bank, the function Fapi_setActiveFlashBank() must be called. Additionally, Fapi_enableMainBankSectors() (for banks 0-6) or Fapi_enableEepromBankSectors() (for bank 7) must be called before the first sector erase or program operation and always before a bank erase operation.
    - This function must be called with the EEPROM bank (Flash Bank 7) as the active bank. Additionally, the function must be called once before performing program and sector erase operations and always before a bank erase operation.

    - Reading a Flash memory location from the bank that an erase command (sector or bank) is currently being performed will stall the CPU until the erase command finishes and the FMSTAT register indicates the FSM is not busy.

    - Reading a Flash memory location from the bank that an program command is currently being performed will stall the CPU until the program command finishes and the FMSTAT register indicates the FSM is not busy.

    Reference guide (SPNU501G.pdf) and Advanced F021 Flash API Erase/Program Usage (SPNA148.pdf) are under F021 Flash API\version folder


    Best regards,
    Miro
  • Hi,

    Adding another question to the list.
    3. Is there any command to cancel the ongoing operation (For example, erase/program) of flash module. I have timeout for each operation. I would like to cancel the triggered operation if it is taking too much time to complete.

    Thanks & Best regards,
    Sreekanth challa
  • Hello,

    This is from F021 Flash API Reference Guide:

    Best regards,

    MIro

  • Hi,

    Thanks for the prompt response. How about the program command of the flash module?? Can it be suspended?

    Thanks & Best regards,
    Sreekanth challa
  • Hello,
    Only program and erase sector operations are valid suspendable operations.

    Best regards,
    Miro
  • Dear Miro,

    Is the following will suspend the erase and program sector operations?


    FAPI_SUSPEND_FSM
    Issues FSM suspend command
    Synopsis
    #define FAPI_SUSPEND_FSM FAPI_WRITE_LOCKED_FSM_REGISTER(FLASH_CONTROL_REGISTER-
    >FsmExecute.FSM_EXECUTE_BITS.SUSPEND_NOW, 0x5U)

    Thanks & Best regards,
    Sreekanth challa
  • Hello,
    This macro will issue a FSM suspend command. Program and erase sector operations are valid suspendable operations and they will be suspended.

    Best regards,
    Miro