Skip to main content
MQi.2
Visitor II
Apr 23, 2021 11:31 AM UTC
Question

The SPI data length is set to 8 bits, but the receive data buffer is 16 bits

In STM32WLE5JC MCU, the SPI data length is set to 8 bits, and the corresponding receiving FIFO is also set to 8 bits, but the final receiving and sending data is 16 bits.

1. SPI-CR2 registers during transmission are as follows:

It can be seen from the figure that CR2 is 0x1708, the threshold of FIFO is set to 8 bits, but the data length of DR is 16 bits: 0x0130

0693W00000AMLyVQAX.png2. the CR2 register in 2.STM32WL is described as follows:

0693W00000AMLyfQAH.png

This topic has been closed for replies.

1 reply

Tesla DeLorean
Guru
Apr 23, 2021 11:47 AM UTC

Ok, but you understand the debugger is invasive, right?

It forcibly reads, in a wide fashion, and changes the internal state of the peripheral.

It doesn't care about the FIFO depth, or data ready. The data in DR is undefined in the empty case.​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..