SPI hard NSS and multibyte transmission
Hello,
I am using bare metal STM32G441 SPI (no ST HAL or LL). It has been a very tiresome dilemma with the chip select. If I use the hardware NSS (Motorola mode) then I get a pulse after each byte. If I use software NSS then the last bit gets crippled because waiting for the busy flag or the TXE fires before the last clock is done.
So how does one properly transfer multiple bytes with SPI? At the moment I am polling for the last clcok pulse which is ugly.
while((SPI1->SR & (bit7|bit2|bit1)) != (bit1|bit2));
while((GPIOA->IDR & bit5) == bit5);
GPIOA->BSRR = bit4;