1 Reply Latest reply on Jul 18, 2016 2:28 AM by rash

    I use the FX3 contact to a spi chip,i use the spi with the DMA mode.

    wang.xinlong

      I use the FX3 contact to a spi chip,i use the spi with the DMA mode,the external chip need that the MOSI PIN of FX3 must be high level,but when i init the spi interface of the FX3,this pin is low level in the idel state.then i use the spi with the DMA mode to transfer and receive at the same time ,and when read data from the external chip ,i transfer oxff.but when i set to transfer and receive only one word,the CyU3PDmaChannelWaitForCompletion return is eeror(CY_U3P_ERROR_NOT_STARTED) ,

         

           status = CyU3PDmaChannelSetupRecvBuffer (&glSpiRxHandle, &buf_p);

         

           CyU3PDmaChannelSetupSendBuffer (&glSpiTxHandle,&s_buf);
           CyU3PSpiSetBlockXfer (1, 1);

         

           status = CyU3PDmaChannelWaitForCompletion (&glSpiRxHandle,
                   CY_FX_USB_SPI_TIMEOUT);
           if (status == CY_U3P_ERROR_NOT_STARTED)
           {
               //CyU3PGpioSetValue(34,CyFalse);
           }
           status = CyU3PDmaChannelWaitForCompletion(&glSpiTxHandle,
                   CY_FX_USB_SPI_TIMEOUT);
           if (status != CY_U3P_SUCCESS)
           {
               CyU3PGpioSetValue(37,CyFalse);
           }
           CyU3PSpiDisableBlockXfer (CyTrue, CyTrue);

         

      can you tell me what is the problem?

         

      thanks very much.