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/AM5728: DSP code execution from L2 SRAM

I'm trying to move some code from OCM to L2 SRAM. I changed the cache configuration so that it is setup as 128KB of L2SRAM and 128KB of cache. My program compiles links, the map file looks correct, the elf file looks correct, yet my program won't run.

If I move just the stack to L2SRAM, the program runs.

Since I use the first 32KB of L2 SRAM, 0x800000h to 0x807FFF, as shared memory with the A15s, I link my L2SRAM .text section to start at 0x808000. I have less than 128KB of code in this section.

Are there permission bits that have to be set to execute out of L2SRAM? I didn't see anything in the manual.

I don't understand why this doesn't work.

thanks

  • Hi,

    You made this remapping in the linker.cmd & your .cfg (if any) files, right? See

    Best Regards,
    Yordan

  • This is a brief example of my linker command file. Some sections have been removed and the function names are changed for security reasons.

    MEMORY
    {
         NEARRAM : origin = 0x40400000, length = 0x200
         RAM : origin = 0x40400400, length = 0x17fc00
         SHAREDRAM : origin = 0x800000, length = 0x8000
         L2SRAM : origin = 0x808000, length = 0x20000
    }
    SECTIONS
    {
          .vecs : > NEARRAM
          .rodata : > RAM
          .neardata : > RAM
          .bss : > RAM
          .const : > RAM
          .fardata : > RAM
          .switch : > RAM
          .stack : > RAM (HIGH)
          .far : > RAM
          .data : > RAM
          .GROUP : > L2SRAM
          {
                my_functions.obj (.text:my_function_1)
                my_functions.obj (.text:my_function_2)
                my_functions.obj (.text:my_function_3)
                my_functions.obj (.text:my_function_4) 
          }
          .text : > RAM
    }

    When some of my code is linked to L2SRAM, like above the program doesn't run

  • Hi,

    I don't see anything wrong with this linker.cmd file. It doesn't conflict with the guidelines for .cmd file creation ().

    Do you by any chance have an additional .cfg file, which conflicts with the linker.cmd definitions? Also in your c code do you have any preprocessor directives (mainly defines) that could potentially conflict with the .cmd mapping?

    Best Regards,

    Yordan