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.

Pre-loading code into IRAM

I am trying to benchmark some code on a C6748 (using CCS4 and SYS/BIOS), so I am running it as a one-shot CLK instance and using Timestamp_get32() to capture time.  It is taking longer than I expected, and I think this is due to where the code is being read from (I assume it is either flash or DDR).  Is there any way to pre-load the code into IRAM?  It is only about 50 lines of C code.  Any help would be much appreciated .

-Marc

  • You can look in the .map file to see where the function is currently being allocated.  So if your theory is correct that should confirm that the function is currently linked into external memory.

    Let's say your function is called myfunc().  If you want to have that function located in internal memory that you can simply add another linker command file (e.g. custom_linker.cmd) to your project and add something like this:

    SECTIONS
    {
        .text:myfunc > IRAM
    }

    In the case above "IRAM" should match the name of the memory segment that corresponds to the internal memory.  Note that the L2 memory of the processor at 0x11800000 will be much faster than the memory located at 0x80000000.