Skip to main content
hamzeh
Visitor II
July 3, 2016
Question

how i can tarnsmit and receive 1 byte

  • July 3, 2016
  • 0 replies
  • 474 views
Posted on July 03, 2016 at 07:14

Hi

How i can transmit and receive 1 byte by SPI and use of HAL layer for STM32F4 to do for example below routin:

while(1)

{

    while (__HAL_SPI_GET_FLAG(&hspi1,SPI_FLAG_TXE) == RESET);

    temp=0x00;

    HAL_SPI_Transmit(&hspi1,(uint8_t *)&temp,1,10);

    while (__HAL_SPI_GET_FLAG(&hspi1,SPI_FLAG_RXNE) == RESET);

    HAL_SPI_Receive(&hspi1,data,1,10);

}

the micro can not pass RXNE flag while data received. Why?
    This topic has been closed for replies.