AnsweredAssumed Answered

Extra SPI Clock Pulse on Initial Transfer

Question asked by Magnussen.Jon.002 on Feb 11, 2016
Latest reply on Feb 11, 2016 by waclawek.jan
I am using an STM32L152 with the HAL library.  I initialize the spi bus similar to the example code from STM32CubeMx.  However, the very first spi transaction always has a wide extra clock pulse (see attachment).  Any idea what might cause this?

SpiHandle.Instance               = SPI1;
SpiHandle.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_256;
SpiHandle.Init.Direction         = SPI_DIRECTION_2LINES;
SpiHandle.Init.CLKPhase          = SPI_PHASE_1EDGE;
SpiHandle.Init.CLKPolarity       = SPI_POLARITY_LOW;
SpiHandle.Init.CRCCalculation    = SPI_CRCCALCULATION_DISABLE;
SpiHandle.Init.DataSize          = SPI_DATASIZE_8BIT;
SpiHandle.Init.FirstBit          = SPI_FIRSTBIT_MSB;
SpiHandle.Init.NSS               = SPI_NSS_SOFT;
SpiHandle.Init.TIMode            = SPI_TIMODE_DISABLE;
SpiHandle.Init.Mode              = SPI_MODE_MASTER;
 
if(HAL_SPI_Init(&SpiHandle) != HAL_OK)

Outcomes