AnsweredAssumed Answered

Bug in HAL_SPI Library HAL_SPI_Transmit

Question asked by voroshilov.ignat on Jul 28, 2016
Latest reply on Aug 3, 2016 by brown.geoffrey.001
I found bug in HAL SPI Library.
MCU: STM32L476VGT6 (L476 Discovery board)
CubeMX 4.15.1
CubeL4 v1.5.1

In transmiting data in 8-bit mode:
  /* Transmit data in 8 Bit mode */
  else
  {
    while (hspi->TxXferCount > 0)
    {
      /* Wait until TXE flag is set to send data */
      if((hspi->Instance->SR & SPI_FLAG_TXE) == SPI_FLAG_TXE)
      {
        if(hspi->TxXferCount > 1)
        {
          /* write on the data register in packing mode */
          hspi->Instance->DR = *((uint16_t*)hspi->pTxBuffPtr);
          hspi->pTxBuffPtr += sizeof(uint16_t);//sizeof(uint8_t);
          hspi->TxXferCount -= 2;//hspi->TxXferCount --;
        }
        else
        {
          *((__IO uint8_t*)&hspi->Instance->DR) = (*hspi->pTxBuffPtr++);
          hspi->TxXferCount--;
        }
      }
..
..
}

Where should contact to this error fixed?

Outcomes