SPI HAL receive command putting out 5 bytes worth of clock cycles ????
I have the following :
HAL_SPI_Transmit(&hspi2, &txBuf[0], 1, 50);
HAL_SPI_Receive(&hspi2, &rxBuf[0], 1, 50);I have the following code .... STM32L476 is a spi 3 wire master. The Transmit appears (logic analyzer) to be working fine, however I am having much grief trying to read from the sensor (LSM6DSM33)....If I transmit two bytes with the second being a dummy byte of 0x00, the device responds with the appropriate response on the 3 wire connection. Unfortunately this method does not write anything into an rx buffer hence I THEN change to what you see above. The issue I am having is the above receive command puts 5 bytes worth of clocks out on the bus EVEN with a 1 as a parameter. If I put a 0 I get no clocks (as expected) and if I put a 2 I get (7 bytes worth of clocks). Can someone please explain what is going on????