The DR
register on the SPI peripheral on stm32f7xx micros is 16 bit wide. Write operations on this register directly cause 16 bits to be written into the FIFO, and thus a 16 bit transfer on the SPI bus.
When operating in 8-bit mode, this caused two problems:
while ((spi->SR & SPI_SR_RXNE) == 0)
;
always being true due to the FIFO never being emptied.
transfer()
function of SPIBus
by accessing the DR
register through a 8-bit pointer (*(volatile uint8_t*)&spi->DR = static_cast<uint8_t>(data);
)This fix was only tested on an stm32f756 micro.