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.

SIO_create input stream fails

Other Parts Discussed in Thread: OMAP-L137

Hi everybody.

On the OMAP-L137 EVM, I want to use McASP0 in receive mode. All clocks are generated externally. External signals look okay. I'm using PSP drivers v1.20. When I run the program, I get the message: "SIO: create input stream FAILED". Why does this fail? On what does successful creation depend? How can I solve this problem?

I use SPI1 in Master/transmit mode in the same program (works successfully). But could it be that McASP0 doesn't work because:
spiParams.hwiNumber = 8;
and
mcasp0_params.hwiNumber = 8;
??

If yes, what should I put instead?

Could somebody help me please? Thank you very much.

Andreas

 

Here is what I've done:

 

#define NUM_BUFS  (8)

#define BUFALIGN  (128)  /* optimal alignment of buffer for L2 cache          */

#define BUFLEN     (256)
#define BUFSIZE   (BUFLEN * sizeof(Ptr))

#define RX_NUM_SERIALIZER    (16u)

 

/* input buffer pointers */
Ptr rxBuffers[NUM_BUFS];


/* inStream is created in main */
static SIO_Handle inStream;

/*
 * Mcasp device params. To be filled in userMcaspInit function which
 * is called before driver creation
 */
Mcasp_Params mcasp0_params;

 

/* The McASP configuration required for the wanted burst mode                                */
Mcasp_HwSetupData mcasp0RcvSetup = {
        /* .rmask    = */ 0xFFFFFFFF, /* All the data bits are to be used     */
        /* .rfmt     = */ 0x000000F0, /*
        /* .afsrctl  = */ 0x00000000, /* burst mode,
                                       * Frame sync is one bit
                                       * Rising edge is start of frame
                                       * externally generated frame sync
                                       */
        /* .rtdm     = */ 0x00000001, /* slot 1 is active (DSP)               */
        /* .rintctl  = */ 0x00000007, /* sync error,overrun error,clK error   */
        /* .rstat    = */ 0x000001FF, /* reset any existing status bits       */
        /* .revtctl  = */ 0x00000000, /* DMA request is enabled or disabled   */
        {
             /* .aclkrctl  = */ 0x00000000,  /* ext.clock,falling edge,no div */
             /* .ahclkrctl = */ 0x00000000,  /* ext.high clock,no div    */
             /* .rclkchk   = */ 0x00000000
        },

};

 

Mcasp_ChanParams  mcasp0_chanparam =
{
    0x0016,                   /* number of serializers requested  */
    {Mcasp_SerializerNum_0,
     Mcasp_SerializerNum_1,
     Mcasp_SerializerNum_2,
     Mcasp_SerializerNum_3,
     Mcasp_SerializerNum_4,
     Mcasp_SerializerNum_5,
     Mcasp_SerializerNum_6,
     Mcasp_SerializerNum_7,
     Mcasp_SerializerNum_8,
     Mcasp_SerializerNum_9,
     Mcasp_SerializerNum_10,
     Mcasp_SerializerNum_11,
     Mcasp_SerializerNum_12,
     Mcasp_SerializerNum_13,
     Mcasp_SerializerNum_14,
     Mcasp_SerializerNum_15,
    },
    &mcasp0RcvSetup,          /* HW setup                 */
    TRUE,                     /* DMA                      */
    Mcasp_OpMode_TDM,          /* channel mode             */
    Mcasp_WordLength_16,      /* output buf size          */
    NULL,                     /* pointer to output buffer */
    0,
    NULL,
    NULL,
    1,                          /* number of channels       */
    Mcasp_BufferFormat_MULTISER_1SLOT_SER_NON_INTERLEAVED,
    TRUE,
    TRUE
};


/* mcasp2 module LPSC number      */
#define PSC_MCASP0_LPSC 7

 

void userMcaspInit()
{
    /* power on the Mcasp 1 instance in the PSC  */
    Psc_ModuleClkCtrl(Psc_DevId_1, PSC_MCASP0_LPSC, TRUE);

    Mcasp_init();
    mcasp0_params = Mcasp_PARAMS;
    mcasp0_params.hwiNumber = 8;
    mcasp0_params.isDataBufferPayloadStructure = FALSE;
   
    // additional settings for external clock?!?
    mcasp0_params.mcaspHwSetup.glb.pfunc = 0x0;
    mcasp0_params.mcaspHwSetup.glb.pdir  = 0x0;
}

 

Void createStreams()
{
    SIO_Attrs sioAttrs;

    sioAttrs       = SIO_ATTRS;
    sioAttrs.nbufs = NUM_BUFS;
    sioAttrs.align = BUFALIGN;
    sioAttrs.model = SIO_ISSUERECLAIM;

    mcasp0_chanparam.edmaHandle = hEdma;

    inStream = SIO_create("/dioMcaspIN", SIO_INPUT, BUFSIZE, &sioAttrs);

    if (inStream == NULL)
    {
        LOG_printf(&trace,"\r\nSIO: create input stream FAILED.\n");
        return;
    }
}

 

Related DSP/BIOS configuration:

dioMcaspIN: device name = Mcasp0
dioMcaspIN: channel parameters = _mcasp0_chanparam

Mcasp0: init function = _userMcaspInit
Mcasp0: device id = 0x00000000
Mcasp0: device params _mcasp0_params

 

 

  • Stupid mistake: I've changed

    0x0016,                   /* number of serializers requested  */
    to
    16u,                   /* number of serializers requested  */


    But now my program hangs in the SIO_create function. What's the problem? The assembler code where it hangs looks like TSK_sleep. I've noticed earlier in my code that when I've manually put one or more TSK_sleep, it also hangs... Did I forgot something in the DSP/BIOS conf or some system conf stuff?

    Could someone please help me? I'm really stuck... Thank you so much.

     

    Andreas

  • In the DSP/BIOS application configuration (*.tcf), what platform are you using?  OMAPL137 platform?  This configuration file is setup assuming that the ARM will be starting the timer. Since the TSK_sleep() function is time based, I assume its not returning.  If you are trying this application without the ARM setting up the timers correctly,  you can add the following line to your configuration file:

    /*
     *  When using the ARM with DSP, the ARM will share Timer 1 with the DSP.
     *  The ARM needs to enable power to Timer 1, program the timer for "32-bit unchained" mode
     *  and take it out of reset.  The BIOS CLK should be driven with Timer 1 and not reset
     *  the timer.
     *
     *  In most production ARM+DSP systems we recommend removing these 2
     *  lines and sharing Timer1 with the Arm.  This will free up Timer0 for use by the
     *  application.
     *
     *  The workaround below is used to make the DSP-side applications work "out of the box"
     *  without any need for coordination with the ARM OS.
     */

    bios.CLK.TIMERSELECT = "Timer 0";      /* Select Timer 0 to drive BIOS CLK */
    bios.CLK.RESETTIMER = true;          /* Take the selected timer our of reset */

     

    This code was taken from the evmOMAPL137_common.tci  file in the DSP/BIOS examples directory for your version of DSP/BIOS.

    Other option is to use the evm6747 platform for your DSP/BIOS configuration.  This platform assumes the same DSP device core but without the ARM thus enabling the above by default.


     

     

  • Okay. Don't have to solve the original problem anymore.

    But still, the TSK_sleep problem remains and it's not solved by adding TIMERSELECT and RESETTIMER. You guessed right, I have OMAP-L137 EVM, but only use the C6747. I'll try switching to the evm6747 platform in DSP/BIOS as soon as possible and see what I'll get. Thank you for your answer.

    Andreas

     

  • Okay, all this did not solve my problem. But I've found the problem (and it was quite "stupid" again): the stack size of the task was too small. After adjusting the stack size, TSK_sleep works well.:)

    Thanks for all your help.

    Andreas