Hello,
I currently try communicate with a different processor over mcspi. I'm using the provided bsp mcspi driver through the GIO interface layer and for the implementation I followed the given example. The TDA2px is configured as a spi slave and should run in interrupt mode, since polling seems to block all execution.
My problem is that I cant read any data in interrupt mode while I can read data in polling mode. I'm using the GIO Standard Model but have also tried the GIO Issue Reclaim Model this does not seem to make a difference. When I'm using a timeout the GIO_read function will fail with a timeout error, otherwise the function does not seem to return.
While debugging I noticed the function mcspiSlaveTransferStart() is only started if there is a transmission already scheduled.
if ((MCSPI_COMMMODE_SLAVE == instHandle->spiHWconfig.masterOrSlave) && (instHandle->opMode == MCSPI_OPMODE_INTERRUPT)) { if ((Bool) TRUE == Queue_empty(Queue_handle(&(chanHandle-> queuePendingList)))) { /* This is the first buffer just prime *this */ tempCastIoPtr = (Void *) ioPacket; Queue_put(Queue_handle( &(chanHandle-> queuePendingList)), (Queue_Elem *) tempCastIoPtr); ioPacketProcess = NULL; status = IOM_PENDING; Hwi_restore(hwiKey); } else { /* This is the not the first buffer. * Put current packet in queue. */ tempCastIoPtr = (Void *) ioPacket; Queue_put(Queue_handle( &(chanHandle-> queuePendingList)), (Queue_Elem *) tempCastIoPtr); /* Get the top element in queue. */ ioPacketProcess = (IOM_Packet *) Queue_get( Queue_handle(&( chanHandle -> queuePendingList))); instHandle->currentActiveChannel = (Mcspi_ChanObj *) chanHandle; Hwi_restore(hwiKey); status = mcspiSlaveTransferStart( instHandle, chanHandle, ioPacketProcess); } }
If I try to trigger the read a second time to execute mcspiSlaveTransferStart, GIO_read will again fail with a timeout but afterwards the interrupt handler will run.
The communication master is transmitting data in an interval which I confirmed with an oscilloscope.