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.
Using CCS v12.6; I have legacy C++ code that uses the #pragma DATA_SECTION directive to create a custom section name
e.g.
#pragma DATA_SECTION ("DMABuffers");
Int16 gScratch[NCISFRAMELENGTH];
Which is producing the following linker warning:
warning #10247-D: creating output section "DMABuffers" without a SECTIONS specification
The memory range is specified in my main.tcf file but there is no associated SECTIONS directive in the autogenerated linker command file. (maincfg.cmd)
Is there a way to associate the input? section created by the #pragma directive to the equivalent output section using the .tcf file? Or do I need to create a custom linker command file?
MEMORY statement in maincfg.cmd:
MEMORY {
PAGE 0: DARAM: origin = 0x400, len = 0xcc00
PAGE 0: VECT: origin = 0x200, len = 0x100
PAGE 0: ExtPgm: origin = 0x10000, len = 0x30000
PAGE 0: ExtPgm1: origin = 0x40000, len = 0x10000
PAGE 0: ExtPgm2: origin = 0x60000, len = 0x40000
PAGE 0: DMABuffers: origin = 0xd000, len = 0x3000
PAGE 0: NCISFrameBuf: origin = 0xa0000, len = 0x20000
PAGE 0: ExtFirmwareBuffer0: origin = 0xc0000, len = 0x10000
PAGE 0: ExtFirmwareBuffer1: origin = 0xd0000, len = 0x10000
PAGE 0: ExtFirmwareBuffer2: origin = 0xe0000, len = 0x10000
PAGE 0: ExtFirmwareBuffer8: origin = 0x140000, len = 0x10000
PAGE 0: ExtFirmwareBuffer9: origin = 0x150000, len = 0x10000
PAGE 0: ExtFirmwareBufferA: origin = 0x160000, len = 0x10000
PAGE 0: ExtFirmwareBufferB: origin = 0x170000, len = 0x10000
PAGE 0: ExtFirmwareBufferC: origin = 0x180000, len = 0x10000
PAGE 0: ExtFirmwareBufferD: origin = 0x190000, len = 0x10000
PAGE 0: ExtFirmwareBufferE: origin = 0x1a0000, len = 0x10000
PAGE 0: ExtFirmwareBufferF: origin = 0x1b0000, len = 0x10000
PAGE 0: ExtFirmwareBuffer3: origin = 0xf0000, len = 0x10000
PAGE 0: ExtFirmwareBuffer4: origin = 0x100000, len = 0x10000
PAGE 0: ExtFirmwareBuffer5: origin = 0x110000, len = 0x10000
PAGE 0: ExtFirmwareBuffer6: origin = 0x120000, len = 0x10000
PAGE 0: ExtFirmwareBuffer7: origin = 0x130000, len = 0x10000
PAGE 0: ExtNCISBuffer: origin = 0x1c0000, len = 0x10000
}
However, there is no SECTIONS directive in the autogenerated maincfg.cmd to allocate the #pragma DMABuffers section to the DMABuffers memory region.
There is only an object alias:
_DMABuffers = DMABuffers;
The discussion in this thread is helpful:
From it, I understand that I can't create a SECTIONS definition via the .tcf file, I have to do that with a custom linker .cmd file.
From other reading, I've come to understand that the linker will automatically include any and all .cmd files present in the project directory and use them in no specific order. However, I can specify the order using the project "Properties | Build | C5500 Linker | File Search Path | Include library file or command file as input" configuration dialog box to specify the order of including linker command files.
I'll add a custom .cmd file to my project directory and report back on how that goes.
I added a custom linker command file to my project (tracking.cmd) with the following contents:
SECTIONS {
DMABuffers: {} > DMABuffers
}
and that resolved this linker warning.
I added the custom linker command file using the project "Properties | Build | C5500 Linker | File Search Path | Include library file or command file as input" dialog as follows:
Note: Not directly related to this post but I'm here because I'm in the process of importing a legacy v2.0 project into CCS v12.6. I was having a lot of linker issues until I found that I needed to use DSP/BIOS v5.42.01.09 for the v5502 processor. I had been working with v5.42.02.10 but it did not have the necessary .cdb files for the v5502.