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.

关于C600 SPI接口发送数据相关问题



您好!


       我需要实现的功能是C6000系列的DSP的SPI接口,发送数据,参照例程,仅仅注册一个任务task,代码如下:

void spi_test(UArg arg0, UArg arg1)
{
SPI_Params spiParams;
SPI_Handle handle;
SPI_Transaction transaction; /* SPI transaction */
bool retVal = false; /* return value */

/* Init SPI driver */
SPI_init();

/* Open the Board flash NOR device with the test SPI port
and use the default SPI configurations */
SPI_Params_init(&spiParams);
spiParams.frameFormat = SPI_POL0_PHA1;
handle = SPI_open(0, &spiParams);

/* Initiate transfer */
txBuf[0] = 0xAAU;
transferLength = 1U;
transaction.status=-1; /* Setting an initial value to be replaced with a proper return status */
transaction.count = transferLength;
transaction.txBuf = &txBuf[0];
transaction.rxBuf = &rxBuf[0];

retVal = SPI_transfer(handle, &transaction);

SPI_close(handle);

while(1)
;
}

      代码编译没有问题,但是运行时候总是卡在了retVal = SPI_transfer(handle, &transaction);这个函数这。

      请问上述是什么问题呢?

       期待您的指导!谢谢了!

祝好!

  • 您好,

    1. 请说明一下参考的例程的出处
    2. 您是在EVM板上做测试,用例程没有出现问题,改成您的新工程就出现了跑飞的问题吗?  如果是,请描述一下您修改的地方,我们对比分析一下。 
               谢谢!