2398434_en-US

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

2398434_en-US

2398434_en-US

IMXRT1172 LPSPI with EDMA random intermittent SPI SR = REF error

Hi,

When using the LPSPI EDMA transfer API, sometimes when my callback is called from the SDK (when EDMA is complete), if I look at the LPSPI SR register, about one in 5-10 times it has the REF bit set (Read error flag / overflow).  My SPI clock is running at 500Khz.  I'm not really sure why I'm  getting this SPI RX overflow as the SPI clock is nowhere near fast enough to cause DMA to not be able to keep up.  Is there any way I can troubleshoot this and has anyone else seen this problem?  The data always looks correct even when I get the overflow (I zero my buffer between each transfer, so I know it's not old stale data I'm looking at).  I'm doing simultaneous TX/RX using the transfer API, and doing the transfer every 4ms.  There shouldn't be any issues with timing.

Thanks,

-m

Re: IMXRT1172 LPSPI with EDMA random intermittent SPI SR = REF error

Hi @nxp16 ,

Thank you so much for your interest in our products and for using our community.

SR[REF] indicates a receive FIFO overflow. If this flag is really set during a transfer, the recommended recovery is to stop the transfer, empty the RX FIFO, clear REF, and restart the transfer.

However, at 500 kHz, this does not look like a normal DMA bandwidth issue, assuming the RX EDMA channel is already prepared/enabled before the SPI clocks start. Since the received data is still correct, I suggest first check whether REF is a stale flag or is being set by the transfer start/stop sequence.

For troubleshooting, please try the below:
1. Clear SR[REF] before starting each new transfer.
2. Make sure RX DMA is enabled before TX starts generating clocks.
3. Check whether LPSPI is disabled/re-enabled between transfers. If yes, apply the applicable errata workaround: clear REF after enabling LPSPI, or reset LPSPI before re-enabling.

mayliu1_0-1784877413675.png

Wish it helps you

Best Regards

May

Re: IMXRT1172 LPSPI with EDMA random intermittent SPI SR = REF error

The errata mentions two workarounds, clearing the bit in SR, and resetting the peripheral.  Unfortunately, the errata seems to be incorrect about the first one as the SDK already does that and it doesn't workaround the problem.  Unfortunately, for me, resetting the peripheral is not an option as I would have to reconfigure everything afterward (it clears ALL registers).  For now, I'm going to assume that if DMA completed successfully and we get a REF error, then it's a false error and I'll just ignore it.

Thanks,

-m

标记 (1)
无评分
版本历史
最后更新:
33 分钟之前
更新人: