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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

187 Views
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 Kudos
3 Replies

118 Views
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 Kudos

95 Views
zhijian
Contributor I

hi,Frank

       Plase reference attachment,Thanks!

Tags (1)
0 Kudos

73 Views
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 Kudos