cancel
Showing results for 
Search instead for 
Did you mean: 

no SPI2 clock enable api/macro in stm32f0xx_hal_rcc.h

mvigneshwaran27
Associate II

im using STM32F030R8T6 (nucleo F030R8 board)

i tried to enable SPI2 peripheral clock, but i cant find any line in stm32f0xx_hal_rcc.h to enable spi2 clock,

but there is macro for SPI1

__HAL_RCC_SPI1_CLK_ENABLE()

only few marcos for RCC_APB1ENR present in stm32f0xx_hal_rcc.h is there any reason for this.

or iam i missed any configuration for stm32f030R8

firmware: STM32Cube_FW_F0_V1.9.0

1 ACCEPTED SOLUTION

Accepted Solutions
Amel NASRI
ST Employee

Hi @mvigneshwaran27​ ,

__HAL_RCC_SPI2_CLK_ENABLE is declared in stm32f0xx_hal_rcc_ex.h.

Tip: You can easily check it generating a project with STM32CubeMX where you enable SPI2 for your selected device (STM32F030R8Tx).  __HAL_RCC_SPI2_CLK_ENABLE is called in HAL_SPI_MspInit (file: stm32f0xx_hal_msp.c).

-Amel

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.

View solution in original post

1 REPLY 1
Amel NASRI
ST Employee

Hi @mvigneshwaran27​ ,

__HAL_RCC_SPI2_CLK_ENABLE is declared in stm32f0xx_hal_rcc_ex.h.

Tip: You can easily check it generating a project with STM32CubeMX where you enable SPI2 for your selected device (STM32F030R8Tx).  __HAL_RCC_SPI2_CLK_ENABLE is called in HAL_SPI_MspInit (file: stm32f0xx_hal_msp.c).

-Amel

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.