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.

TMS320VC5502: warning #10254-D: section ".ExtPgm2$heap" (0x60000) spans page boundary

Part Number: TMS320VC5502

Tool/software:

I'm need to allocate a Heap with size 0x20000; however the maximum size allowed by the processor is 0x10000.  I could create two memory sections with size 0x10000 each and define a heap of 0x10000 in each of them but will that work with the C5500 tools to have two heap spaces?  Are there any technical notes on this?  The large heap is necessary to support legacy code that creates a large C++ object when instantiated with the operator new.  I may need to restructure the code to use a static object but would like to know whether it's possible to create an aggregate heap larger than 0x10000 on the C5502 using several 0x10000 or smaller chunks.

-dean

Here's the full linker command line that's producing the warning:

Invoking: C5500 Linkera
"C:/ti/C5500 Code Generation Tools 4.4.1/bin/cl55" -v5502 --memory_model=large -g --define=_DEBUG --define=CHIP_5502 --define=_TI_ENHANCED_MATH_H --define=TRACKING --define=c5502 --define=HALFSTEP --quiet --display_error_number --ptrdiff_size=32 -z -m"C:/MyProducts/atsii/tracking/src/Debug/main.map" --stack_size=0x200 --heap_size=0x400 -i"C:/ti/C5500 Code Generation Tools 4.4.1/lib" -i"C:/ti/C5500 Code Generation Tools 4.4.1/include" -i"C:/ti/bios_5_42_01_09/packages/ti/rtdx/lib/c5500" -i"C:/ti/bios_5_42_01_09/packages/ti/bios/lib" -i"C:/MyProducts/atsii/tracking/src/main" -i"C:/MyProducts/atsii/tracking/src" -i"C:/ti/C55xxCSL/lib" --reread_libs --display_error_number --warn_sections --xml_link_info="main_linkInfo.xml" --rom_model --sys_stacksize=0x200 -o "C:/MyProducts/atsii/tracking/src/main/../Debug/main.out" "C:/MyProducts/atsii/tracking/src/Debug/CalScan.obj" "C:/MyProducts/atsii/tracking/src/Debug/CommandProcessor.obj" "C:/MyProducts/atsii/tracking/src/Debug/Datastore.obj" "C:/MyProducts/atsii/tracking/src/Debug/DatastoreErrorLog.obj" "C:/MyProducts/atsii/tracking/src/Debug/DatastoreNCIS.obj" "C:/MyProducts/atsii/tracking/src/Debug/DatastoreNCISModule.obj" "C:/MyProducts/atsii/tracking/src/Debug/DatastoreNonResetables.obj" "C:/MyProducts/atsii/tracking/src/Debug/DatastoreTracker.obj" "C:/MyProducts/atsii/tracking/src/Debug/DatastoreXMotor.obj" "C:/MyProducts/atsii/tracking/src/Debug/DatastoreYMotor.obj" "C:/MyProducts/atsii/tracking/src/Debug/Defines.obj" "C:/MyProducts/atsii/tracking/src/Debug/ExternalRAMBuffer.obj" "C:/MyProducts/atsii/tracking/src/Debug/FirmwareLoaderThread.obj" "C:/MyProducts/atsii/tracking/src/Debug/FunctionalTests.obj" "C:/MyProducts/atsii/tracking/src/Debug/Gpio.obj" "C:/MyProducts/atsii/tracking/src/Debug/MemTest.obj" "C:/MyProducts/atsii/tracking/src/Debug/NCIS.obj" "C:/MyProducts/atsii/tracking/src/Debug/NCISDataCalculator.obj" "C:/MyProducts/atsii/tracking/src/Debug/NCISDumpFormatter.obj" "C:/MyProducts/atsii/tracking/src/Debug/NCISFrameBuffer.obj" "C:/MyProducts/atsii/tracking/src/Debug/ProgramSPIFlash.obj" "C:/MyProducts/atsii/tracking/src/Debug/ProtocolIcpThread.obj" "C:/MyProducts/atsii/tracking/src/Debug/SOHMonitorThread.obj" "C:/MyProducts/atsii/tracking/src/Debug/SPI0DeviceSelect.obj" "C:/MyProducts/atsii/tracking/src/Debug/ScanCenters.obj" "C:/MyProducts/atsii/tracking/src/Debug/Serial.obj" "C:/MyProducts/atsii/tracking/src/Debug/StatusLED.obj" "C:/MyProducts/atsii/tracking/src/Debug/SystemThread.obj" "C:/MyProducts/atsii/tracking/src/Debug/Thread.obj" "C:/MyProducts/atsii/tracking/src/Debug/ThreadCommands.obj" "C:/MyProducts/atsii/tracking/src/Debug/ThreadStats.obj" "C:/MyProducts/atsii/tracking/src/Debug/Time.obj" "C:/MyProducts/atsii/tracking/src/Debug/Tracker.obj" "C:/MyProducts/atsii/tracking/src/Debug/TrackerThread.obj" "C:/MyProducts/atsii/tracking/src/Debug/TrackingInit.obj" "C:/MyProducts/atsii/tracking/src/Debug/Watchdog.obj" "C:/MyProducts/atsii/tracking/src/Debug/XMotor.obj" "C:/MyProducts/atsii/tracking/src/Debug/XMotorThread.obj" "C:/MyProducts/atsii/tracking/src/Debug/YMotor.obj" "C:/MyProducts/atsii/tracking/src/Debug/YMotorThread.obj" "C:/MyProducts/atsii/tracking/src/Debug/ast2.obj" "C:/MyProducts/atsii/tracking/src/Debug/edge.obj" "C:/MyProducts/atsii/tracking/src/Debug/main.obj" "C:/MyProducts/atsii/tracking/src/Debug/maincfg.obj" "C:/MyProducts/atsii/tracking/src/Debug/maincfg_c.obj" -l"./maincfg.cmd" -lcsl5502x.lib -lrts55x.lib -llibc.a -ltracking.cmd
warning #10254-D: section ".ExtPgm2$heap" (0x60000) spans page boundary: not
allowed before CPU revision 3.0

Snippet from main.map:

.ExtPgm2$heap 

* 0 [ 00060000 ] 00030000 * 00020000 UNINITIALIZED
[ 00060000 ] 00030000 * 00020000 --HOLE--

ExtFirmwareBuffer0
* 0 [ 000c0000 ] 00060000 * 00008000 UNINITIALIZED
[ 000c0000 ] 00060000 * 00008000 ExternalRAMBuffer.obj (ExtFirmwareBuffer0)

  • Hi Dean,

    Yes. You can do it in the MEM (Memory Section Manager) in DSP/BIOS (*.tcf):

    One heap in DARAM (up to 64KB)

    One heap in SARAM (up to 64KB)

    Best regards,

    Ming

  • Thanks Ming,

    I reallocated my single 0x20000 byte heap into two 0x10000 byte heaps in my ExtPgm2 and ExtPgm3 memory sections.

    Note: I reduced my ExtPgm2 section from 0x20000 to 0x10000 bytes and created a new ExtPgm3 section of 0x10000 bytes.

    It removes the linker warning, but since there's only one heap that's assigned to malloc() and free() I now trip an ASSERT when the large object is instantiated

    Since the objecting being created is less than 64KB (see below) I should be able to statically allocate it to the ExtPgm3 section.

    I'll do some digging through the compiler/linker reference manual to find the #pragma or linker .cmd file statements to do that.

    Any notes or thoughts on that are appreciated.

    -dean

    e.g.

    #define COLORBARS_TRACKED 4

    #define TRACKED_CB_BUFFER_SIZE 5000

    typedef struct {
        UINT m_uiXSteps;
        UINT m_uiYSteps;
    } STRUCT_CB_POSITION;

    typedef struct {
        STRUCT_CB_POSITION m_structCBPosition[COLORBARS_TRACKED];
    } STRUCT_TIERED_CB;

    m_pastructTrackedCBs = new STRUCT_TIERED_CB[TRACKED_CB_BUFFER_SIZE];

    ASSERT( m_pastructTrackedCBs!=NULL );

    // Note: total bytes needed for tiered colorbars = 5000 x 4 x 4 = 40000 bytes

  • Hi Dean,

    Here are 2 useful PRAGMAs for static memory allocation:

    1. #pragma DATA_SECTION(srcDARAM, ".buffer1")
    Uint16 srcDARAM[BUFF_SIZE * 3];

    which put the srcDARAM array into .buffer1 section. You can then put .buffer1 section into certain memory region in linker.cmd:

    .buffer1    : > DARAM

    2. #pragma DATA_ALIGN (dmaPingDstBuf, 4)
    Uint16 dmaPingDstBuf[CSL_DMA_BUFFER_SIZE];

    which make sure the (dmaPingDstBuf is 4 byte aligned

    Best regards,

    Ming

  • Thanks again Ming.  I am now able to compile/link with 0 warnings and allocate the large static object successfully.

    Note: I needed to use the C++ variant of the DATA_ALIGN pragma:

    #pragma DATA_SECTION("ExtPgm3")
    STRUCT_TIERED_CB m_tieredColorbarBuffer[TRACKED_CB_BUFFER_SIZE] = { 0 };