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.

CCS/RM57L843: flash read and write exceptions

Part Number: RM57L843
Other Parts Discussed in Thread: HALCOGEN

Tool/software: Code Composer Studio

Background Brief: A Custom board that RM57 save user data On-chip FLASH

 

EnvironmentHALCOGEN 4.6.0

              TI ARM Compiler 16.9.1

              CCS 7.1

 

Configuration

             Flash Library File F021_API_CortexR4_LE_L2FMC_V3D16.lib

 

Problem Detail: 

   Erase operation

 

 

  Read operation

 

 

 

   Write operation

 

 

Test code

 

 

Test result

1The test code is executed the first time, and erase operation -> write operation -> read operation, are normal.

2The test code is executed the second time,Observe the execution through the CCS memory window ,128 bytes from 0x1c0000 after an erase operation have not changed to 0xff128-byte data from 0x1c0000 after write operation does not change,The data read by the read operation is the data written by the first pass of the code,the ESMSR2 register has a value of 0x08.The third and subsequent executions of the test code are the same as the second pass.

3Power off and restart,re-download code through CCS,observe the data of address 0x1c0000 through the CCS memory window before executing the MAIN() function,the data is the same with the last written value before power off.

  • Hello Hude,

    To be able to erase the flash sectors and program the code to flash sectors, the flash operation related code has to be executed in another flash bank or SRAM.

    The SYS_CLK_FREQ used in the erase/program/read functions should be the same ass the system clock. SYS_CLK_FREQ is defined in bl_config.h. What is your system clock, 300Mhz or 330MHz?

    In you code, you write 8 bytes (32 bytes most for RM57) every time, but the src address and dst address are increased by 16 bytes.
  • Hi,QJ Wang,

         1.The flash operation related code is executed in SRAM in our program.

         2.Our system clock is 300Mhz and HCLK is 150Mhz,and modified SYS_CLK_FREQ  to 300,the returned value of the function Fapi_initializeFlashBank(SYS_CLK_FREQ) is Fapi_Error_InvalidHclkValue.

         3.We modify our code with  writting 16 bytes as testting,the result is same as before. 

    Thanks and Regards,
    QJ Wang

  • Hi Hude,

    Have you figured out the problem? I am sorry for late response.