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 linker won't allow data segment or heap bigger than 0x20000 bytes?

I'm using Code Composer Studio 5.2.0.69 to build, load and run a simple C program on the A8 processor of a DM8148.  The program is intended to test changes to the timing parameters of the DDR3 RAM on a custom board.  To avoid testiing the caches instead of the RAM, I seem to have two choices - disable both L1 and L2 caches in software, which means I need to learn ARM assembler, or run the test over a range of memory addresses that's too big to fit in either cache.  I'm trying the second approach, which means the program must access a chunk of memory significantly bigger than the 512KB L2 cache.  I can't get the linker to build such a program.  I've tried both defining a global array of 1MB and allocating it from heap (using malloc() and the "--heap-size 0x100000" linker option).  Both result in linker errors like:

'Invoking: ARM Linker'

"C:/ti/ccsv5/tools/compiler/tms470_4.9.1/bin/cl470" -mv7A8 --code_state=32 --abi=eabi -me -g --define=dm8146 --define=dm8148 --diag_warning=225 --display_error_number -z --stack_size=0x800 -m"Memory_performance_test.map" --heap_size=0x100000 -i"C:/ti/ccsv5/tools/compiler/tms470_4.9.1/lib" -i"C:/ti/ccsv5/tools/compiler/tms470_4.9.1/include" --reread_libs --warn_sections --display_error_number --rom_model -o "Memory_performance_test.out"  "./ptr_rw.obj" -l"libc.a" "../DM8148.cmd"

<Linking>

"../DM8148.cmd", line 49: error #10099-D: run placement fails for object

   ".sysmem", size 0x100000 (page 0).  Available ranges:

   L3OCMC0      size: 0x20000      unused: 0x1a91b      max hole: 0x1a917  

 

How do I get the linker to allow a data segment or heap of a several megabytes?

Thanks!

- Dave Beal

 

  • HI Dave,

    I dont think its issue with linker. You need to provide proper memory sections with appropriate sizes as supported by the SoC (in this case DM8148).

    In your case, sysmem is mapped to 128KB of OCMC ram. Is this intended? (Sorry if it is hidden in your explanation above which i might have missed)

    Regards

    Radhesh

  • Hello Radhesh -

    Thank you for your quick reply.  My problem was that I wasn't aware of the linker command file (DM8148.cmd).  It doesn't seem to be mentioned in the CCS help pages.  I changed it to put my data sections into the DDR0 section and my program is now working.

    Thanks again.

    - Dave