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.

SPI DMA Driver. Callback mode doesn't work.

Other Parts Discussed in Thread: TMDSEVM572X

Hi.

I'm using TMDSEVM572X board and processor_sdk_rtos_am57xx_3_00_00_04 software.

I launched example MCSPI_BasicExample_Dma_idkAM572x_c66xTestProject and it worked fine.

When i tried to "Uncomment below lines of code to test callback mode" (main_mcspi_dma_test.c), i didn't get callback call.

I looked at sources of spi dma driver and found, that the completion function (SPI_DMA_transferComp_Callback_v1) is called when isr is occur.
But in similar place in the spi driver, there is call of handle->callback_Fxn, wich has SPI_DMA_transferComp_Callback_v1 value in spi_block_mode, and has user defined callback function value in spi_callback_mode. And one more - handle->callback functions never called.

I changed call of SPI_DMA_transferComp_Callback_v1 to call of handle->callback_Fxn and now it works fine.

Code changes:

Old:
/* Call the transfer completion callback function */
SPI_DMA_transferComp_Callback_v1((SPI_Handle)handle, NULL, 0U);

New:
SPI_DMA_v1_Object *object = NULL;
object = handle->object;
object->transferCallbackFxn((SPI_Handle)handle, object->transaction);
object->transaction = NULL;

Note: There is a little more. There is two almost identical competion functions: SPI_DMA_localCompleteIOedmaCbk_v1 and SPI_DMA_transferComp_Callback_v1. It isn't bug, but it is strange.

P.S. May be it should be written like bugs report, but i don't know realy how to do it.