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.

请问在 6678 sysbios下如何给不同的任务分配不同的堆?

Other Parts Discussed in Thread: SYSBIOS

我现在测试把TI的下x264编码和 ndk 合成一个工程,用udp发送图像到dsp上,下x264编码完再通过UDP发送回PC

但是发现 x264基本把内部L2内存占了大约0x60000的空间,而NDK又需要至少0x40000的空间,

这样就造成 x264的任务不能和ndk的任务在一个堆上,因为多核需要同时运行x264任务,所以bios系统堆不能共享,只能在L2上

但是L2又不能满足X264和NDK两个任务的堆大小,所以想把X264的任务堆放在L2中,

把NDK的任务堆独立到MSMC中,请问我该怎么处理?

  • bios 动态生成一个任务时,Task_Params有个参数stackHeap,不知道这个参数的含义是什么?我查不到相关的信息,尝试使用了下没搞好.
    然后 bios 文档中有个 .common$.instanceHeap 的参数, 通过这个参数也没搞好,求教正确的使用方式
  • 可以使用Program.sectMap[]来控制静态创建任务的任务堆栈的位置。
    例如:
    /* Place idle task stack section */
    Program.sectMap[".idleTaskStackSection"] = "IRAM";
    /* Place other static task stacks */
    Program.sectMap[".taskStackSection"] = "IRAM";

    动态创建的task stack只能指定大小,不能指定到单独的内存里,统一在stack里分配。
  • 代码如下:

    Task_Params_init(&taskParams);
    taskParams.stackSize = 0x4000;
    taskParams.priority = 5;
    taskParams.stackHeap = HeapMem_Handle_to_xdc_runtime_IHeap(ndkHeap);
    Task_create((Task_FuncPtr)StackTest, &taskParams, NULL);

    cfg文件:
    Program.sectMap[".ndkHeap"] = "MSMCSRAM";
    var heapMem1Params = new HeapMem.Params();
    heapMem1Params.instance.name = "ndkHeap";
    heapMem1Params.sectionName = ".ndkHeap";
    heapMem1Params.size = 0x100000;
    Program.global.ndkHeap = HeapMem.create(heapMem1Params);

    报错:

    QMSS successfully initialized
    CPPI successfully initialized
    PA successfully initialized

    TCP/IP Stack 'Hello World!' Application

    StackTest: using localIp
    ti.sysbios.heaps.HeapMem: line 221: out of memory: handle=0x81d610, size=1536
    ti.sysbios.heaps.HeapMem: line 221: out of memory: handle=0x81d610, size=4096
    00000.000

    NC_NetStart: WARNING: Boot thread has not completed!


    StackTest: exiting

  • 程序输出:

    TCP/IP Stack 'Hello World!' Application

    StackTest: using localIp
    ti.sysbios.heaps.HeapMem: line 221: out of memory: handle=0x81d610, size=1536
    ti.sysbios.heaps.HeapMem: line 221: out of memory: handle=0x81d610, size=4096
    00000.000

    NC_NetStart: WARNING: Boot thread has not completed!


    StackTest: exiting
  • 请问是静态创建任务吗?请指定stackSection对应的段。