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.

TMS320C6678: C6678 linker section fill directive not working as expected

Part Number: TMS320C6678

Hi, I'm trying to fill a user-defined uninitialized output section with the value 0xffffffff by using the 'fill=value' directive in my linker command file. When I load the program and inspect the memory area, the variables in that section are all initialized with 0, not 0xffffffff as I expected.

In my code, I define the following variables with pragmas to map them into a data section named  'SHARED_LOCK_SECTION'.

coreLock dmaLock;
#pragma DATA_SECTION (dmaLock, "SHARED_LOCK_SECT:dmaLock")
#pragma DATA_ALIGN (dmaLock, 64)

coreLock tdmLock;
#pragma DATA_SECTION (tdmLock, "SHARED_LOCK_SECT:tdmLock")
#pragma DATA_ALIGN (tdmLock, 64)

coreLock initLock;
volatile int init0Cnt;
volatile int init1Cnt;
volatile int cinitCnt;
#pragma DATA_SECTION (initLock, "SHARED_LOCK_SECT:initLock")
#pragma DATA_ALIGN (initLock, 64)
#pragma DATA_SECTION (init0Cnt, "SHARED_DATA_SECT")
#pragma DATA_SECTION (init1Cnt, "SHARED_DATA_SECT")
#pragma DATA_SECTION (cinitCnt, "SHARED_DATA_SECT")

In the linker command file, I use the following syntax to assign the SHARED_DATA_SECT into the MSMCSRAM memory space and fill that section with 0xffffffff

SHARED_LOCK_SECT: {} > MSMCSRAM fill=0xffffffff

The memory map file shows the following assignment - it does not indicate that the fill directive was used.

SHARED_DATA_SECT
* 0 9942af80 000016a6 UNINITIALIZED
9942af80 00001200 AvayaC6678.obj (SHARED_DATA_SECT:FrameTaskData)
9942c180 00000180 AvayaC6678.obj (SHARED_DATA_SECT:CpuUsage)
9942c300 00000180 AvayaC6678.obj (SHARED_DATA_SECT:DecodeQueue)
9942c480 00000180 AvayaC6678.obj (SHARED_DATA_SECT:EncodeQueue)
9942c600 0000000c GpakStdPjt.lib : GpakMain.obj (SHARED_DATA_SECT)
9942c60c 0000000c : GpakPcm.obj (SHARED_DATA_SECT:TDM)
9942c618 00000008 : DebugAides.obj (SHARED_DATA_SECT)
9942c620 00000004 : GpakMsg.obj (SHARED_DATA_SECT:statsReset)
9942c624 00000002 : GpakMsg.obj (SHARED_DATA_SECT:NumActiveChannels)

On an older C6472 multicore project, this same exact approach was used, and in that case, the fill directive worked and the memory map file shows the fill value:

SHARED_LOCK_SECT
* 0 00200000 00002280
00200000 00002000 TrilogyInit_log_V6_0_6_CG6_1_15.o64p (SHARED_LOCK_SECT:PreHeaderLock) [fill = ffffffff]
00202000 000000c0 ADT_GpakStd_log_V6_0_6_CG6_1_15.l64p : GpakMsg_log_V6_0_6_CG6_1_15.o64p (SHARED_LOCK_SECT:ResourceLocks) [fill = ffffffff]
002020c0 00000040 : DebugAides_log_V6_0_6_CG6_1_15.o64p (SHARED_LOCK_SECT) [fill = ffffffff]
00202100 00000040 : GpakMain_log_V6_0_6_CG6_1_15.o64p (SHARED_LOCK_SECT:dmaLock) [fill = ffffffff]
00202140 00000040 : GpakMsg_log_V6_0_6_CG6_1_15.o64p (SHARED_LOCK_SECT:fifoLock) [fill = ffffffff]
00202180 00000040 : GpakMain_log_V6_0_6_CG6_1_15.o64p (SHARED_LOCK_SECT:initLock) [fill = ffffffff]
002021c0 00000040 ipStackSupport.o64p (SHARED_LOCK_SECT:ipMapLock) [fill = ffffffff]
00202200 00000040 ADT_GpakStd_log_V6_0_6_CG6_1_15.l64p : GpakFrame_log_V6_0_6_CG6_1_15.o64p (SHARED_LOCK_SECT:queueLock) [fill = ffffffff]
00202240 00000040 : GpakMain_log_V6_0_6_CG6_1_15.o64p (SHARED_LOCK_SECT:tdmLock) [fill = ffffffff]

System Info:

processor_sdk_rtos_c667x_6_03_00_106

platform: TMS320C6678 EVM

CCS 11.0.0.00012

I would appreciate your advice to help solve this problem.

Jim

  • Correction:.... I meant to paste the 'SHARED_LOCK_SECTION' output from my c6678 memory map file (NOT the SHARED_DATA_SECTION). Here's the correct output that does not indicate the fill directive took effect.

    SHARED_LOCK_SECT
    * 0 0c372bc0 00000280 UNINITIALIZED
    0c372bc0 000000c0 GpakStdPjt.lib : GpakMsg.obj (SHARED_LOCK_SECT:ResourceLocks)
    0c372c80 00000040 : DebugAides.obj (SHARED_LOCK_SECT)
    0c372cc0 00000040 : GpakMain.obj (SHARED_LOCK_SECT:dmaLock)
    0c372d00 00000040 : GpakMsg.obj (SHARED_LOCK_SECT:fifoLock)
    0c372d40 00000040 : GpakMain.obj (SHARED_LOCK_SECT:initLock)
    0c372d80 00000040 ipStackSupport.obj (SHARED_LOCK_SECT:ipMapLock)
    0c372dc0 00000040 GpakStdPjt.lib : GpakFrame.obj (SHARED_LOCK_SECT:queueLock)
    0c372e00 00000040 : GpakMain.obj (SHARED_LOCK_SECT:tdmLock)

  • Hi James,

    Please refer Section "8.5.4" in the document for MEMORY directive syntax, spru513r.pdf

    If the you want to force the unused memory to 0xFF it can be done by modifying the linker command file used to generate the .out file. 

    For ex:-

       FLASH           : origin = 0x090000, length = 0x002000, fill=0xFFFF

    Thanks,

    Rajarajan U