Skip to main content
Visitor II
April 14, 2024
Question

SPI communication STM32H7B3I-DK

  • April 14, 2024
  • 1 reply
  • 773 views

Hello everyone!

I am working on a project and using STM32H7B3I-DK board. I am facing issues with SPI communication. I am using simple code: 

while (1)

  {

    HAL_SPI_TransmitReceive(&hspi2, tx_data, rx_data, strlen(tx_data), HAL_MAX_DELAY); // Send AT command and receive response

    printf("Response: %s\r\n", rx_data); // Print received response

 

    HAL_Delay(1000); // Delay before sending the next command

  }

}

where after executing nothing is stored in rx_data. Do I need to modify clock configurations? 

Thanks in advance!

    This topic has been closed for replies.

    1 reply

    Technical Moderator
    April 14, 2024

    Hello,

    You need to check if you're using the correct GPIOs and their configs that connect your MCU to the external device.

    You need also to monitor your SPI lines with an oscilloscope or a logic analyzer. Are you seeing data coming back from the slave?