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.

TMS320F280049C: FLASH api operation malfunction

Part Number: TMS320F280049C
Other Parts Discussed in Thread: C2000WARE

Hello,

I add FLASH api library(F021_API_F28004x_FPU32.lib) in the pfc1ph3ilttpl_F28004x project, the device is TMS320F280049C, the whole project code( APP cde) is allocated in sector 1~ sector 5 of bank1, and will change the contents in sector15 of bank1 once the change condition meets. now, I found that, the APP code is run away when call the Fapi_setActiveFlashBank(), this function has not be returned. So, I need your help, tks!

see the details as bellow:

1.the FLASH api operation is referred to TI examples: first call the initFlashSectors(), then call FLASH_Erase(0x9000,0x1000), and last call FLASH_Program(0x9FFE8,8) to write data to the address 0x9FFE8.

2. the CMD file as below:

3. initFlashSectors(), FLASH_Erase() and FLASH_Program() are all copy to RAM during running:

4. the out file map as bellow: the RAMM1 has full, does it affect the flash issue?

 look forward to your reply, tks

  • Hi,

    If I understand correctly, your flash programming SW is loaded to sectors 1 to 5 and that SW updates the content in your sector 15.  

    Where do you call memcpy()?

    In your linker cmd file, flash API is not mapped to run from RAM.  It is commented out - can you comment it, rebuild and then try?  Also, please make sure to call memcpy() before calling any of the flash operation functions.

    Thanks and regards,
    Vamsi

  • Hi Vamsi,

    Thank for your reply!

    Your understand is correct. I try to comment the library in CMD file, but the build result was wrong.

    1.The memcpy() is called in Device_init(),as bellow:

    2.There are errors if  { -l F021_API_F28004x_FPU32.lib} is commentted in CMD file:

    I have corfirmed these configurations: FlashAPI dir has be added to #include search path in the "Include Options"  and also be added to library search path in "File Search Path". the details is as bellow:

    Which configuration is not appropriate? and what can i try to do next? 

  • Hi,

    Please import the flash programming example available at C2000Ware_3_04_00_00\driverlib\f28004x\examples\flash\flashapi_ex1_program_autoecc.c.

    Please take a look at how the flash API library is added to the project and try the same way - try placing the library one level up.

    Let me know if it does not help.

    Thanks and regards,
    Vamsi

  • Hi Vamsi,

    Thanks for your help.

    The issue has been resolved when I moved the F021 library to the project directory.

  • Hi,

    Thank you for the update.  I will close the post.

    Best regards,
    Vamsi