AnsweredAssumed Answered

SPI Master Read Write using HAL commands

Question asked by Sudi.Sampath on Mar 31, 2017
Latest reply on Apr 7, 2017 by Andrei Chichak

Hi All,

 

   I am new to STM , I  have problem in  read and write data simultaneously  using STM32L476 board. i just created a new project using STMcubeMX and try to read and write  simultaneously  using HAL_SPI_TransmitReceive_IT , and when i checked on my spi sniffer, spi data is sent byte ,byte ...   Here my  spi init config

 

hspi1.Instance = SPI1;
  hspi1.Init.Mode = SPI_MODE_MASTER;
  hspi1.Init.Direction = SPI_DIRECTION_2LINES;
  hspi1.Init.DataSize = SPI_DATASIZE_8BIT;
  hspi1.Init.CLKPolarity = SPI_POLARITY_HIGH;
  hspi1.Init.CLKPhase = SPI_PHASE_1EDGE;
  hspi1.Init.NSS = SPI_NSS_SOFT ;
  hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_256;
  hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB;
  hspi1.Init.TIMode = SPI_TIMODE_DISABLE;
  hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
  hspi1.Init.CRCPolynomial = 7;
  hspi1.Init.CRCLength = SPI_CRC_LENGTH_DATASIZE;
  hspi1.Init.NSSPMode = SPI_NSS_PULSE_ENABLE;

if (HAL_SPI_Init(&hspi1) != HAL_OK)

 

is any  missing in my configuration.

Thanks in advance.

Outcomes