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.

McBsp PSP driver CLK edge bug

I am trying to configure the McBSP using PSP drivers 1.30.01 on a C6748 processor. This is the bug I am seeing.

If I configure the clock polarity to Mcbsp_ClkPol_RISING_EDGE to capture data on the rising edge, it sets bit 0 of the PCR register to 0, which according to spra491A is capturing data on the falling edge.

Conversely, if I condifugre it for Mcbsp_ClkPol_FALLING_EDGE, it sets bit 0 of the PCR register to 1, which is to capture data on the rising edge.

  • Hi Jeremiah Ferguson,

    First of all, yes this is the bug in the McBSP driver while configuring to receive data (it is fine with the transmit). This can be eliminated in two ways,

    1. you can use the IOCTL "Mcbsp_IOCTL_SET_BCLK_POL" with appropriate argument ie either "Mcbsp_ClkPol_FALLING_EDGE" or "Mcbsp_ClkPol_RISING_EDGE".

    2. In the function Mcbsp_localConfigureRcvChannel() in the file Mcbsp.c,

        replace,

        if (Mcbsp_ClkPol_RISING_EDGE == params->clkSetup->clkPolarity)
        {
            /* clock data sampled on rising edge                                  */
            instHandle->hwInfo.regs->PCR &= (~CSL_MCBSP_PCR_CLKRP_MASK);
        }
        else
        {
            /* clock data sampled on falling edge                                 */
            instHandle->hwInfo.regs->PCR |= (CSL_MCBSP_PCR_CLKRP_MASK);
        }

        with

        if (Mcbsp_ClkPol_RISING_EDGE == params->clkSetup->clkPolarity)
        {
            /* clock data sampled on rising edge                                  */
            instHandle->hwInfo.regs->PCR I= CSL_MCBSP_PCR_CLKRP_MASK;
        }
        else
        {
            /* clock data sampled on falling edge                                 */
            instHandle->hwInfo.regs->PCR &= (~CSL_MCBSP_PCR_CLKRP_MASK);
        }
     

        The driver needs to be compiled after this modification.

    Please let me know the result, so that i can raise an IR (defect management) and can be fixed in the future release.

    Thanks and Regards,

    Sandeep K 

  • I will implement this change early next week, as I have another bug in the McBSP driver that also needs to be tested at the same time. Re: McBSP PSP driver does not set DX Enable mode

    I will let you know early next week what the results are.

  • Did you get a chance to test the McBSP with the suggested changes?

    Regards,

    Sandeep K

  • Once I modified the correct function (for some reason I modified transmit the first time), it worked like a champ.

  • Jeremiah,

    Thanks for the update!!

    An IR - SDOCM00081073 has been raised to track this bug and can be fixed in the future release. 

    Thanks and Regards,

    Sandeep K