Showing results for 
Search instead for 
Did you mean: 

SPI communication STM32H7B3I-DK

Associate II

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!

ST Employee


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?


To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.