DMA_SetCallback hangs

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

DMA_SetCallback hangs

ソリューションへジャンプ
789件の閲覧回数
bressan
Contributor III

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]);

}

?

0 件の賞賛
1 解決策
704件の閲覧回数
diego_charles
NXP TechSupport
NXP TechSupport

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. 

元の投稿で解決策を見る

3 返答(返信)
704件の閲覧回数
bressan
Contributor III

Thanks Diego,

I wrote my own SPI-DMA handler for SPI TX only.

0 件の賞賛
704件の閲覧回数
diego_charles
NXP TechSupport
NXP TechSupport

You are welcome, Bernahrd.

Have a great day.

0 件の賞賛
705件の閲覧回数
diego_charles
NXP TechSupport
NXP TechSupport

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.