Skip to main content
Associate
July 8, 2026
Solved

SPI2 not generated on STM32L051C8Tx

  • July 8, 2026
  • 1 reply
  • 59 views

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

Best answer by TDK

Yellow pins mean the peripheral isn’t enabled.

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

 

1 reply

TDK
TDKBest answer
July 8, 2026

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""."