Skip to main content
WM_IR
Associate III
April 26, 2021
Solved

Why RXNE is automatically reset after write data to DR register, even I already set the FRXTH to 1

  • April 26, 2021
  • 2 replies
  • 1464 views

I have a problem where even I already set the FRXTH to 1, the RXNE will automatically RESET after the SPI write data to DR register.

I check using DEBUGGING MODE:

In main(), I already SET the FRXTH based on the reference manual below:

0693W00000AMAYMQA5.png 

Then, after I write the data into DR register, it SET the RXNE as below:

0693W00000AMTDXQA5.png 

But, after I execute the next instruction, which is not related to any SPI, Len-- to go out from the loop, my RXNE automatically RESET as below:

0693W00000AMTE1QAP.png 

This cause my code will hang at the SPI check flag status in the SPI ReceiveData.

Anyone knows what is the problem? or my SPI_senddata code is problem

This topic has been closed for replies.
Best answer by waclawek.jan

Debugger reading SPI_DR empties the FIFO, in the same way as when processor or DMA read it.

Debugging is intrusive.

JW

2 replies

waclawek.jan
waclawek.janBest answer
Super User
April 26, 2021

Debugger reading SPI_DR empties the FIFO, in the same way as when processor or DMA read it.

Debugging is intrusive.

JW

WM_IR
WM_IRAuthor
Associate III
April 26, 2021

ohh..I see, now it works! Thanks!