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.

CHNL_reclaim and SIO_reclaim HANGS

Other Parts Discussed in Thread: DM3730, OMAP3530, OMAPL138

HI,

I'm trying to setup DSPLINK on GHS Integrity OS.

I moved all the code and I'm tryng to test it with the LOOP example.

I'm using:

  • CCS Version: 5.5.0.00077
  • C6000 Code Generation Tools: v6.1.23
  • DSPLINK: 1.65.02.09
  • DSP/BIOS: 5.42.01.09

DSP executable loads successfully and also the handshake but, at first attempt to transfer data , when the execution reaches:

  • CHNL_reclaim on GPP side
  • SIO_recalim on DSP side

both hang and i cant' go on.

Here's the code involved on GPP side:

LOOP_Execute (IN Uint32 numIterations, Uint8 processorId)
{
    DSP_STATUS status = DSP_SOK ;
    Uint32     i ;

    LOOP_0Print ("Entered LOOP_Execute ()\n") ;

    /*
     *  Start execution on DSP.
     */
    status = PROC_start (processorId) ;

    /*
     *  Fill the IO Request structure
     *  It gives Information for adding or reclaiming an input request.
     */
    if (DSP_SUCCEEDED (status)) {
        LOOP_IOReq.buffer = LOOP_Buffers [0] ;
        LOOP_IOReq.size   = LOOP_BufferSize   ;
    }
    else {
        LOOP_1Print ("PROC_start failed. Status = [0x%x]\n", status) ;
    }
    // LOOP_0Print ("Hit Enter to continue...\n");
    //getchar();
    
    for (i = 1 ;
         (   (LOOP_NumIterations == 0) || (i <= LOOP_NumIterations))
          && (DSP_SUCCEEDED (status)) ;
         i++) {
        /*
         *  Send data to DSP.
         *  Issue 'filled' buffer to the channel.
         */
        status = CHNL_issue (processorId, CHNL_ID_OUTPUT, &LOOP_IOReq) ;
        if (DSP_FAILED (status)) {
            LOOP_1Print ("CHNL_issue failed (output). Status = [0x%x]\n",
                          status) ;
        }

        /*
         *  Reclaim 'empty' buffer from the channel
         */
        if (DSP_SUCCEEDED (status)) {
            status = CHNL_reclaim (processorId,
                                   CHNL_ID_OUTPUT,
								   WAIT_FOREVER,
                                   &LOOP_IOReq) ;
            if (DSP_FAILED (status)) {
                LOOP_1Print ("CHNL_reclaim failed (output). Status = [0x%x]\n",
                             status) ;
            }
        }

        /*
         *  Receive data from DSP
         *  Issue 'empty' buffer to the channel.
         */
        if (DSP_SUCCEEDED (status)) {
            status = CHNL_issue (processorId, CHNL_ID_INPUT, &LOOP_IOReq) ;
            if (DSP_FAILED (status)) {
                LOOP_1Print ("CHNL_issue failed (input). Status = [0x%x]\n",
                             status) ;
            }
        }

        /*
         *  Reclaim 'filled' buffer from the channel
         */
        if (DSP_SUCCEEDED (status)) {
            status = CHNL_reclaim (processorId,
                                   CHNL_ID_INPUT,
								   WAIT_FOREVER,
                                   &LOOP_IOReq) ;
            if (DSP_FAILED (status)) {
                LOOP_1Print ("CHNL_reclaim failed (input). Status = [0x%x]\n",
                             status) ;
            }
        }

#if defined (VERIFY_DATA)
        /*
         *  Verify correctness of data received.
         */
        if (DSP_SUCCEEDED (status)) {
            status = LOOP_VerifyData (LOOP_IOReq.buffer) ;
            if (DSP_FAILED (status)) {
                LOOP_0Print ("Data integrity failed\n") ;
            }
        }
#endif

        if (DSP_SUCCEEDED (status) && (i % 1000) == 0) {
            LOOP_1Print ("Transferred %ld buffers\n", i) ;
        }
    }

    LOOP_0Print ("Leaving LOOP_Execute ()\n") ;

    return status ;
}

AND on DSP side:

Int TSKLOOP_execute(TSKLOOP_TransferInfo * info)
{
    Int         status  = SYS_OK ;
    Char *      buffer  = info->buffers [0] ;
    Arg         arg     = 0 ;
    Uint32      i ;
    Int         nmadus ;

    /* Execute the loop for configured number of transfers
     * A value of 0 in numTransfers implies infinite iterations
     */
    for (i = 0 ;
         (   ((info->numTransfers == 0) || (i < info->numTransfers))
          && (status == SYS_OK)) ;
         i++) {
        /* Receive a data buffer from GPP */
        status = SIO_issue(info->inputStream,
                           buffer,
                           info->bufferSize,
                           arg) ;
        if (status == SYS_OK) {
            nmadus = SIO_reclaim (info->inputStream,
                                  (Ptr *) &buffer,
                                  &arg) ;
            if (nmadus < 0) {
                status = -nmadus ;
                SET_FAILURE_REASON (status) ;
            }
            else {
                info->receivedSize = nmadus ;
            }
        }
        else {
            SET_FAILURE_REASON(status);
        }

        /* Do processing on this buffer */
        if (status == SYS_OK) {
            /* Add code to process the buffer here*/
        }

        /* Send the processed buffer back to GPP */
        if (status == SYS_OK) {
            status = SIO_issue(info->outputStream,
                               buffer,
                               info->receivedSize,
                               arg);

            if (status == SYS_OK) {
                nmadus = SIO_reclaim (info->outputStream,
                                      (Ptr *) &(buffer),
                                      &arg) ;
                if (nmadus < 0) {
                    status = -nmadus ;
                    SET_FAILURE_REASON (status) ;
                }
            }
            else {
                SET_FAILURE_REASON (status) ;
            }
        }
    }
    return status ;
}

I think I'm missing something but I don't know what.
What should I check?

Thanks in advance.

Best Regards,

Giovanni Malfarà

  • Hi Giovanni,

    Are you able to get any trace output?  Can you confirm that the IPC interrupts are working?

    Best regards,

        Janet

  • Hi Janet,

    after a deeper investigation we saw that on GPP side the interrupt seems not to be caught by the kernel.

    On DSP side it seems to be issued, as we reach the code:

    Void
    HAL_intSend (Uint32 intId, Uns arg)
    {
        /* To avoid compiler warning. */
        (void) intId ;
    
        /* Put into the GPP's mailbox to generate the interrupt. */
        REG32(MAILBOX_MESSAGE_0) = arg ;
    }
    

    Is this correct?

    Thank you very much.

    Giovanni

  • Hi Giovanni,

    What platform are you on?  Can you check your MAILBOX_BASE address to make sure it is correct?  If everything on the DSP side looks correct, then maybe there is a problem with the LINKCFG objects on the GPP side.  You can find these in the appropriate platform file under packages/dsplink/config/all.  I'm not sure how or if these would need to be changed under GHS, but something worth checking.

    Best regards,

        Janet

  • Thank you for your response Janet,

    I'm working on a custom development board with a DM3730.

    I checked my MAILBOX_BASE and is defined (both GPP and DSP):

    #define MAILBOX_BASE           0x48094000
    

    also I checked LINKCFG objects.

    This is my LINKCFG_ipsTable_00 []:

    STATIC LINKCFG_Ips  LINKCFG_ipsTable_00 [] =
    {
        {
            "IPS",                 /* NAME           : Name of the Inter-Processor-Signaling component */
            (Uint32) 32,           /* NUMIPSEVENTS   : Number of IPS events to be supported */
            SHAREDENTRYID0,        /* MEMENTRY       : Memory entry ID (-1 if not needed) */
            (Uint32) 26,           /* GPPINTID       : Interrupt no. to used by the IPS on GPP-side. (-1 if uni-directional to DSP) */
            (Uint32) 55,           /* DSPINTID       : Interrupt no. to used by the IPS on DSP-side. (-1 if uni-directional to GPP) */
            (Uint32) 5,            /* DSPINTVECTORID : Interrupt vector no. to used by the IPS on DSP-side. (-1 if uni-directional to GPP) */
            (Uint32) 50000000,     /* ARGUMENT1      : Poll value for which IPS waits while sending event (-1 if infinite) */
            0                      /* ARGUMENT2      : Second IPS-specific argument */
        }
    } ;

    taken from:

    CFG_OMAP3530_SHMEM.c

    Are there differences between OMAP3530 and DM3730 that could give us such problems?

    Thanks a lot.

    Best Regards,

    GIovanni

  • Hi Giovanni,

    Using the CFG_OMAP3530_SHMEM.c for DM3730 should be fine.  Does Green Hills already have a DSPLink port that you could look at?  I wonder if you should contact Green Hills about this issue.

    Best regards,

        Janet

  • Hello Janet,

    Thanks for your support.

    I don't have a DSPLink port to look at. I'll ask to Green Hills for support as you suggested.

    Thank you very much.

    Best Regards,

    Giovanni

  • I am having the same problem on OMAPL138. Is the same function used (HAL_intSend) on this chip? I dont fully understand the mechanism of how the buffers are transferred and don't know what to look for. I also see there is no MAILBOX_BASE defined for the omapl138. Can anyone give some guidance?

    Thanks,

    Dan