SPI on STM32G071 not behaving as expected
Hi,
i have new design that i am migrating to the STM32G071 and having issues with the SPI1 port PB3,PB4,PB5.
Changing CPOL and or CPHA during init code do not seem to have any impact, when powered down and restarted.
I am seeing 9 clock pulses when set to 8 bit data. Suspect this might be issues with the overall SPI setup.
the init code is simple changed to the absolute simplest format.
ignoring setting the PB3,4,5 GPIO pins as they are good i can see the signals on the cro
// bidirectional mode full 2 line
SPI1->CR1&=~SPI_CR1_BIDIMODE;
// set as master
SPI1->CR1|=SPI_CR1_MSTR;
// CPOL clock idle low
SPI1->CR1&=~SPI_CR1_CPOL;
// CPHA rising clock edge
SPI1->CR1&=~SPI_CR1_CPHA;
// set LSBFIRST low we send MSB first
SPI1->CR1&=~SPI_CR1_LSBFIRST;
// set up SSM pin
SPI1->CR1&=~SPI_CR1_SSM;
SPI1->CR1&=~SPI_CR1_SSI;
// configure data size 8 bits
SPI1->CR2|=(SPI_CR2_DS_2|SPI_CR2_DS_1|SPI_CR2_DS_0);
// set the reception threshold
SPI1->CR2|=SPI_CR2_FRXTH;
// set TI mode
SPI1->CR2|=SPI_CR2_FRF;
// DISABLE ssoe OUTPUT
SPI1->CR2&=~SPI_CR2_SSOE;
// enable SPI port
SPI1->CR1|=SPI_CR1_SPE;

