Wrong: DSPI issues related to the DMA usage

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Wrong: DSPI issues related to the DMA usage

1,306 次查看
vipako
Contributor I

When the DSPI uses the eDMA, it may transfer data incorrectly or fail when eDMA is used for another purpose. If the DSPI driver is the only user of eDMA, it should operate correctly. This behavior is a result of the silicon design of the DSPI.

This is not result of silicon design, but wrongly written SAI driver (with DMA). I have wrote on MQX 4.0.1 my own SAI driver with DMA and it work perfectly with DSPI (I have on SPI Memory FAT File system(ReadOnly)) I didn't noticed any error. But after updating to MQX 4.1.0 and using FS SAI DMA driver I noticed, that DSPI is not working with FS SAI driver. FS SAI DMA halt DSPI. I have found that FS SAI with DMA is wrongly designed, because it is using only one channel on DMA MUX and I am guessing, that this is source of the problem. After I installed my own SAI DMA driver it is working correctly.

2 回复数

997 次查看
peterilsoeniels
Contributor II

Hi Patrik

I have the same problem as you, When I enable the I2S(SAI), through MQX. SPI DMA is locked in a semaphore. Do you have any idea where I should look in the SAI driver for this bug? Or could you share your implementation?

Best regards

Peter Ilsoe

0 项奖励
回复

997 次查看
soledad
NXP Employee
NXP Employee

Hi,

“There is a known problem in DSPI w/DMA because DSPI peripheral cannot handle narrow writes to PUSHR correctly (except of Senna, K60_2M and TorqSilver) and the driver does not implement workaround for this.

The DSPI w/DMA driver does not write full 32-bits to PUSHR  to avoid copy of data to intermediate buffer (there is no other efficient way to perform 32-bit write using eDMA).

This assumes that DSPI peripheral keeps the previous value (i.e. zero) in the bits not being written, which is unfortunately not true for older silicons, as I mentioned above.

However the non-DMA DSPI was thoroughly tested and I think it asserts CS correctly. If it does not work for some BSPs then the issue might rather be in the BSP/board configuration.

Please note that if you change CS using IOCTL it does not affect the state of CS signals immediately but rather upon next transfer as CS and bus settings are specific to particular file descriptor of SPI device.

Please refer to most recent MQX IO guide about this (be sure you have the latest IO guide)”


Have a great day,

Sol

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------