Code: Select all
spiSelect(&SPID2);
spiStartExchange(&SPID2, 3, spi_tx_buff, spi_rx_buff);
chThdSleepMilliseconds(10);
spiUnselect(&SPID2);
SPI configured this way
Code: Select all
static const SPIConfig spicfg =
{
NULL,
/* HW dependent part.*/
GPIOB,
GPIOB_SPI2NSS,
SPI_CR1_MSTR | SPI_CR1_BR_0 | SPI_CR1_BR_1 | SPI_CR1_BR_2
};when I use spiSend or spiReceive system halts.
But using spiStartExchange gets another problem - SS line doesn’t keep low during transfer, so I get junk tx and rx values.
