Can only transmit one SPI byte?
Hello,
I am trying to use SPI1 on the STM32H742VITx.
I believe I have configured SPI1 I/Os and CR/CFGR fields correctly. However, when I try to transmit bytes via SPI I am able to transmit one byte, but after that the SPI_SR_TXC bit remains at 0. Here is my simplified code for writing a byte:
__INLINE void bsp_spi_write_byte(uint8_t data)
{
/* *(uint8_t *) &SPI1->DR casting is necessary to force sending ONLY 8-bits to the peripheral,
otherwise it keeps casting uint8_t to uint16_t again and stores additional 0x00 value in
the TX FIFO */
while (!(SPI1->SR & SPI_SR_TXC));
*(uint8_t *) &SPI1->TXDR = data;
}
So in other words, the SPI_SR_TXC bit is cleared on the first byte transmission, but then remains high indefinitely (so I suspect the byte is not being transmitted actually).
I've looked at everything that could possibly be related to SPI being enabled and can't see what could be missing.
Does anyone have any suggestions?
Thanks!
-Brian
