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.

TMDSEVM437X: McSPI loopback example issue

Part Number: TMDSEVM437X
Other Parts Discussed in Thread: OMAPL138

I have a evmAM437x with pdk_am437x_1_0_15.  I built the example projects and found that MCSPI_Loopback_evmAM437x_armExampleProject fails to run properly.  I isolated the issue to SPI_open() on line 308 of mcspiLoopbackApp.c.  The only error message in CCS (ver. 9.1) is "CortexA9: Unhandled ADP_Stopped exception 0x810252B8".  The UART output is

  McSPI Internal Loopback test app started                                        
  The Mode of transfer is Interrupt Mode  

I tried this example since my custom application has a similar problem getting SPI_open() to work.  Is this a known issue?  If so, is there a work around?  My limited debugging indicated that  PRCMModuleEnable(CHIPDB_MOD_ID_MCASP, 1U, 0U); (line 218 of evmAM437x.c) is failing, causing the SPI module clock to not be enabled.  Or maybe it is just Operator error ...?

Thanks,

KTM

  • Hi KTM,

    Your observation is correct. MCSPI_Loopback_evmAM437x_armExampleProject is NOT working on evmAM437x. It hang in SPI_open() function.

    What I was able to find is below statement is McSPI RTOS user guide:

    spiLoopback example - Currently this example is supported on OMAPL138/C6748 platforms.


    Let me check with the RTOS McSPI experts about the status of this example and will come back to you.

    Regards,
    Pavel

  • Pavel,

    Thanks for looking into this matter.

    Section 6.8.5 of the SDK (06_00_00_07) lists a SPI loopback example supporting the AM437x.  I was unable to find a reference to a MCSPI loopback example in the SDK document.  Also, keep in mind that the project files for the example I'm trying to get working were generated via TI make files, which leads me to believe that the example supports the AM437x.

    Regards,

    KTM

  • KTM,

    I have just enabled McSPI0 module clock explicitly, and the example seems to be working fine for McSPI0 (MCSPI_INSTANCE = 0). I have modified below file:

    pdk_am437x_1_0_15/packages/ti/drv/spi/example/mcspiLoopbackApp/src/mcspiLoopbackApp.c

    void padConfig_prcmEnable()
    {

    ......

    #if defined(SOC_AM335x) || defined(SOC_AM437x)
        uint32_t ctrlModBase;

        /* UART */
        ctrlModBase = CHIPDBBaseAddress(CHIPDB_MOD_ID_CONTROL_MODULE, UART_INSTANCE);
        HW_WR_REG32(ctrlModBase+PIN_UART0_TXD, PIN_MODE(0));
        HW_WR_REG32(ctrlModBase+PIN_UART0_RXD, PIN_MODE(0) | PIN_RX_ACTIVE);
        /* SPI0 */
        ctrlModBase = CHIPDBBaseAddress(CHIPDB_MOD_ID_CONTROL_MODULE, MCSPI_INSTANCE);
        HW_WR_REG32(ctrlModBase+PIN_SPI0_SCLK, PIN_MODE(0) | PIN_RX_ACTIVE);
        HW_WR_REG32(ctrlModBase+PIN_SPI0_D0, PIN_MODE(0) | PIN_RX_ACTIVE);
        HW_WR_REG32(ctrlModBase+PIN_SPI0_D1, PIN_MODE(0) | PIN_RX_ACTIVE);
        HW_WR_REG32(ctrlModBase+PIN_SPI0_CS0, PIN_MODE(0) | PIN_RX_ACTIVE);

    /*MCSPI0 prcm*/
    //CM_PER 0x44DF8800
    //PRCM_CM_PER_SPI0_CLKCTRL 0x500
        HW_WR_REG32(0x44DF8800 + 0x500, 0x02);
        while (HW_RD_REG32(0x44DF8800 + 0x500) !=
                0x02U)
            {
                ;
            }

    #endif
    }


    Then I generate new out file (MCSPI_Loopback_evmAM437x_armExampleProject.out) load and run this file. I have below UART Console messages:

    McSPI Internal Loopback test app started
    The Mode of transfer is Interrupt Mode
    McSPI Data Transmission is successful

     

    I will report this to the RTOS team, as we need this example to be fixed for the next RTOS version.

     

    Regards,
    Pavel

  • Pavel,

    My UART messages now match yours.  Thanks for the quick fix!

    KTM