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() failure for McASP multislot 1 serializer

Other Parts Discussed in Thread: OMAPL138

Bios:  biospsp_01_30_01

Hardware: OMAPL138 Evm “Experimenter” board

CCS: 4.2.5

I have taken the bios example code for initialization of McASP as a master (transmit) and slowly tweaked the channel parameters towards what I will need on our own custom hardware.

I am testing the bios calls on the evm to verify that I am using them properly.

The sample code assumes 1 serializer, 32 bit words, TDM mode, 1 slot, buffer format Mcasp_BufferFormat_1SER_1SLOT

Ours will be 1 serializer, 16 bit data, TDM, 6 slots.

When I change number of data bits from 32 to 16, the SIO_create() of the tx stream for the McASP properly returns a handle.

When I change the 1 slot to 6 slots, it properly returns a handle (though the fact that I have change it to 6 slots but the buffer format is still “1SER_1SLOT” makes me wonder why it does not complain).

When I change the buffer format to Mcasp_BufferFormat_1SER_MULTISLOT_INTERLEAVED or Mcasp_BufferFormat_1SER_MULTISLOT_NON_INTERLEAVED, SIO_create() returns a NULL indicating it could not create the stream.

[My heap is 1Mbyte BTW - plenty big enough.]

My question:  why?   Is there some other change to the channel parameters I need to make for the SIO_create() to work properly?  There must be some simple other tweak I need to do that I’m missing because I’m new to the TI BIOS stuff.

Here is the configuration of my channel parameters for the failure mode:

Mcasp_HwSetupData mcaspXmtSetup =

{

    /* .xmask    = */ 0x0000FFFF,  /* 16 Data bits are used               */

    /* .xfmt     = */ 0x000080F0,  /* 1 bit dly,MSB first,16 bit,Rotate   */

    /* .afsxctl  = */ 0x00000002,  /* internally generated fsync          */

    /* .xtdm     = */ 0x0000003F,  /* 6 slots active                      */

    /* .xintctl  = */ 0x00000003,  /* underrun and sync error active      */

    /* .xstat    = */ 0x000001FF,  /* reset any existing status bits      */

    /* .xevtctl  = */ 0x00000000,  /* DMA mode                            */

    {

        /* .aclkxctl  = */ 0x00000020,  /* div = 1, clk = internal       */

        /* .ahclkxctl = */ 0x00008004,  /* div by 16                     */

        /* .xclkchk   = */ 0x00000000

    }

};

 

 

 

Mcasp_ChanParams  mcasp_tx_chanparam_sample =

{

    0x0001,                                         /* number of serializers                */

    {Mcasp_SerializerNum_15,},                      /* Uint32 indexOfSersRequested[16u];    */

    (Mcasp_HwSetupData *)&mcaspXmtSetup,            /* pointer to output buffer             */

    FALSE,                                          /* DMA flag                             */

    Mcasp_OpMode_TDM,                               /* TDM mode                             */

    Mcasp_WordLength_16,                            /* word width                           */

    NULL,                                           /* Ptr userLoopJobBuffer;               */

    0,                                              /* Uint16 userLoopJobLength;            */

    NULL,                                           /* Ptr                  edmaHandle;     */

    NULL,                                           /* Mcasp_GblCallback    gblCbk;         */

    1,                                              /* Uint32               noOfChannels;   */

    Mcasp_BufferFormat_1SER_MULTISLOT_INTERLEAVED,  /* Mcasp_BufferFormat   dataFormat;     */

    TRUE,                                           /* Bool                 enableHwFifo;   */

    TRUE                                            /* Bool                 isDataPacked;   */

};

 

  • I resolve this myself.

    For completeness this is the resolution.

    First of all, the line of code...

       /* .xfmt     = */ 0x000080F0,  /* 1 bit dly,MSB first,16 bit,Rotate   */

    ...lifted from the bios sample code is actually a lie.   The comment says "16 bit".   The 0xF from bits 3-7 means "32 bits".

    I changed it to 0x7, meaning 16-bit.

    The line...

        /* .afsxctl  = */ 0x00000002,  /* internally generated fsync          */


    ...is an incomplete description.   It should properly add "default 1 slot per frame".

    Changing .afsxctl to 0x00000802 specifies a frame of 16 slot (which, oh by the way, was another detail of our framing I didn't mention).

    With these changes, voilà, SIO_create() is happy.

    Reminder to self - "never trust comments in sample/example code" - coupled with "spend more time reading the documentation".

  • Glad to see this was resolved.