Skip to main content
mvigneshwaran27
Associate II
Aug 30, 2018 7:20 AM UTC
Solved

no SPI2 clock enable api/macro in stm32f0xx_hal_rcc.h

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

This topic has been closed for replies.
Amel NASRI
Amel NASRIBest answer
ST Technical Moderator
Aug 30, 2018 10:15 AM UTC

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 "Best Answer" on the reply which solved your issue or answered your question.

1 reply

Amel NASRI
Amel NASRIBest answer
ST Technical Moderator
Aug 30, 2018 10:15 AM UTC

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 "Best Answer" on the reply which solved your issue or answered your question.