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.

TMS570LS0914: receive error: Fapi_Error_InvalidHclkValue (failure: System clock does not match specified wait value)

Part Number: TMS570LS0914
Other Parts Discussed in Thread: HALCOGEN

Dear team

My customer is using TMS570LS0914. It returns Fapi_Error_InvalidHclkValue (failure: System clock does not match specified wait value) when calls API:Fapi_initializeFlashBanks.  The crystal is 16MHz.

They already make sure that

1. system clock: make sure the sys_CLK in bl_config.h is same as the system clock generated from PLL (HCLK) (160MHz)
2. LS0914 has smaller flash than LS1224. Please define the struct of flash sectors in flash_defines.h

The same code runs fine on TMS570LS1224PGE.

  • Hello Susan,

    RWAIT and EWAIT register values must be set before calling flash bank init API: Fapi_initializeFlashBanks()

    For HCLK=160MHz, the RWAIT=3, and EWAIT=9, flash address wait state is 1     --> FRDCNTL = (3 << 8) | (1 << 4) | 1.

    and EEPROM_CONFIG = (9 << 16) | 2; 

  • Hello QJ wang,

    I am the Qer

    I`m now stuking at the “while(FAPI_GET_FSM_STATUS!= Fapi_Status_Success);”  again  with the  Fapi_initializeFlashBanks solved.

    The return value of   Fapi_initializeFlashBanks()  is 0, however, I am not able to erase or write the Flash.

    And, I tried to UPLOAD files from Flash. An error came that program ran to "_dabort : Run Memory Test".

  • Hello,

    1. Before writing data to flash, the sectors have to be erased first.

    2. Since this device has only one flash bank, all the flash API related code and constants should be located in SRAM.

    For abort, please check the value of DFSR. The DFSR is a CPU register within the CP15 register block. It is CPU accessible and can be read upon the CPU issuing an exception. The events covered by the DFSR are outlined in the Cortex-R4F TRM on the ARM website at this location:   infocenter.arm.com/.../index.jsp. Specifically, you will find information about the DFSR in section 4.2.18.

  • Thank you for answering my question.

    1. I had erased the sectors before writing.

    2. The flash API & Library had been moved to SRAM for running.

    The problem of "Fapi_initializeFlashBanks()"  has been solved, just as you told me: set the RWAIT and EWAIT register. Thank you very much.

    But now the program just stucks at “while(FAPI_GET_FSM_STATUS!= Fapi_Status_Success);” every time.

    In addtion, can I just write 1 byte data once using F021 API  after I erase the whole secter? Maybe that`s the problem.

    I am so confused. I use the code generated from HALCOGEN. Sometimes it works but other times won`t, while the configurations are the same.

  • Hello QJ Wang

    I forgot to mention that I can normally do the "Erase memory" and be not able to "Write". I think some thing goes wrong but not fatal......

    Can you help me find the problem? Why I can erase & read but not write?

    Shunzhang Wang

  • Hi Shunzhang,

    Have you make the flash writing work?