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.

mem_reserve variable for evm-k2h

Hi, 

Do I need to change the default value of the mem_reserve variable in u-boot for the evm-k2h?

By default, this value is set to 512M.

Some part of the documentation says it should be changed to 1536M but doesn't explain why.

Right now, I am trying to test IPC between the ARM and the DSP but can't get it to work and I am wondering if that could explain why it isn't working. 

Regards,

- David


  • Some part of the documentation says it should be changed to 1536M but doesn't explain why.


    I think you are referring to IPC FAQ wiki. Yes, If you are planning to use image processing demo as reference you need to change the mem_reserve variable.

    Any how, I will ask our IPC experts to comment. Are you working on MCSDK or Processor SDK? Please provide the version.
  • Yes, I was referring to the IPC wiki.

    I am working with the Processor SDK version 03.00.00.04.
    I want to get the TransportQmss examples to work but the DSP are stuck in an infinit loop in the Ipc_start() function.

    I've looked in the forum for other post about it. Everything seems to point to memory region and cache. However, I am using the default example (with nothing changed) and kind of expected them to work :).

    I have also tried the example from the MCSDK and got exactly the same result.

    Regards,
    - David
  • We used to do the following command to run the IPC examples in Linux (Matrix GUI)
    DSP needs much more memory to do the IPC stuff.
    mem_reserve is for allocating memory for DSP.
    u-boot# env default –f –a
    u-boot# setenv mem_reserve 1536M
    u-boot# saveenv
    u-boot# boot
  • I did that but the transportQmss examples still don't work on my EVM.
    Both DSP cores running the transportQmssDspEpK2HC66TestProject app are stuck in the Ipc_start function (I've attached a debugger on both cores to know what they were doing).

    Do you have any ideas why these examples aren't working out of the box?

    - David
  • Is this "transportQmssDspEpK2HC66TestProject" example from processor SDK package ?
    Please do make sure that you are using the example and dependency SWs from the same package & version.
  • Yes, it is part of the processor SDK package.
    I've created the project with the pdkCreateProject.sh script and compiled it (no problem with that step).

    Regards,
    - David
  • Okay, thanks David.
    Please let me know the procedure that you did.
    Let me try and update you on Monday (I'm OoO now)
  • Hi Titus,

    This is what I did to generate, compile and run the example: 

    1. Generate the transportQmss projects 
      eng@eng-VirtualBox:~/ti/pdk_k2hk_4_0_2/packages$ ./pdksetupenv.sh
      eng@eng-VirtualBox:~/ti/pdk_k2hk_4_0_2/packages$ ./pdksetupenv.sh K2H all little transportqmss dsp
    2. Open the project in code composer and compile it

      Note, I added 2 traces in the startup sequence: 1 just above the IpcMgr_ipcStartup and one above the Ipc_Startup function.

    3. Move the generate *.out file to the device rootfs
    4. On my linux host, compile the TransportQmss test package in Yocto
      bitbake ipc-transport-qmss-test

      This will generate the armEp_test_k2h.out bibary.

    5. Move the compile binary to the target
    6. Start the RM server on the host
      rmServer.out /usr/bin/device/k2h/global-resource-list.dtb /usr/bin/device/k2h/policy_dsp_arm.dtb
    7. Load and run the DSP binary on Core 0 and Core 1
      mpmcl load dsp0 transportQmssDspEpK2HC66TestProject.out
      mpmcl load dsp1 transportQmssDspEpK2HC66TestProject.out
      mpmcl run dsp0
      mpmcl run dsp1
    8. Start the arm Application
    armEpTest_k2h.out


    Here is the result I get on the console and DSP traces when I run the example:

    root@k2hk-evm:~# cat /sys/kernel/debug/remoteproc/remoteproc0/trace0
    2 Resource entries at 0x810000
    Core 0 : ******************************************************
    Core 0 : SYS/BIOS DSP TransportQmss Heterogeneous Test (DSP EP)
    Core 0 : ******************************************************
    Core 0 : Device name:               TMS320TCI6636
    Core 0 : Processor names:           HOST,CORE0,CORE1
    Core 0 : IPC Core ID:               1
    Core 0 : Number of DSPs             2
    Core 0 : Number of test iterations: 100
    Core 0 : Starting IPC core 1 with name ("CORE0")
    Core 0 : Starting IPC communication with host
    registering rpmsg-proto:rpmsg-proto service on 61 with HOST
    Core 0 : Starting IPC DSP-DSP communication
    root@k2hk-evm:~# cat /sys/kernel/debug/remoteproc/remoteproc1/trace0
    2 Resource entries at 0x810000
    Core 1 : ******************************************************
    Core 1 : SYS/BIOS DSP TransportQmss Heterogeneous Test (DSP EP)
    Core 1 : ******************************************************
    Core 1 : Device name:               TMS320TCI6636
    Core 1 : Processor names:           HOST,CORE0,CORE1
    Core 1 : IPC Core ID:               2
    Core 1 : Number of DSPs             2
    Core 1 : Number of test iterations: 100
    Core 1 : Starting IPC core 2 with name ("CORE1")
    Core 1 : Starting IPC communication with host
    registering rpmsg-proto:rpmsg-proto service on 61 with HOST
    Core 1 : Starting IPC DSP-DSP communication
    
    root@k2hk-evm:~# armEpTest_k2h.out
    *********************************************************
    * ARMv7 Linux TransportQmss Heterogeneous Test (ARM EP) *
    *********************************************************
    TransportQmss Version : 0x02000001
    Version String: Linux IPC Transports Revision: 2.0.0.01:Sep 22 2016:10:02:09
    Process 0 : Starting RM Message Hub
    Process 1 : Initialized RM_Client0
    Process 1 : Opening RM client socket /var/run/rm/rm_client0
    Process 0 : Created RM hub queue: RM_Message_Hub, Qid: 0x80
    Process 0 : Opening RM_Client_DSP_1
    Process 1 : Creating TransportQmss instance
    Process 1 : Local MessageQ: TEST_MsgQ_Proc_0, QId: 0x81
    Process 1 : Attempting to open DSP 1 queue: TEST_MsgQ_Proc_1
    
    

    
    

  • Hi ,

    Were you able to verify the example on your end?

    Regards,

    - David

  • Hi, 

    I have managed to get the example to work. 

    While investigating the issue, I also tested the transportQmssBenchmark project and that one worked without any modification on my part. So, I decided to take the SYS/BIOS configuration file from that project and adapt for the transportQmssDspEp project. And it worked! After moving things around to figure out what could be causing the issue, it turns out the place where the shared region is defined is really important. If placed in the middle of the configuration file (like the original dsp_ep.cfg from the example), the IPC start blocks. If the shared region is defined at the end of the configuration file, it works! Here is the configuration file that I am now using: 

    /* 
     * Copyright (c) 2011-2015, Texas Instruments Incorporated
     * All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     * *  Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     * *  Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the distribution.
     *
     * *  Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */
    
    var Task      = xdc.useModule('ti.sysbios.knl.Task'); 
    var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');
    var Timestamp = xdc.useModule('xdc.runtime.Timestamp');
    var System    = xdc.useModule('xdc.runtime.System');
    var SysMin = xdc.useModule('xdc.runtime.SysMin');
    System.SupportProxy = SysMin;
    var BIOS = xdc.useModule('ti.sysbios.BIOS');
    BIOS.heapSize = 0xA000;
    /* BIOS.libType = BIOS.LibType_Debug; */ /* Uncomment to debug step BIOS and
                                                IPC code from CCS */
    var CpIntc    = xdc.useModule('ti.sysbios.family.c66.tci66xx.CpIntc');
    
    /* Load and use the CSL, CPPI, QMSS, and RM packages */
    var devType = "k2h"
    var Csl = xdc.useModule('ti.csl.Settings');
    Csl.deviceType = devType;
    var Cppi = xdc.loadPackage('ti.drv.cppi'); 
    var Qmss = xdc.loadPackage('ti.drv.qmss');
    var Rm   = xdc.loadPackage('ti.drv.rm');
    
    Program.sectMap[".qmss"] = new Program.SectionSpec();
    Program.sectMap[".qmss"] = "MSMCSRAM";
    
    Program.sectMap[".cppi"] = new Program.SectionSpec();
    Program.sectMap[".cppi"] = "MSMCSRAM";
    
    Program.sectMap[".desc"] = new Program.SectionSpec();
    Program.sectMap[".desc"] = "MSMCSRAM";
    
    Program.sectMap[".sharedGRL"] = new Program.SectionSpec();
    Program.sectMap[".sharedGRL"] = "L2SRAM";
    
    Program.sectMap[".sharedPolicy"] = new Program.SectionSpec();
    Program.sectMap[".sharedPolicy"] = "L2SRAM";
    
    Program.sectMap[".sync"] = new Program.SectionSpec();
    Program.sectMap[".sync"] = "MSMCSRAM";
    
    
    var Ipc = xdc.useModule('ti.sdo.ipc.Ipc');
    /* Synchronize all processors (this will be done in Ipc_start using
     * TransportShmNotify transport) */
    Ipc.procSync = Ipc.ProcSync_ALL;
    
    var MessageQ = xdc.useModule('ti.sdo.ipc.MessageQ');
    var TransportQmss = xdc.useModule('ti.transport.ipc.c66.qmss.TransportQmss');
    
    var NotifyCirc = xdc.useModule('ti.sdo.ipc.notifyDrivers.NotifyDriverCirc');
    var Interrupt = xdc.useModule('ti.sdo.ipc.family.tci663x.Interrupt');
    NotifyCirc.InterruptProxy = Interrupt;
    
    /* Should be done internally */
    xdc.useModule("ti.ipc.namesrv.NameServerRemoteRpmsg");
    
    var VirtQueue = xdc.useModule('ti.ipc.family.tci6638.VirtQueue');
    
    /*  Notify brings in the ti.sdo.ipc.family.Settings module, which does
     *  lots of config magic which will need to be UNDONE later, or setup
     *  earlier, to get the necessary overrides to various IPC module proxies!
     */
    var Notify = xdc.module('ti.sdo.ipc.Notify');
    var Ipc = xdc.useModule('ti.sdo.ipc.Ipc');
    
    /* Note: Must call this to override what's done in Settings.xs ! */
    Notify.SetupProxy = xdc.module('ti.sdo.ipc.family.tci663x.NotifyCircSetup');
    
    xdc.loadPackage('ti.ipc.ipcmgr');
    
    var MessageQ  = xdc.useModule('ti.sdo.ipc.MessageQ');
    var VirtioSetup = xdc.useModule('ti.ipc.transports.TransportRpmsgSetup');
    MessageQ.SetupTransportProxy = VirtioSetup;
    
    var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf');
    var params = new HeapBuf.Params;
    params.align = 8;
    params.blockSize = 512;
    params.numBlocks = 256;
    var msgHeap = HeapBuf.create(params);
    MessageQ.registerHeapMeta(msgHeap, 0);
    
    var TransportRpmsg = xdc.useModule('ti.ipc.transports.TransportRpmsg');
    
    /* Set to disable error printouts */
    /* var Error = xdc.useModule('xdc.runtime.Error'); */
    /* Error.raiseHook = null; */
    
    var MultiProc = xdc.useModule('ti.sdo.utils.MultiProc');
    /* Cluster definitions - Example one cluster.
     * [Cluster Base ID: 0] - 1 Host + 2 DSPs (Procs) */
    MultiProc.numProcessors = 3;
    MultiProc.numProcsInCluster = 3;
    MultiProc.baseIdOfCluster = 0;
    var procNameList = ["HOST", "CORE0", "CORE1"];
    MultiProc.setConfig(null, procNameList);
    
    /* Note: MultiProc_self is set during VirtQueue_init based on DNUM. */
    var MultiProcSetup = xdc.useModule('ti.sdo.ipc.family.tci663x.MultiProcSetup');
    MultiProcSetup.configureProcId = false;
    
    Program.global.sysMinBufSize = 0x8000;
    SysMin.bufSize  =  Program.global.sysMinBufSize;
    
    /* Enable Memory Translation module that operates on the Resource Table */
    var Resource = xdc.useModule('ti.ipc.remoteproc.Resource');
    /* Make sure RemoteProc's .resource_table doesn't conflict with secure
     * kernel when on secure board.  Secure kernel is located from
     * 0x00800000 - 0x00810000 */
    Resource.loadAddr = 0x00810000;
    
    
    Program.global.DEVICENAME = Program.cpu.deviceName;
    Program.global.PROCNAMES = procNameList.join(",");
    Program.global.BUILDPROFILE = Program.build.profile;
    
    var HeapBufMP   = xdc.useModule('ti.sdo.ipc.heaps.HeapBufMP');
    var SharedRegion = xdc.useModule('ti.sdo.ipc.SharedRegion');
    SharedRegion.translate = false;
    SharedRegion.setEntryMeta(0,
        { base: 0x0C000000, 
          len: 0x00300000,
          ownerProcId: MultiProc.baseIdOfCluster + 1,  /* Needs to be global core ID of DSP Core 0 */
          isValid: true,
          cacheEnable: true,
          cacheLineSize: 128,  /* Allocated messages aligned to cache line */
          name: "internal_shared_mem",
        });
    
    Best regards,
    - David

    1830.test.cfg

  • I apologize, busy with other stuff, not able to start with this issue.
    Sounds good, thanks for the update.
    I am sure it would help to other community members, thanks for that.