AnsweredAssumed Answered

k64 spi2+dma 做从机和stm32通信,调用DSPI_MasterTransferEDMA(EXAMPLE_DSPI_MASTER_BASEADDR, &g_dspi_edma_m_handle, &masterXfer)后返回值不是kStatus_Success,是kDSPI_Busy,一直打印There is error when start DSPI_SlaveTransferEDMA,代码如下stm32这边程序是没问题的,此程序是按照库里面demo修改的,求解,谢谢,

Question asked by sheng zhang on Dec 28, 2017
Latest reply on Jan 3, 2018 by Hui_Ma

void SPI2_Slave_Transfer(uint8_t *txdata,uint8_t *rxdata,uint8_t size)
{
dspi_transfer_t slaveXfer;

isTransferCompleted = false;

/* Set slave transfer ready to receive/send data */
slaveXfer.txData = txdata;
slaveXfer.rxData = rxdata;
slaveXfer.dataSize = size;
slaveXfer.configFlags = kDSPI_SlaveCtar0;


#if 1
/* Set up slave,DMA mode*/
if (kStatus_Success != DSPI_SlaveTransferEDMA(EXAMPLE_DSPI_SLAVE_BASEADDR, &g_dspi_edma_s_handle, &slaveXfer))
{
PRINTF("There is error when start DSPI_SlaveTransferEDMA \r\n");
}
#endif

}

Outcomes