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.

DM648 PSP SPI sample program failed at GIO_create() ?

On own development board, I used the PSP SPI driver sample program located at “pspdrivers_1_10_01\packages\ti\sdo\pspdrivers\system\dm648\bios\evmDM648\spi”, and the GIO_create() function always returned with zero, which means creation failure. I checked the SPI peripheral registers in CCS, and I found that SPIGCR0 and SPIGCR1 are both zero before calling GIO_create() and after calling GIO_create(). The sample program is completely unmodified.

Technically even there is some hardware problem in the SPI connection, it should not cause GIO_create() to fail. Now I have no idea what to do to find the problem.

  • Hi

    When the GIO_create API returns the channel handle as NULL,the channel create call has failed. To know the
    exact reason for the failure we need to know the status returned by the driver.
     
    The GIO_create API is shown as below
    gioChan = GIO_create(name, mode, *status, chanParams, *attrs);
     
    The third parameter status is updated with the status returned by the driver/BIOS.
     
    The existing sample application can be modified as shown
     
        Int                 devStatus;
        GIO_Attrs           gioAttrs = GIO_ATTRS;
        Int                 status   = 0;
     
        /* create SPI channel for transmission */
        spiHandle0 =  GIO_create("/SPI0",IOM_INOUT,&status,NULL,&gioAttrs);
     
    The status variable is updated with the error code which will help in understanding the exact reason for the
    failure of the GIO_create call.
    Regards
    Vichu
  • I modified the code and got the returned status of '-10', which means PSP_E_INVALID_CMD according to psp_common.h

    So what should I do to solve this problem. What is invalid command?

  • I found the problem. I changed the constant PSP_SPI_MODULE_CLK_FREQ to match the actual system frequency. I thought this value would be evaluated in MHz, however it is given out in Hertz. A very small value of PSP_SPI_MODULE_CLK_FREQ caused the failure of GIO_create().

    Thank you very much!

  • Hi,

        When I am tried Same Thing I am Getting "speech_encdec started."After That It Not showing Any Output.

         Can you tell me why thi is happening...

    Regards,

    Aditya