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.

Syslink ProcMgr hangs with the new EZSDK, what changed?

Other Parts Discussed in Thread: SYSBIOS

My Syslink code, which ran fine with the old EZSDK, is hanging when built and run with the new EZSDK.  The Syslink samples appear to run ok, so the problem has to be with my code.  Running procmgrapp with the sample notify I get the expected result:

root@dm816x-evm:~/dm816x-evm/r1397# ./procmgrapp_debug 0 notify_ti81xx_dsp.xe674

ProcMgrApp sample application

Entered SysLinkSamples_startup

SysLinkSamples_setHiddenProcId. ProcID: 1

SysLinkSamples_setHiddenProcId. ProcID: 2

SysLinkSamples_osStartup

Entered ProcMgrApp_startup

ProcMgr_attach status: [0x97d2000]

After attach: ProcMgr_getState

state [0x1]

ProcMgr_load status: [0x3046000]

After Ipc_loadcallback: ProcMgr_getState

state [0x3]

ProcMgr_start passed [0x6a85000]

After Ipc_startcallback: ProcMgr_getState

state [0x4]

ProcMgr_close status: [0x97d2000]

Leaving ProcMgrApp_startup

Press enter to continue and perform shutdown ...

Entered ProcMgrApp_shutdown

Ipc_control Ipc_CONTROLCMD_STOPCALLBACK status: [0x97d2000]

ProcMgr_stop status: [0x6a85000]

After stop: ProcMgr_getState

state [0x2]

ProcMgr_unload status: [0x0]

After unload: ProcMgr_getState

state [0x2]

ProcMgr_detach status: [0x6a85000]

After detach: ProcMgr_getState

state [0x0]

ProcMgr_close status: [0x0]

Leaving ProcMgrApp_shutdown

SysLinkSamples_shutdown

SysLinkSamples_osShutdown

Running procmgrapp with my code I only get as far as ProMgr_Startup:

SysLinkSamples_osStartup
Entered ProcMgrApp_startup
ProcMgr_attach status: [0x97d2000]
After attach: ProcMgr_getState
    state [0x1]
ProcMgr_load status: [0x3046000]
After Ipc_loadcallback: ProcMgr_getState
    state [0x3]
ProcMgr_start passed [0x6a85000]

The code is hanging in the call to Ipc_control after ProcMgr_start:

status = Ipc_control (procId,
                                  Ipc_CONTROLCMD_STARTCALLBACK,
                                  NULL);

This code ran fine when built in the old EZSDK.  Besides the ProcMgr, which I updated in my code, what has changed?  I changed my .cfg file to use the new shared region definition and I also am using the new Platform definition.  I notice that there are now three .cfg files, one for the DSP, another for VIDEO-M3, and another for VPSS.  Could this have something to do with the problem?

Lee Holeva

 

  • Chris Ring said:
    If you're using Codec Engine, Ipc_attach() is done in the Server thread (created during CERuntime_init()).

    I'm not using Codec Engine.  I've written a simple test app and run with procmgrapp built from the included samples and the code still hangs:

    root@dm816x-evm:~/dm816x-evm/r1397# ./procmgrapp_debug 0 Syslink_test.out
    ProcMgrApp sample application
    Entered SysLinkSamples_startup
    SysLinkSamples_setHiddenProcId. ProcID: 1
    SysLinkSamples_setHiddenProcId. ProcID: 2
    SysLinkSamples_osStartup
    Entered ProcMgrApp_startup
    ProcMgr_attach status: [0x97d2000]
    After attach: ProcMgr_getState
        state [0x1]
    ProcMgr_load status: [0x3046000]
    After Ipc_loadcallback: ProcMgr_getState
        state [0x3]
    ProcMgr_start passed [0x6a85000]

    The board will not let me attach the source code files, so here is my rtos code:

    DSPtasks.h

    /*
     * Preprocessing.h
     *
     *  Created on: Apr 26, 2011
     *      Author: lholeva
     */

    #ifndef DSPTASKS_H_
    #define DSPTASKS_H_


    #endif /* PREPROCESSING_H_ */
    /*!
     *  @brief  Event numbers assigned to DSP tasks
     */

    /*!
     *  @brief  Number of event numbers to be used
    */

    /* App info tag ID */
    //#define APP_INFO_TAG        0xBABA0000
    #define  DODSPTASK_ARGVALUE           0xABABCDCD


    /* Function prototypes */
    Void Preprocessing_taskFxn(UArg, UArg);

    DSPtasks.c

    /*  -----------------------------------XDC.RUNTIME module Headers    */
    #include <xdc/std.h>
    #include <xdc/runtime/System.h>
    #include <xdc/runtime/Error.h>
    #include <xdc/runtime/IHeap.h>

    /*  ----------------------------------- IPC module Headers           */
    #include <ti/ipc/MultiProc.h>

    /*  ----------------------------------- Notify module Headers        */
    #include <ti/ipc/Notify.h>
    #include <ti/ipc/Ipc.h>
    #include <ti/ipc/HeapMemMP.h>
    #include <ti/ipc/MessageQ.h>
    /*  ----------------------------------- BIOS6 module Headers         */
    #include <ti/sysbios/knl/Semaphore.h>
    #include <ti/sysbios/BIOS.h>
    #include <ti/sysbios/knl/Task.h>

    /*  ----------------------------------- To get globals from .cfg Header */
    #include <xdc/cfg/global.h>

    #include <string.h>
    #include <stdlib.h>

    #include "DSPtasks.h"


    /*
     *  ======== main ========
     */
    Int main()
    {


        Ipc_start();
        BIOS_start();

        //Error_init(&eb);
      
        return (0);
    }


    /*
     *  ======== Preprocessing_taskFxn ========
     */
    Void Preprocessing_taskFxn(UArg arg0, UArg arg1)
    {
      UInt16 hostId, lprocId;
      Int status = 0;
     

      hostId = (UInt16)arg0;
      lprocId = MultiProc_self ();
       
      do {
            status = Ipc_attach(hostId);
      } while (status < 0);
       
    }

    DSPtasks_ti81xx.cfg

    /**
     *  @file   DSPtasks_ti81xx.cfg
     *
     *  @brief      RTOS configuration file
     *
     *
     *  @ver        02.00.00.56_alpha2
     * 
     * 
     */


    var System   = xdc.useModule('xdc.runtime.System');
    var SysStd   = xdc.useModule('xdc.runtime.SysStd');
    System.SupportProxy = SysStd;

    var MultiProc     = xdc.useModule('ti.sdo.utils.MultiProc');
    var SharedRegion  = xdc.useModule('ti.sdo.ipc.SharedRegion');


    /* Syslink rtos library */
    xdc.loadPackage ('ti.syslink.ipc.rtos');

    /* The DSP is processor id 0 and there are three processors */
    MultiProc.setConfig("DSP", ["DSP", "VIDEO-M3", "VPSS-M3", "HOST"]);

    var Ipc       = xdc.useModule('ti.sdo.ipc.Ipc');
    Ipc.procSync = Ipc.ProcSync_PAIR;
    /* Set host id */
    Ipc.hostProcId = MultiProc.getIdMeta ("HOST");

    var BIOS          = xdc.useModule('ti.sysbios.BIOS');
    var Task          = xdc.useModule('ti.sysbios.knl.Task');

    var Memory   = xdc.useModule('xdc.runtime.Memory');
    Memory.defaultHeapSize = 0x8000;
    Program.heap = 0x8000;

    /*
    *  Application constants that all three programs use.
    */
    Program.global.MSGQ_NAME            = "MSGQ_";
    Program.global.HEAP_NAME            = "HeapMemMP";
    Program.global.HEAP_ALIGN           =   128;
    Program.global.HEAP_MSGSIZE         =   128;
    Program.global.HEAP_NUMMSGS         =    10;
    Program.global.HEAPID               =     0;

    /* Task that does the message passing */
    var tsk1 = Task.create('&Preprocessing_taskFxn');
    tsk1.instance.name = "Preprocessing_taskFxn";
    tsk1.arg0 = MultiProc.getIdMeta ("HOST");
    tsk1.stackSize = 0x1000;

    /* Set Shared Region variables by picking up the information from Platform
     * memory map
     */
    var sr0MemSection = Program.cpu.memoryMap['SR0'];
    var SHAREDREG_0_MEM     = 0x97600000;
    var SHAREDREG_0_MEMSIZE = 0x01000000;
    var SHAREDREG_0_ENTRYID = 0;
    var SHAREDREG_0_OWNERPROCID = Ipc.hostProcId;

    var sr1MemSection = Program.cpu.memoryMap['SR1'];
    var SHAREDREG_1_MEM     = 0x96A00000
    var SHAREDREG_1_MEMSIZE = 0x00C00000;
    var SHAREDREG_1_ENTRYID = 1;
    var SHAREDREG_1_OWNERPROCID = Ipc.hostProcId;

    /*
     *  Need to define the shared region. The IPC modules use this
     *  to make portable pointers. All processors need to add this
     *  call with their base address of the shared memory region.
     *  If the processor cannot access the memory, do not add it.
     */
    SharedRegion.setEntryMeta(SHAREDREG_0_ENTRYID,
        {
          base:        SHAREDREG_0_MEM,
          len:         SHAREDREG_0_MEMSIZE,
          ownerProcId: SHAREDREG_0_OWNERPROCID,
          isValid:     true,
          name:        "shared_region_0",
        });

    SharedRegion.setEntryMeta(SHAREDREG_1_ENTRYID,
        {
          base:        SHAREDREG_1_MEM,
          len:         SHAREDREG_1_MEMSIZE,
          ownerProcId: SHAREDREG_1_OWNERPROCID,
          isValid:     true,
          name:        "shared_region_1",
          createHeap:  true
        });

    I changed the evmDM8168 platform to match the TI816 platform used by the SDK samples.

    Lee Holeva