Skip to main content
JLesser
Visitor II
Jun 29, 2021 10:53 AM UTC
Solved

STM32CubeIDE not generating GPIO initialization code for SPI

I am using a Nucleo H743ZI2 with the CubeIDE and while it does generate code to initialize the SPI peripheral itself, it does not generate code to configure GPIO pins as the SPI alternate function. This is despite the fact that the GPIO pins for SPI are shown green on the Pinout & Configuration window and it is able to generate code for other GPIO pins, like the pins connected to the LEDs.

This topic has been closed for replies.
TDK
TDKBest answer
Jun 29, 2021 1:35 PM UTC

It probably does and you're not looking in the right spot.

Pin initializations are found in the HAL_SPI_MspInit function within stm32f7xx_hal_msp.c by default.

Attach your IOC if that's not the case.

"If you feel a post has answered your question, please click ""Accept as Solution""."

1 reply

TDK
TDKBest answer
Jun 29, 2021 1:35 PM UTC

It probably does and you're not looking in the right spot.

Pin initializations are found in the HAL_SPI_MspInit function within stm32f7xx_hal_msp.c by default.

Attach your IOC if that's not the case.

"If you feel a post has answered your question, please click ""Accept as Solution""."