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.

How to get muitiple tasks to run?

Other Parts Discussed in Thread: SYSBIOS

Using Bios 6, I statically define three tasks:

/* preProcessing task */
var tsk1 = Task.create('&preProcessing_taskFxn');
tsk1.instance.name = "preProcessing_taskFxn";
tsk1.arg0 = MultiProc.getIdMeta ("HOST");
tsk1.stackSize = 0x2000;
tsk1.priority = 15;
//Notify semaphore for preProcessing
Program.global.preProcessing_sem = Sem.create(0, Sem_params);

/* corner task */
var tsk2 = Task.create('&findCorners_taskFxn');
tsk2.instance.name = "findCorners_taskFxn";
tsk2.arg0 = MultiProc.getIdMeta ("HOST");
tsk2.stackSize = 0x2000;
tsk2.priority = 15;
//Notify semaphore for corner finding
Program.global.findCorners_sem = Sem.create(0, Sem_params);

/* Ro task */
var tsk3 = Task.create('&calcRo_taskFxn');
tsk3.instance.name = "calcRo_taskFxn";
tsk3.arg0 = MultiProc.getIdMeta ("HOST");
tsk3.stackSize = 0x2000;
tsk3.priority = 15;
//Notify semaphore for calcRo
Program.global.calcRo_sem = Sem.create(0, Sem_params);

The first task, tsk1, runs and terminates and I would expect the second task, tsk2, to start up, yet this doesn't happen, instead the idle task starts up.  What is wrong?

Lee Holeva

 

  • Hi Lee,

    How do you know that tsk2 never started?  Did you set a breakpoint at the entry point to the task function and did you never hit this?  Could the task be blocked on a semaphore or some other blocking call?

    Have you tried using ROV to figure out what the task is doing?  If you go to tool->ROV in CCS you can navigate to the ROV view for the 'Task' module.  Then click on the 'detailed' tab to get information about the Task's execution state.

    Regards,

    Shreyas

  • Shreyas Prasad said:

    How do you know that tsk2 never started?  Did you set a breakpoint at the entry point to the task function and did you never hit this?  Could the task be blocked on a semaphore or some other blocking call?

    Yes, I put a breakpoint at the beginning of the function of tsk2 and it never hit.  Here is the code at the beginning of tsk2:

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

    The first line of code was never reached.

    Shreyas Prasad said:

    Have you tried using ROV to figure out what the task is doing?  If you go to tool->ROV in CCS you can navigate to the ROV view for the 'Task' module.  Then click on the 'detailed' tab to get information about the Task's execution state.

    I cannot get ROV to run as I am doing a non-project debug.  I get the following error:

    The file *.rov.xs does not exist, it did not get made by xdc (How do I get xdc to builtd this?  I'm currently building code by xdc XDCARGS="profile=debug").  I cannot build in CCS.

    Could the task not being run be due to Syslink?

    Lee Holeva

     

  • The rov.xs file should still be generated even if you are xdc build.  Do you see a generated package/ directory in the same directory that contains your .cfg file?  If you search for *.rov.xs within that generated directory, you should be able to find the file.  Copy the .rov.xs file to the directory containing your executable and try re-launching ROV.

    Also, how does Task #1 terminate?  I.e. does it do a System/BIOS_exit, does it do a Task_exit, or does it simply return?

    Sheyas

  • Ok, I found the rov file, put it where the DSP executable is and I was abel to run ROV.

    After tsk1 completed, tsk1 is still shown as running:

    I stopped the DSP code, and once I let it run again I get this:

    What could be blocking the other tasks?

    Shreyas Prasad said:

    Also, how does Task #1 terminate?  I.e. does it do a System/BIOS_exit, does it do a Task_exit, or does it simply return?

    tsk1 simply returns, should I be doing something else, say an explicit Task_exit()?

    Lee Holeva

     

  • Lee Holeva said:
    tsk1 simply returns, should I be doing something else, say an explicit Task_exit()?

    No, simply returning from the top-level task function is equivalent to performing a Task_exit(). 

    What are the other tasks blocked on? Did you try visiting the 'detailed' tab for the Task ROV view to check the 'blocked on' colum?

    Shreyas

  • Shreyas Prasad said:

    What are the other tasks blocked on? Did you try visiting the 'detailed' tab for the Task ROV view to check the 'blocked on' colum?

    They're blocked on a semaphore, but I have no idea from where this is coming from:

     

    Lee Holeva

     

  • Perhaps you never hit your breakpoint for some reason...  Then Task #2 proceeded to block on a Semaphore?  Could you try adding a System_printf at the top of Task #2's function to see if it gets printed before it blocks on the semaphore?

    You could find out more information about the semaphore (with handle 0x9ea53108) by navigating to the ROV view for Semaphore.

    Shreyas

  • Shreyas Prasad said:

    You could find out more information about the semaphore (with handle 0x9ea53108) by navigating to the ROV view for Semaphore.

    Not sure what the semaphore view indicates:

     

     

    Shreyas Prasad said:
    Could you try adding a System_printf at the top of Task #2's function to see if it gets printed before it blocks on the semaphore?

    I did that, got nothing.  The question is, from where are the blocking semaphores coming from?

    Lee Holeva

     

  • Lee--would it be possible for you to attach your testcase to this forum (.c, .cfg) so I could diagnose it directly?

    Thanks,

    Shreyas

  • Shreyas Prasad said:

    Lee--would it be possible for you to attach your testcase to this forum (.c, .cfg) so I could diagnose it directly?

    There are too many files to attach.  Give me an email address and I can send you a zip file.  You need to have a DM8168 EVM though to build and run the code.  Nevertheless, here a few fragments:

    On the DSP:

    /* Globals */
    App_Info                           aInfo;
    extern const Semaphore_Handle      preProcessing_sem;

    UInt32                             taskId0;

    // task handles
    Task_Handle                        findCornersTH = NULL;
    Task_Handle                        RoTH = NULL;

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

      Int status = Ipc_S_SUCCESS;

      /*
       Create the findCorners and calcRo tasks
      */
      Task_Params taskParams;
      Task_Params_init(&taskParams);
      taskParams.stackSize = 0x2000;
      taskParams.priority = 10;
      taskParams.arg0 = MultiProc_getId("HOST");
      findCornersTH = Task_create((Task_FuncPtr)findCorners_taskFxn, &taskParams, NULL);
      RoTH = Task_create((Task_FuncPtr)calcRo_taskFxn, &taskParams, NULL);
     
      do {
            /* Call Ipc_start() */
            status = Ipc_start();
      } while (status != Ipc_S_SUCCESS);

      BIOS_start();

      return (0);
    }

    /*
     *  ======== Preprocessing_callbackFxn ========
     */
    Void preProcessing_callbackFxn (UInt16 procId, UInt16 lineId, UInt32 eventNo,
               UArg arg, UInt32 payload)
    {

        taskId0 = eventNo;
        Semaphore_post((Semaphore_Object*)arg);

    }

    /*
     *  ======== Preprocessing_taskFxn ========
     */
    Void preProcessing_taskFxn(UArg arg0, UArg arg1)
    {
      /* MessageQ handle of the DSP's queue (parameters in) */   
      MessageQ_Handle             mesQH;
      /* Message from the host */
      MessageQ_Msg                msgin = NULL;
      UInt16                      hostId, lprocId;
      Int32                       taskId, status = 0, done = 0;
      short                       numInimgs, numOutimgs;
      Char                        tStr[80];
      char                        *ptr;
      MSG0                        *msgPtr;

      hostId = (UInt16)arg0;
      lprocId = MultiProc_self ();
       
      do {
            status = Ipc_attach(hostId);
      } while (status < 0);
       
      /* Write the app info, This info is only read by HOST as it does not have
         * static configuration feature as provided by XDC.
      */
      //message quene names
      System_sprintf (tStr, "%s%s", MSGQ_PREPROCESSING_NAME, "IN");
      strcpy (aInfo.preprocessingMsgName_in, tStr);
      System_sprintf (tStr, "%s%s", MSGQ_CORNER_NAME, "IN");
      strcpy (aInfo.cornerMsgName_in, tStr);
      System_sprintf (tStr, "%s%s", MSGQ_RO_NAME, "IN");
      strcpy (aInfo.roMsgName_in, tStr);
      System_sprintf (tStr, "%s%s", MSGQ_LINEFINDING_NAME, "IN");
      strcpy (aInfo.linefindingMsgName_in, tStr);
      System_sprintf (tStr, "%s%s", MSGQ_LINEFINDING_NAME, "OUT");
      strcpy (aInfo.holefindingMsgName_out, tStr);
      System_sprintf (tStr, "%s%s", MSGQ_HOLEFINDING_NAME, "IN");
      strcpy (aInfo.linefindingMsgName_in, tStr);
      System_sprintf (tStr, "%s%s", MSGQ_HOLEFINDING_NAME, "OUT");
      strcpy (aInfo.holefindingMsgName_out, tStr);

      System_sprintf (tStr, "%s%d%d", HEAP_NAME, hostId, lprocId);
      strcpy (aInfo.heapName, tStr);
      aInfo.numQueues   = NUMQUEUES;
      aInfo.heapAlign   = HEAP_ALIGN;
      aInfo.heapId      = HEAPID;
      Ipc_writeConfig (hostId, DODSPTASK_ARGVALUE, (Ptr) &aInfo, sizeof (App_Info));

      System_printf ("\nRegistering Preprocessing NotifyApp_callbackFxn on %s\n",
                       MultiProc_getName (MultiProc_self()));

      /* Register for events from the Host */
      preProcessing_Register(hostId, NORMALIZE);
      preProcessing_Register(hostId, FINALCLEANUP);

      /* Create a message queue for receiving stuff from the host */
      mesQH = MessageQ_create(aInfo.preprocessingMsgName_in, NULL);
         if (mesQH == NULL) {
            System_abort("MessageQ_create failed\n" );
      }

      /*
      Loop waiting for tasks
      */
      while(done != 1){

        msgin = NULL;
        //Wait for a task
        Semaphore_pend(preProcessing_sem, BIOS_WAIT_FOREVER);
        taskId = taskId0;

        /* Get input parameters */
        status = MessageQ_get(mesQH, &msgin, MessageQ_FOREVER);
        if (status != MessageQ_S_SUCCESS) {
       System_abort("Should not happen");
        }

        /* Get the pointer to the input parameter message */
        ptr = (char *)msgin + sizeof(MessageQ_MsgHeader);
        msgPtr = (MSG0 *)ptr;

        //Do the task
        switch(taskId){
      
        case NORMALIZE:

     //number of input images
     numInimgs = msgPtr->numin;
     //number of output images
     numOutimgs = msgPtr->numout;

     /* Normalize the image */
     processImage(msgPtr->Ibuf, msgPtr->Obuf, numInimgs, numOutimgs, msgPtr->gateName, normalize);

     //send the task acknowage
     sendTaskack(hostId, NORMALIZE, msgPtr->test);
     done = 1;

     break;

        } 

     }

     //Unregister notifications and free the message queue
     preProcessing_cleanup(hostId, &mesQH);
     Ipc_detach(hostId);

     /*
       Create the findCorners and calcRo tasks
     */
     /*
     Task_Params taskParams;
     Task_Params_init(&taskParams);
     taskParams.stackSize = 0x2000;
     taskParams.priority = 10;
     taskParams.arg0 = MultiProc_getId("HOST");
     findCornersTH = Task_create((Task_FuncPtr)findCorners_taskFxn, &taskParams, NULL);
     RoTH = Task_create((Task_FuncPtr)calcRo_taskFxn, &taskParams, NULL);
     */
    }

    Void sendTaskack(Int32 hId, Int32 tId, UInt32 payload)
    {
      Int32 status = 0;

      // send an acknowledge back to the host
      do {

        status = Notify_sendEvent (hId,
                                   0,
                                   tId,
                                   payload,
                                   TRUE);
      } while (   (status == Notify_E_NOTINITIALIZED)
                              ||(status == Notify_E_EVTNOTREGISTERED)
                              ||(status == Notify_E_EVTDISABLED));

    }

    On the host:

    /*!
     *  @brief  Callback function for receiving events.
     *
     *  @param  procId  Processor ID from which the event is received
     *  @param  eventNo Event number received
     *  @param  arg     Argument associated with the event number
     *  @param  payload Payload received with the event
     *
     */
    void DoDSPtask_callback (UInt16       procId,
        UInt16       lineId,
        UInt32       eventNo,
        void *       arg,
        UInt32       payload)
    {
      Osal_printf("completed task %d from processor %d with payload %d\n",
            eventNo, procId, payload);

      if (eventNo != FINALCLEANUP)
         OsalSemaphore_post ((OsalSemaphore_Handle) arg);
    }
    /*
    Setup a heap for messages
    Inputs:
    theInfo        :      Pointer to the message info set by the DSP
    */
    HeapMemMP_Handle initializeMessageheap(App_Info *theInfo)
    {
      Int32               status  = 0;
      UInt16              procId;
      SizeT               heapSize = 0;
      HeapMemMP_Params    heapMemParams;
      HeapMemMP_Handle    heapHandle;
     
      procId = MultiProc_getId ("DSP");

      /* Create Heap and register it with MessageQ */
      Osal_printf("Creating the heap\n");

      HeapMemMP_Params_init (&heapMemParams);
      heapMemParams.sharedAddr = NULL;
      heapSize = MESSAGEHEAPSIZE;

      heapMemParams.name          = theInfo->heapName;
      heapMemParams.regionId      = REGIONID0;
      heapMemParams.sharedBufSize = heapSize;
      heapHandle = HeapMemMP_create (&heapMemParams);
      if (heapHandle == NULL) {

        Osal_printf ("HeapMemMP_create failed for %d processor\n",
                                     procId);
        return(NULL);
      }

      /* Register this heap */
      Osal_printf ("Registering heapId %d with MessageQ for procId: %d\n",
                         theInfo->heapId,
                         procId);
      //MessageQ_registerHeap (&heapMH, theInfo->heapId);
      status = MessageQ_registerHeap (heapHandle, theInfo->heapId);
      if (status != MessageQ_S_SUCCESS){

        Osal_printf("Error: heap registration failure for heapId %d\n", theInfo->heapId);
        return(NULL);
      }

      return(heapHandle);
    }

    /*
    Do a task on the DSP
    DoDSPtask_run blocks till task completion for all tasks except CLEANUP
    Inputs:
    msgqName           :     Name of the message queue for sending arguments to the DSP
    heapId             :     heapId for messages
    taskId             :     DSP task Id
    syncsemH           :     completion semaphore handle
    themsg             :     pointer to the message
    msgLength          :     length of the message in bytes
    */
    int DoDSPtask_run(char                 *msgqName,
        UInt16               heapId,
        int                  taskId,
        OsalSemaphore_Handle syncsemH,
        char                 *themsg,
        UInt32               msgLength)
    {

      Int32               status  = 0;
      UInt16              procId;
      MessageQ_QueueId    rqId;
      MessageQ_Msg        msg    = NULL;
      char                *msgPtr;
     
      procId = MultiProc_getId ("DSP");

      if (themsg != NULL){

        /* Open the DSPs message queue for sending messages to the DSP */
        Osal_printf("Opening the DSP's message queue\n");
        do {
          status = MessageQ_open (msgqName, &rqId);
        } while (status == MessageQ_E_NOTFOUND);

        if (status < 0) {

          Osal_printf ("Error in MessageQ_open [0x%x] : procId [%d]\n",
                             status,
                             procId);
        }
        else{

          Osal_printf ("MessageQ_open Status %d : procId [%d]\n",
                             status,
                             procId);
          Osal_printf ("MessageQApp_queueId  [0x%x] : procId [%d]\n",
                             rqId,
                             procId);
        }

        /* Allocate memory for the message on the shared heap */
        Osal_printf("Allocating %d bytes of memory for the message\n", msgLength+sizeof(MessageQ_MsgHeader));
        msg = MessageQ_alloc(heapId, msgLength+sizeof(MessageQ_MsgHeader));
        if (msg == NULL) {

          Osal_printf ("Error in MessageQ_alloc\n");
          status = MessageQ_E_FAIL;
        }
        else{

          /* set the message Id */
          Osal_printf("Putting the taskId into the message\n");
          MessageQ_setMsgId(msg, taskId);

          /* copy the message body into the message */
          msgPtr = (char *)msg + sizeof(MessageQ_MsgHeader);
          memcpy(msgPtr, themsg, msgLength);
         
          /* Send the message to the DSP */
          Osal_printf("Sending a message to the DSP\n");
          status = MessageQ_put(rqId, msg);
          if (status != MessageQ_S_SUCCESS) {

     Osal_printf ("MessageQ_error status = %d\n", status);
     status = MessageQ_E_FAIL;
     return(status);
          }

          /* close the remote queue */
          status = MessageQ_close (&rqId);
          if (status < 0) {

     Osal_printf ("MessageQ_close failed. Status %d\n",
                                 status);
          }
        }
      }

      do {
          Osal_printf("Sending taskId %d to the DSP\n", taskId);
          status = Notify_sendEvent (procId,
                                     DODSPTASK_LINEID,
                                     taskId,
                                     0,
                                     TRUE);
      } while ((status == Notify_E_NOTINITIALIZED)
                  ||(status == Notify_E_EVTNOTREGISTERED)
                  ||(status == Notify_E_EVTDISABLED));

      if (status < 0) {
          Osal_printf ("Error in Notify_sendEvent for processor %d"
                       "Status = %d\n",
                       procId,
                       status);
          return(status);
      }

      /* wait for completion */
      if (taskId != FINALCLEANUP){

        OsalSemaphore_pend (syncsemH, OSALSEMAPHORE_WAIT_FOREVER);
        //done with this message, free it
        MessageQ_free(msg);
      }

      return(status);
    }

    The prePropcessing task function runs as expected, upon receipt of a notification from the host, it reads the message queue for input parameters and processes an image in shared memory.

    I did an experiment of moving the creation of tasks 2 and 3 around.  If I attempt to create them dynamically in main, I get the same result, tasks 2 and 3 never start up.  If I create tasks 2 and 3 at the end of task 1, both task 2 starts and when it gets blocked waiting for a notification, task 3 starts up.  However, I am now gettig an assertion error in the DSP:

    ti.sdo.ipc.MessageQ: line 435: assertion failure: A_invalidQueueId: Invalid queueId is used

    ti.sysbios.gates.GateMutex: line 114: assertion failure: A_badContext: bad calling context. See GateMutex API doc for details.

    xdc.runtime.Error.raise: terminating execution

    After sending a task notification to the task function in task2, the message queue gets overwritten.  ROV is not giving any indication of a stack overflow.  Perhaps this is an indication of a bug in either Syslink or SysBios, when task 2 gets made it uses memory that Syslink has already used.

     Update:

    In messageQ.c, ListMP_getHead is returning garbage:

     

     

     

    Void TransportShm_swiFxn(UArg arg)

    {

    UInt32 queueId;

    TransportShm_Object *obj = (TransportShm_Object *)arg;

    MessageQ_Msg msg =

     

    NULL

    ;

     

     

     

    /*

    * While there are messages, get them out and send them to

    * their final destination.

    */

    msg = (MessageQ_Msg)ListMP_getHead((ListMP_Handle)obj->localList);

     

     

    while (msg != NULL

    ) {

     

     

    /* Get the destination message queue Id */

    queueId = MessageQ_getDstQueue(msg);

     

     

     

    /* put the message to the destination queue */

    MessageQ_put(queueId, msg);

    msg = 0xC4A37C4C  <-- this cannot be correct (unitialized pointer?).

     I'm using Syslink 2_00_00_68_beta1, and I see that Syslink 2_00_00_78 is out, but requires IPC, Sysbios, and XDC to all be updated (new EZSDK?).

    Lee Holeva

     

  • Lee,

    There is a known bug in the ListMP module in SysLink 2.00.00.68 beta1.  The bug has to do with having a ListMP list that crosses SharedRegion boundaries (i.e., a ListMP element in one SharedRegion links to a ListMP element in another SharedRegion) and those 2 (or more) SharedRegions have different cache attributes (one is cached on the ARM and the other is not cached on the ARM).  I see that your application uses perhaps 2 or more SharedRegion heaps (indicated by REGIONID0 and HEAPID) so you might be hitting this problem.  The result would be an SRPtr (SharedRegion pointer) that is dereferenced as a normal pointer, and your bad msg value above (0xc4a37c4c) could well be an SRPtr.

    If you can't upgrade to SysLink 2.00.00.78 outright, would you be able to take the ListMP.c file from SysLink 2.00.00.78 and rebuild your syslink.ko?  Since the problem is in the kernel driver, you would need to replace <syslink_install>/packages/ti/syslink/ipc/hlos/knl/ListMP.c only (not the 'usr' one).

    Regards,

    - Rob

  • With the task creation code in main, I added the following code to perform periodic task switches:

    //create a clock to permit other tasks to run
      Clock_Params_init(&clockParams);
      clockParams.period = 4;
      clockParams.startFlag = TRUE;
      Clock_create((Clock_FuncPtr)clockHandler, 4, &clockParams, NULL);

      BIOS_start();

      return (0);
    }

    /*
    Clock Handler
    */
    Void clockHandler(UArg arg)
    {
      Task_yield();
    }

    I verified that the clock runs and Task_yield gets called, yet still tasks 2 and 3 do not start-up, they are never moved to the ready list, but remain blocked.

    Lee Holeva

     

  • Robert Tivy said:
    I see that your application uses perhaps 2 or more SharedRegion heaps (indicated by REGIONID0 and HEAPID) so you might be hitting this problem.  The result would be an SRPtr (SharedRegion pointer) that is dereferenced as a normal pointer, and your bad msg value above (0xc4a37c4c) could well be an SRPtr.

    Maybe.  I currently have REGIONID0 = 0, for messages, REGIONID = 2, for shared images, and HEAPID = 0, also for messages.  The code works the first time, processing an image in task1, but things get corrupted after the creation of task2.

    I suppose that the next version of the EZSDK will have the newer Syslink and everything else required.  When may we expect this?

    Also, what explains why I have to move the task creation code for tasks 2 and 3 to task1 in order to get the tasks to run?  Everything should work fine if I either create the tasks statically or in main, but it doesn't.

    Lee Holeva

     

  • Robert Tivy said:

    If you can't upgrade to SysLink 2.00.00.78 outright, would you be able to take the ListMP.c file from SysLink 2.00.00.78 and rebuild your syslink.ko?  Since the problem is in the kernel driver, you would need to replace <syslink_install>/packages/ti/syslink/ipc/hlos/knl/ListMP.c only (not the 'usr' one).

    I downloaded Syslink 2_00_00_78 and its dependencies, but I run into a problem upon attempting to build the new syslink module.  I get the following error:

    make syslink

    makefile:205: *** LINUXKERNEL is set to "/home/lholeva/ti-ezsdk_dm816x-evm_5_01_01_80/psp/linux-2.6.37-psp04.00.00.10", which is invalid (could not find file "/home/lholeva/ti-ezsdk_dm816x-evm_5_01_01_80/psp/linux-2.6.37-psp04.00.00.10/include/config/kernel.release"). Set this in <SysLink Install>/products.mak. Refer to the SysLink Install Guide for more information.. Stop.

     The kernel path look to be ok, but there is no file kernel.release there, apparently the PSP guys were a bit too cute and changed the kernel code structure..  I'll try the second option of substituting ListMP.c into the code for 2.00.00.68.

    Regardless of what i do I get: "kernel configuration is invalid".

    Lee Holeva

     

  • Robert Tivy said:

    There is a known bug in the ListMP module in SysLink 2.00.00.68 beta1.  The bug has to do with having a ListMP list that crosses SharedRegion boundaries (i.e., a ListMP element in one SharedRegion links to a ListMP element in another SharedRegion) and those 2 (or more) SharedRegions have different cache attributes (one is cached on the ARM and the other is not cached on the ARM).  I see that your application uses perhaps 2 or more SharedRegion heaps (indicated by REGIONID0 and HEAPID) so you might be hitting this problem.  The result would be an SRPtr (SharedRegion pointer) that is dereferenced as a normal pointer, and your bad msg value above (0xc4a37c4c) could well be an SRPtr.

    Ok, I managed to get Syslink 2.00.00.78 built and installed and after rebuilding my app with the task creation in task1, the code now works as it should, both tasks 2 and 3 get created without corruption of the message queues.  This is where I have to create the tasks, at the end of task1:

    /*
       Create the findCorners and calcRo tasks
     */
     //Task_Params taskParams;
     Task_Params_init(&taskParams);
     taskParams.stackSize = 0x2000;
     taskParams.priority = 10;
     taskParams.arg0 = MultiProc_getId("HOST");
     findCornersTH = Task_create((Task_FuncPtr)findCorners_taskFxn, &taskParams, NULL);
     RoTH = Task_create((Task_FuncPtr)calcRo_taskFxn, &taskParams, NULL);

    }

    If I create the tasks in main, tasks 2 and 3 never move from being blocked to ready, that bug remains.  I have an additional problem, in that EZSDK uses ProcMgr to load the M3 firmware for the display driver and this is now failing:

    SysLink version : 2.00.00.78
    SysLink module created on Date:Jul 20 2011 Time:09:39:31
    FIRMWARE: Could not open ProcMgr: -2
    Starting telnet daemon.
    Loading HDVPSS Firmware
    FIRMWARE: Could not open ProcMgr: -2
    VPSS_FVID2: Failed to send version command to M3 0xfffffff9.
    VPSS_CORE : Failed to init fvid2 interface,
    vpss: probe of vpss failed with error -22
    ti81xxfb ti81xxfb: no grpxs
    ti81xxfb: probe of ti81xxfb failed with error -22
    open /dev/fb0: No such file or directory
    cat: write error: No space left on device
    cat: write error: No space left on device
    Starting syslogd/klogd: done
    Starting thttpd.
    ioctl FBIOGET_VSCREENINFO: Inappropriate ioctl for device
    ioctl FBIOGET_VSCREENINFO: Inappropriate ioctl for device
    expr: syntax error
    Linux Frame Buffer Device Configuration Version 2.1 (23/06/1999)

    How do rebuild ProcMgr and where do I put it?  I have located procMgr.c under syslink_2_00_00_78/packages/ti/syslink/procMgr, but the there is no separate makefile, just a makefile.inc.

    Lee Holeva

     

  • Lee Holeva said:
    If I create the tasks in main, tasks 2 and 3 never move from being blocked to ready, that bug remains.

    I would need to see your code to comment further on this problem.  Task creation is core functionality in SysBios, and as such it has been used extensively in testing and in the real world, so I would be surprised if there is a bug in there.  Feel free to send along your project in a separate email to me.

    Lee Holeva said:

    How do rebuild ProcMgr and where do I put it?  I have located procMgr.c under syslink_2_00_00_78/packages/ti/syslink/procMgr, but the there is no separate makefile, just a makefile.inc.

    ProcMgr is part of the core SysLink.  Linux usr-level ProcMgr APIs are contained in the syslink.a Linux library, and those APIs call down to the kernel ProcMgr component which is built-in to the syslink.ko module.  So, you don't do anything to build ProcMgr individually - it gets built as part of the top-level SysLink build.

    As usual, the usr/kernel interface is achieved by way of a Linux device driver, and the syslink.ko module creates this device driver.  Each SysLink component has a minor device created under control of this device driver (e.g., /dev/syslinkipc_FrameQ, /dev/syslinkipc_MessageQ, etc.).  The ProcMgr usr APIs will open /dev/syslinkipc_ProcMgr for this, and I suspect that your EZSDK error has to do with not being able to open that minor device.  Please check your /dev/syslinkipc_* entries to see if they exist.

    Older versions of SysLink 2.x would create a different layout of the /dev/syslink_* entries than the one created in 2.00.00.78, so perhaps there's a mismatch there.  At one point there was a problem with run-time creation of the /dev entries and manual creation was necessary after the 'insmod syslink.ko' in loadmodules.sh, using the mknod command, but they should be automatically created in 2.00.00.78 during 'insmod syslink.ko'.

    Regards,

    - Rob

  • Robert Tivy said:

    As usual, the usr/kernel interface is achieved by way of a Linux device driver, and the syslink.ko module creates this device driver.  Each SysLink component has a minor device created under control of this device driver (e.g., /dev/syslinkipc_FrameQ, /dev/syslinkipc_MessageQ, etc.).  The ProcMgr usr APIs will open /dev/syslinkipc_ProcMgr for this, and I suspect that your EZSDK error has to do with not being able to open that minor device.  Please check your /dev/syslinkipc_* entries to see if they exist.

    The syslinkipc_* minor functions are all there.  make install placed syslink.ko and the samples onto the target, but not these.  To install the new syslink I simply did make install followed by rebooting the EVM.

    root@dm816x-evm:/dev# ls -l syslink*
    crw-rw----    1 root     root     253,  14 Jun  1 15:06 syslinkipc_ClientNotifyM
    gr
    crw-rw----    1 root     root     253,  16 Jun  1 15:06 syslinkipc_FrameQ
    crw-rw----    1 root     root     253,  15 Jun  1 15:06 syslinkipc_FrameQBufMgr
    crw-rw----    1 root     root     253,   8 Jun  1 15:06 syslinkipc_GateMP
    crw-rw----    1 root     root     253,   4 Jun  1 15:06 syslinkipc_HeapBufMP
    crw-rw----    1 root     root     253,   5 Jun  1 15:06 syslinkipc_HeapMemMP
    crw-rw----    1 root     root     253,  11 Jun  1 15:06 syslinkipc_Ipc
    crw-rw----    1 root     root     253,   7 Jun  1 15:06 syslinkipc_ListMP
    crw-rw----    1 root     root     253,   9 Jun  1 15:06 syslinkipc_MessageQ
    crw-rw----    1 root     root     253,  10 Jun  1 15:06 syslinkipc_MultiProc
    crw-rw----    1 root     root     253,   2 Jun  1 15:06 syslinkipc_NameServer
    crw-rw----    1 root     root     253,   1 Jun  1 15:06 syslinkipc_Notify
    crw-rw----    1 root     root     253,  12 Jun  1 15:06 syslinkipc_Osal
    crw-rw----    1 root     root     253,   0 Jun  1 15:06 syslinkipc_ProcMgr
    crw-rw----    1 root     root     253,  17 Jun  1 15:06 syslinkipc_RingIO
    crw-rw----    1 root     root     253,  35 Jun  1 15:06 syslinkipc_RingIOShm
    crw-rw----    1 root     root     253,   3 Jun  1 15:06 syslinkipc_SharedRegion
    crw-rw----    1 root     root     253,  13 Jun  1 15:06 syslinkipc_SyslinkMemMgr

     Update:

    I did rmmod syslink,and rm syslinkipc*, followed by insmod syslink.ko and the syslinkipc* files reappeared.  It's odd though that the file date remains June 1.  I still get the failure on EVM boot:

    SysLink version : 2.00.00.78
    SysLink module created on Date:Jul 20 2011 Time:09:39:31
    FIRMWARE: Could not open ProcMgr: -2
    Starting telnet daemon.
    Loading HDVPSS Firmware
    FIRMWARE: Could not open ProcMgr: -2
    VPSS_FVID2: Failed to send version command to M3 0xfffffff9.
    VPSS_CORE : Failed to init fvid2 interface,
    vpss: probe of vpss failed with error -22
    ti81xxfb ti81xxfb: no grpxs
    ti81xxfb: probe of ti81xxfb failed with error -22
    open /dev/fb0: No such file or directory
    cat: write error: No space left on device
    cat: write error: No space left on device
    Starting syslogd/klogd: done
    Starting thttpd.
    ioctl FBIOGET_VSCREENINFO: Inappropriate ioctl for device
    ioctl FBIOGET_VSCREENINFO: Inappropriate ioctl for device
    expr: syntax error
    Linux Frame Buffer Device Configuration Version 2.1 (23/06/1999)
    (C) Copyright 1995-1999 by Geert Uytterhoeven

     

    Lee Holeva

     

  • That all seems normal.

    Is it possible that you're running this stuff as a non-root user?  That would explain both the ProcMgr failure and the failure to open /dev/fb0, since the /dev entries don't have "others" permissions.

    Regards,

    - Rob

  • Robert Tivy said:

    Is it possible that you're running this stuff as a non-root user?  That would explain both the ProcMgr failure and the failure to open /dev/fb0, since the /dev entries don't have "others" permissions.

    I tried doing: chmod 666 * in /dev followed by:

    insmod omaplfb.ko

    omaplfb: OMAPLFB_Init: OMAPLFBInit failed
    insmod: error inserting 'omaplfb.ko': -1 No such device

    I can find no documentation on omaplfb.

    Lee Holeva

     

  • Lee Holeva said:

    omaplfb: OMAPLFB_Init: OMAPLFBInit failed
    insmod: error inserting 'omaplfb.ko': -1 No such device

    I can find no documentation on omaplfb.

    I have never heard of OMAPLFB, so I can't help with that issue.

    Regards,

    - Rob

  • Lee,

    I want to make sure that you get your issues resolved in the quickest way possible.  I'm wondering if you should call this thread "answered" and post a new one on the OMAP forum wrt OMAPFLB?

  • David Friedland said:

    I want to make sure that you get your issues resolved in the quickest way possible.  I'm wondering if you should call this thread "answered" and post a new one on the OMAP forum wrt OMAPFLB?

    Ok, though the real solution is to upgrade to PSP 4.00.00.12, which isn't yet released.

    Lee Holeva