Is the following normal behavior for the LPSPI:
- When NOSTALL is set to 0, the clock line idles high or low to ensure that the last bit of the last word written on MOSI is not sampled until another word is loaded into the TX FIFO. What you would see on an oscilloscope is an unusually long clock pulse. In other words, if you write a single word to the TX FIFO and wait for the RX FIFO to receive a word from the slave, you will end up seeing that the RX FIFO stays empty until you load a second word into the TX FIFO.
- When NOSTALL is set to 1, the LPSPI continuously pulses the clock line in groups of size FRAMESZ+1 when the TX FIFO is empty. In other words, when the TX FIFO is empty, the LPSPI keeps running the clock which in turn fills up the RX FIFO with junk data.
The former seems reasonable for some circumstances, but is causing some issues with a Linux driver I am troubleshooting. However, the latter does not seem reasonable. I cannot determine if this is normal behavior for the LPSPI or there is something else going on with the driver.
- It appears that part of the issue with my first bullet point is actually a known bug with the LPSPI IP itself according to RT1050 LPSPI last bit not completing in continuous mode