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.

understanding ramfuncs

I have found various information, but it is a bit disconnected.  As such I have the genral idea, but was wondering if there is a more consise description of the current status of the ramfuncs, or the moving memory from frlash to RAM (ie: storing in FLAHS, but moving to RAM for execution)

The sources I have looked at are:

1. 

2. 

3. 

now the first source explains the general idea of what is going on under the hood where a code copy command is being inserted at some point, however it appears things have changed terminology since this document.

As such it appears from looking at examples that we just use ramfuncs and codestart, and it appears we need to set the -ramfuncs option to the compiler if we desire all functions to be moved to ram.

I can't find anywhere any specific reference to initialized data?  So the question would be, if I just allocate initialized data to RAM, will it be copied from flash to RAM?  or do I need a -ramData option?  Also in the current form, since we don't seem to need to include wddisable and the copy sections as the first source required... so I'm assuming these have somehow been built into the current version so this code copy is happening solely with the inclusion of codestart and ramfuncs?

Is there any current documentation like the first source that very explicitly explains where/how this code copy is happening?

Thanks.

  • This wiki article is the best description of the ramfuncs feature in the compiler.  Please ignore the application note from 2008.  It solves the same problem, but in a different way.  Do not attempt to mix the methods together.

    Thanks and regards,

    -George

  • So do I understand correctly:

    If I want to flash the part I put my code and constant values in flash something like:

    .cinit : > flashwhatever
    .econst : > flashwhatever2
    .pint : > flashwhatever3
    .switch:> flashwhatever4
    .text : >flashwhatever5

    then by use of the ramfunc the .text section will be moved to RAM

    as a for example:
    ramfuncs : LOAD = flahswhatever5,
    RUN = memoryWhatever,
    LOAD_START(_RamfuncsLoadStart),
    LOAD_SIZE(_RamfuncsLoadSize),
    LOAD_END(_RamfuncsLoadEnd),
    RUN_START(_RamfuncsRunStart),
    RUN_SIZE(_RamfuncsRunSize),
    RUN_END(_RamfuncsRunEnd),
    PAGE = 0, ALIGN(4)

    if my understanding is, ramfuncs is built in if we use the -ramfunc compiler option, it will effectively move all functions (.text section functions) into ram at the specified location. I don't have to manually create any code to perform the copy.

    I think that is what I am mostly trying to determine, what is built in, and what do I have to do manually.

    Now looking at the Assembler manual where it gives a slightly better description and www.ti.com/.../spraa46a.pdf,

    I can see the copy_in function...

    I think the question amounts to:

    If I want .cinit .econst .pint, .text,.switch moved to RAM, it appears the ramfuncs is something you provide to do that for functions in the .text section and I don't have to do something like the copy_in function... but I can't find anything that would (without me creating my own tables and using say the copy_in function) to move the .econst/.pint/.cint,.switch to ram.

    The exception is -rom_model and -ram_model options that move the .cinit section to ram to initialize the .ebss section


    Is that a correct interpretation? ramfuncs is a 'special built it' way to move .text section functions to Ram... used with the compiler option -ramfunc = on all functions will be moved from .text to ram... any other sections we have to manually by some method, say the copy_in function, move them to ram?
  • I apologize for the delay.

    Your understanding is correct.  You make one small error.

    Rob Barton said:
    The exception is -rom_model and -ram_model options that move the .cinit section to ram to initialize the .ebss section

    The .cinit section is not simply copied from ROM (or flash) to RAM.  Instead, tables of information in the .cinit section are used to initialize variables which are allocated to locations in .ebss.

    Thanks and regards,

    -George