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.

Compiler/TMS320F28388D: Flash API and rts2800 and .const

Part Number: TMS320F28388D


Tool/software: TI C/C++ Compiler

Hello everyone,

I am working on a program which needs to periodically write data to flash without pausing operation. I am using Code Composer Studio 10.0.0.00010 and C2000 CGT v20.2.1.LTS.

The Flash API documentation (SPNU632) states the following:

Flash API execution is interruptible. However, there should not be any read or fetch access from the Flash bank on which erase or program operation is in progress. Therefore, the Flash API functions, the user application functions that call the Flash API functions, and any ISRs (Interrupt service routines,) must be executed from RAM.

I use the --ramfunc option in order to execute all my code from RAM. By looking at the link information (.map) file I see that all functions from my source code are run from RAM. 

However I have two problems:

1. There is code from the run-time support library (rts2800_fpu64_eabi.lib) that remains in the .text section which is allocated in the flash memory. For example there are the following entries in the link information file:

  • u_div28.asm.obj (.text)
  • memset.c.obj (.text)
  • memcpy.c.obj (.text)

2. There are several global const and static const variables in the .const section which is allocated in the flash memory, several of which might be read by functions which need to keep running while the flash memory is being erased or programmed.

Can someone help me solve these two problems?

Best Regards,

Pierre

  • Hi Pierre,

    Linker command file has to be updated to allocate the rts library code and .const section into RAM.

    You can create a new section in the linker command file similar to the following and allocate it into one of the RAM blocks.

    rts2800_fpu64 : > RAM
        {
             --library=rts2800_fpu64_eabi.lib(.text)
        }

    Similarly for the .const section

    Refer the following link for more details.

    http://software-dl.ti.com/ccs/esd/documents/sdto_cgt_Linker-Command-File-Primer.html

    Best Regards

    Siddharth

  • Hello Siddarth,

    I am familiar with linker command files but in my application the device is booting from flash so if I simply allocate .const and .text to RAM, how will their contents be copied to RAM?

    When I put the .const section in RAM, no additionnal .cinit entries are created and all symbols in the .const section have the same address for load and run in the XML linker information file. I suppose the best way to solve this would be to use the TABLE(BINIT) directive on the .const section?

    However regarding the rts2800_fpu64_eabi.lib(.text) section if I move it to RAM, then _c_int00() ends up in RAM too. If I'm not mistaken this is the function responsible for copying the boot copy tables and populating all initialized sections?

    Best Regards,

    Pierre

  • P.S: I tried using TABLE(BINIT) on the .const section but it doesn't seem to have any effect. Maybe it is overridden by the linker because .const is a special section?

  • Hi Pierre,

    Refer the app note  to see how compiler sections can be copied from Flash to RAM at run-time.  You can have the .const section in Flash and then copy it to RAM.

    Also, for the rts library code , you can specify which code to be allocated to RAM.You need not have the entire library code in RAM

    For example,

    rts2800_fpu64 : > RAM
        {
             --library=rts2800_fpu64_eabi.lib<u_div28.asm.obj> (.text)
             
        }

    Best Regards

    Siddharth

  • Hi Siddharth,

    I eventually got TABLE(BINIT) to work on the .const section.

    For the library code the application note is useful, thank you.

    Pierre

     

  • Hi Siddharth,

    In continuation with the question, I am trying to integrate my application (Keypad, LCD and other functions) with Flash API.

    I need to store the parameters entered using keypad in flash for further processing.

    Both, my application and Flash API run perfect independently but when I merge then I am facing an issue.

    I have opened on thread "

    There I have explained the issue in details and even shared a snapshot.

    I humbly request you to look into the issue and guide me further.

    Thanks in advance!

    Richa 

  • Richa,

    As we suggested in the other thread, please open a new thread for your new question so that appropriate expert can be assigned to help you.

    We are closing this post.

    Thanks and regards,
    Vamsi