Skip to main content
Associate
Jul 8, 2026 21:03 UTC
Solved

SPI2 not generated on STM32L051C8Tx

Hello,

 

I may be missing something, I cant generate the SPI_init() method within main() (also pins are yellow ?)…

I have generated;

 

  HAL_Init();

/* Configure the system clock */
SystemClock_Config();

/* Initialize all configured peripherals */
MX_GPIO_Init();

 

Cheers

TDK
TDKBest answer
Jul 8, 2026 21:28 UTC

Yellow pins mean the peripheral isn’t enabled.

In the SPI2 peripheral, enable it by choosing a mode such as two-way master.

 

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

1 reply

TDK
TDKBest answer
Jul 8, 2026 21:28 UTC

Yellow pins mean the peripheral isn’t enabled.

In the SPI2 peripheral, enable it by choosing a mode such as two-way master.

 

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