whether S32K1 SDK3.0 LPSPI_SetFlushFifoCmd function will push LPSPI fifo data to spi bus

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

whether S32K1 SDK3.0 LPSPI_SetFlushFifoCmd function will push LPSPI fifo data to spi bus

223 次查看
teddywang
Contributor I

hi all

   1:I use S32K146 ' LPSPI interrupt mode to communicate FS4503,I found 2 words send in one CS period sometimes,

   2:I checked S32K1 SDK3.0 source code,I found the LPSPI use 2 times LPSPI_SetFlushFifoCmd (),the code comments is that " The second flush command is used to avoid the case when one word is still in shifter"

   3:I want to be sure whether the second flush command will push no use data in fifo to spi bus,then bus will appear twice data

   4:If yes,how to work around,thanks

 

/* Clean RX and TX buffers */
LPSPI_SetFlushFifoCmd(base, true, true);
/* The second flush command is used to avoid the case when one word is still in shifter. */
LPSPI_SetFlushFifoCmd(base, true, true);

0 项奖励
回复
3 回复数

154 次查看
frank_yang_1
NXP Employee
NXP Employee

Hi Wang,

After test, the operations of RRF and RTF will not push unused data to SPI bus.

These are internal hardware IP operations that will not affect the SPI bus.

BR

Frank

0 项奖励
回复

131 次查看
zhijian
Contributor I

hi,Frank

       Plase reference attachment,Thanks!

标记 (1)
0 项奖励
回复

109 次查看
frank_yang_1
NXP Employee
NXP Employee

Hi zhijian,

How about the latest status based on given advice? In myside, I could not re-produce this issue until now. 

frank_yang_1_3-1717660905807.png

A little advice, we suggest that setting GPIO PCS line in SPI ISR with you using SPI under interrupt mode. 

frank_yang_1_2-1717660775421.png

 

BR

Frank

0 项奖励
回复