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.

请教:DM8127 link.cmd编译修改问题

Other Parts Discussed in Thread: SYSBIOS

各位技术专家,大家好!

        我在做DM8127项目,想要修改linker.cmd的内存分配,想将堆(heap)的大小设为4MB,但是每次重新编译mcfw后,heap的大小都改为0,还请各位技术大神告知一下如何修改,我不胜感谢!

        想将"-heap"改大一些,但编译后又变为0,还请各位大神告知一下如何修改,谢谢!

-heap 0x0

-stack 0x40000

MEMORY
{
LINUX_MEM : org = 0x80000000, len = 0x4000000
SR1 : org = 0x88000000, len = 0x3c00000
VIDEO_M3_CODE_MEM : org = 0x8bc00000, len = 0x300000
VIDEO_M3_DATA_MEM : org = 0x8bf00000, len = 0xe00000
DSS_M3_CODE_MEM : org = 0x8cd00000, len = 0x200000
DSS_M3_DATA_MEM : org = 0x8cf00000, len = 0x1600000
DSP_CODE_MEM : org = 0x8e500000, len = 0x700000
DDR3_DSP : org = 0x8ec00000, len = 0x1400000
TILER_MEM : org = 0xb0000000, len = 0x8000000
SR2_FRAME_BUFFER_MEM : org = 0xb8000000, len = 0x6900000
SR0 : org = 0xbe900000, len = 0x1000000
HDVPSS_DESC_MEM : org = 0xbf900000, len = 0x200000
HDVPSS_SHARED_MEM : org = 0xbfb00000, len = 0x200000
HOST_VPSS_NOTIFYMEM : org = 0xbfd00000, len = 0x200000
REMOTE_DEBUG_MEM : org = 0xbff00000, len = 0x100000
OCMC0_RAM : org = 0x40300000, len = 0x40000
OCMC1_RAM : org = 0x40400000, len = 0x40000
DSP_L2_RAM : org = 0x10800000, len = 0x20000
}

  • 修改BIOS.heapSize的大小可以修改这里的"-heap"大小,修改该大小可以在DSP中申请内存空间。

    在文件ti_tools/bios_6_33_05_46/packages/ti/sysbios/BIOS.xs中查找"BIOS.heapSize",可以查到如下代码

    else if (Program.$written("heap")) {
        /* app .cfg only set Program.heap, so we use that. */
        BIOS.heapSize = Program.heap;
    }

    ........

    if (xdc.module("xdc.runtime.HeapStd").$used == false) {
        // Program.heap = 0;
        Program.heap = 0x400000;
    }

    将这里的Program.heap = 0,修改为Program.heap=0x400000(4MB);\

    编译的是时候ipnc_rdk/ipnc_mcfw/build/ipnc_rdk/obj/ti814x-evm/c6xdsp/debug/ipnc_rdk_configuro/linker.cmd中的-heap改为0x400000