MCUXpresso with LPCXpresso55S69
configured: spi with dma. TX only
in File: fsl_spi_dma.c, function SPI_MasterTransferCreateHandleDMA()
line 197: DMA_SetCallback(handle->rxHandle, SPI_RxDMACallback, &s_dmaPrivateHandle[instance]);
here the debugger hangs, because DMA_SetCallback expects callback !=0
If RX is not wanted, this callback is set =0
Shouldn't the file content be like :
if(handle->rxHandle){
DMA_SetCallback(handle->rxHandle, SPI_RxDMACallback, &s_dmaPrivateHandle[instance]);
}
?
Solved! Go to Solution.
Hello, bressan@stepover.de
After I did a call of the function SPI_MasterTransferCreateHandleDMA() like this:
SPI_MasterTransferCreateHandleDMA(EXAMPLE_SPI_MASTER, &masterHandle, SPI_MasterUserCallback, NULL, &masterTxHandle,
NULL);// &masterRxHandle as zero.
I can tell that your solution is valid to avoid the problem with DMA_Setcallback.()
But, since the driver is designed to use rxHandle and txHandle you will need to use both.
The rxHandle must be created because it is required on functions as SPI_MasterTransferDMA() and SPI_MasterTransferAbortDMA.(). Otherwise, you will need to implement further changes in the driver to avoid problems.
I don't know if you are using an SDK example. if the answer is no. The spi_dma_b2b_transfer_master example can help you with your work as a reference.
Please, let me know if I can help you further!
Best regards, Diego.
Thanks Diego,
I wrote my own SPI-DMA handler for SPI TX only.
You are welcome, Bernahrd.
Have a great day.
Hello, bressan@stepover.de
After I did a call of the function SPI_MasterTransferCreateHandleDMA() like this:
SPI_MasterTransferCreateHandleDMA(EXAMPLE_SPI_MASTER, &masterHandle, SPI_MasterUserCallback, NULL, &masterTxHandle,
NULL);// &masterRxHandle as zero.
I can tell that your solution is valid to avoid the problem with DMA_Setcallback.()
But, since the driver is designed to use rxHandle and txHandle you will need to use both.
The rxHandle must be created because it is required on functions as SPI_MasterTransferDMA() and SPI_MasterTransferAbortDMA.(). Otherwise, you will need to implement further changes in the driver to avoid problems.
I don't know if you are using an SDK example. if the answer is no. The spi_dma_b2b_transfer_master example can help you with your work as a reference.
Please, let me know if I can help you further!
Best regards, Diego.