Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu/stm32: Fix stm clock configuration #18797

Merged
merged 6 commits into from
Nov 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions boards/common/iotlab/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ config BOARD_COMMON_IOTLAB
select HAVE_L3G4200D
select HAVE_LSM303DLHC

config CLOCK_HSE
default 16000000

config MODULE_BOARDS_COMMON_IOTLAB
bool
depends on TEST_KCONFIG
Expand Down
3 changes: 0 additions & 3 deletions boards/common/iotlab/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,3 @@ FEATURES_PROVIDED += periph_uart

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += riotboot

# iotlab boards provide a custom default Kconfig clock configuration
KCONFIG_BOARD_CONFIG += $(RIOTBOARD)/common/iotlab/clock.config
4 changes: 0 additions & 4 deletions boards/common/iotlab/clock.config

This file was deleted.

5 changes: 4 additions & 1 deletion boards/common/iotlab/include/periph_conf_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
#ifndef CONFIG_BOARD_HAS_HSE
#define CONFIG_BOARD_HAS_HSE 1
#endif
#define CLOCK_HSE MHZ(16)

#ifndef CONFIG_CLOCK_HSE
#define CONFIG_CLOCK_HSE MHZ(16)
#endif

#include "periph_cpu.h"
#include "clk_conf.h"
Expand Down
3 changes: 3 additions & 0 deletions boards/common/weact-f4x1cx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ config BOARD_COMMON_WEACT_F4X1CX
select HAVE_SAUL_GPIO
select HAVE_MTD_SPI_NOR

config CLOCK_HSE
default 25000000

config MODULE_BOARDS_COMMON_WEACT-F4X1CX
bool
depends on TEST_KCONFIG
Expand Down
2 changes: 0 additions & 2 deletions boards/common/weact-f4x1cx/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ FEATURES_PROVIDED += periph_usbdev
FEATURES_PROVIDED += highlevel_stdio
FEATURES_PROVIDED += tinyusb_device

# weact-f4x1cx boards provide a custom default Kconfig clock configuration
KCONFIG_BOARD_CONFIG += $(RIOTBOARD)/common/weact-f4x1cx/clock.config

# This configuration enables modules that are only available when using Kconfig
# module modelling
Expand Down
4 changes: 0 additions & 4 deletions boards/common/weact-f4x1cx/clock.config

This file was deleted.

4 changes: 3 additions & 1 deletion boards/common/weact-f4x1cx/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
#endif

/* The HSE provides a 25MHz clock */
#define CLOCK_HSE MHZ(25)
#ifndef CONFIG_CLOCK_HSE
#define CONFIG_CLOCK_HSE MHZ(25)
#endif

#include "clk_conf.h"
#include "cfg_i2c1_pb8_pb9.h"
Expand Down
3 changes: 3 additions & 0 deletions boards/f4vi1/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ config BOARD_F4VI1
select BOARD_HAS_HSE
select BOARD_HAS_LSE

config CLOCK_HSE
default 16000000

config CLOCK_PLL_M
default 16

Expand Down
4 changes: 3 additions & 1 deletion boards/f4vi1/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
#endif

/* The HSE provides a 16MHz clock */
#define CLOCK_HSE MHZ(16)
#ifndef CONFIG_CLOCK_HSE
#define CONFIG_CLOCK_HSE MHZ(16)
#endif

#include "periph_cpu.h"
#include "clk_conf.h"
Expand Down
4 changes: 4 additions & 0 deletions boards/im880b/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ config BOARD_IM880B
select HAS_PERIPH_UART

# Clock configuration
select BOARD_HAS_HSE
select BOARD_HAS_LSE

config CLOCK_HSE
default 16000000

source "$(RIOTBOARD)/common/stm32/Kconfig"
4 changes: 3 additions & 1 deletion boards/im880b/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
/**
* @brief Speed of the HSE clock in Hz
*/
#define CLOCK_HSE MHZ(16)
#ifndef CONFIG_CLOCK_HSE
#define CONFIG_CLOCK_HSE MHZ(16)
#endif

#include "periph_cpu.h"
#include "clk_conf.h"
Expand Down
3 changes: 3 additions & 0 deletions boards/lora-e5-dev/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ config BOARD_LORA_E5_DEV
select HAVE_SAUL_GPIO
select HAVE_LM75A

config CLOCK_HSE
default 32000000

config LORA_E5_DEV_ENABLE_3P3V
bool "LoRa-E5 Development Kit - Enable 3.3V output"
default y
Expand Down
4 changes: 3 additions & 1 deletion boards/lora-e5-dev/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
#define CONFIG_BOARD_HAS_HSE 1
#endif

#define CLOCK_HSE MHZ(32)
#ifndef CONFIG_CLOCK_HSE
#define CONFIG_CLOCK_HSE MHZ(32)
#endif

#include "periph_cpu.h"
#include "clk_conf.h"
Expand Down
3 changes: 3 additions & 0 deletions boards/msbiot/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ config BOARD_MSBIOT
select HAVE_MPU9150
select HAVE_SAUL_GPIO

config CLOCK_HSE
default 16000000

config CLOCK_PLL_M
default 16

Expand Down
4 changes: 3 additions & 1 deletion boards/msbiot/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
#endif

/* The HSE provides a 16MHz clock */
#define CLOCK_HSE MHZ(16)
#ifndef CONFIG_CLOCK_HSE
#define CONFIG_CLOCK_HSE MHZ(16)
#endif

#include "periph_cpu.h"
#include "clk_conf.h"
Expand Down
3 changes: 3 additions & 0 deletions boards/nucleo-wl55jc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ config BOARD_NUCLEO_WL55JC

select MODULE_PERIPH_LPUART if MODULE_STDIO_UART && HAS_PERIPH_LPUART

config CLOCK_HSE
default 32000000

source "$(RIOTBOARD)/common/nucleo64/Kconfig"
4 changes: 3 additions & 1 deletion boards/nucleo-wl55jc/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@
#define CONFIG_BOARD_HAS_HSE 1
#endif

#define CLOCK_HSE MHZ(32)
#ifndef CONFIG_CLOCK_HSE
#define CONFIG_CLOCK_HSE MHZ(32)
#endif

#include "periph_cpu.h"
#include "clk_conf.h"
Expand Down
3 changes: 3 additions & 0 deletions boards/p-nucleo-wb55/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,7 @@ config BOARD_P_NUCLEO_WB55
select BOARD_HAS_HSE
select BOARD_HAS_LSE

config CLOCK_HSE
default 32000000

source "$(RIOTBOARD)/common/nucleo/Kconfig"
4 changes: 3 additions & 1 deletion boards/p-nucleo-wb55/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
#define CONFIG_BOARD_HAS_HSE 1
#endif

#define CLOCK_HSE MHZ(32)
#ifndef CONFIG_CLOCK_HSE
#define CONFIG_CLOCK_HSE MHZ(32)
#endif

/* EXTAHB (HCLK2) max freq 32 Mhz*/
#define CLOCK_EXTAHB_DIV RCC_EXTCFGR_C2HPRE_3
Expand Down
3 changes: 3 additions & 0 deletions boards/pyboard/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ config BOARD_PYBOARD

select HAVE_SAUL_GPIO

config CLOCK_HSE
default 12000000

config CLOCK_PLL_M
default 12

Expand Down
4 changes: 3 additions & 1 deletion boards/pyboard/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
#endif

/* The HSE provides a 12MHz clock */
#define CLOCK_HSE MHZ(12)
#ifndef CONFIG_CLOCK_HSE
#define CONFIG_CLOCK_HSE MHZ(12)
#endif

#include "periph_cpu.h"
#include "clk_conf.h"
Expand Down
3 changes: 3 additions & 0 deletions boards/stm32f469i-disco/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@ config BOARD_STM32F469I_DISCO

select HAVE_SAUL_GPIO

config CLOCK_HSE
default 8000000

source "$(RIOTBOARD)/common/stm32/Kconfig"
4 changes: 3 additions & 1 deletion boards/stm32f469i-disco/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
#endif

/* The HSE provides a 8MHz clock */
#define CLOCK_HSE MHZ(8)
#ifndef CONFIG_CLOCK_HSE
#define CONFIG_CLOCK_HSE MHZ(8)
#endif

#include "periph_cpu.h"
#include "clk_conf.h"
Expand Down
3 changes: 3 additions & 0 deletions boards/stm32f723e-disco/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ config BOARD_STM32F723E_DISCO
# Workaround due to stdout only working with stdin enabled
select MODULE_STDIN if TEST_KCONFIG

config CLOCK_HSE
default 25000000

config MODULE_PERIPH_INIT_LED0
default n if MODULE_PERIPH_SPI

Expand Down
3 changes: 0 additions & 3 deletions boards/stm32f723e-disco/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,3 @@ FEATURES_PROVIDED += periph_usbdev_hs_utmi

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += tinyusb_device

# stm32f723e-disco provides a custom default Kconfig clock configuration
KCONFIG_BOARD_CONFIG += $(RIOTBOARD)/stm32f723e-disco/clock.config
5 changes: 0 additions & 5 deletions boards/stm32f723e-disco/clock.config

This file was deleted.

4 changes: 3 additions & 1 deletion boards/stm32f723e-disco/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
#endif

/* The HSE provides a 25MHz clock */
#define CLOCK_HSE MHZ(25)
#ifndef CONFIG_CLOCK_HSE
#define CONFIG_CLOCK_HSE MHZ(25)
#endif

#include "periph_cpu.h"
#include "clk_conf.h"
Expand Down
5 changes: 5 additions & 0 deletions boards/stm32f746g-disco/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,9 @@ config BOARD_STM32F746G_DISCO
select HAVE_STM32_ETH
select HAVE_FT5X06


config CLOCK_HSE
default 25000000


source "$(RIOTBOARD)/common/stm32/Kconfig"
5 changes: 0 additions & 5 deletions boards/stm32f746g-disco/clock.config

This file was deleted.

3 changes: 0 additions & 3 deletions boards/stm32f746g-disco/features-shared.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,3 @@ FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_usbdev
FEATURES_PROVIDED += periph_usbdev_hs_ulpi
FEATURES_PROVIDED += tinyusb_device

# stm32f746g-disco provides a custom default Kconfig clock configuration
KCONFIG_BOARD_CONFIG += $(RIOTBOARD)/stm32f746g-disco/clock.config
4 changes: 3 additions & 1 deletion boards/stm32f746g-disco/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
#endif

/* The HSE provides a 25MHz clock */
#define CLOCK_HSE MHZ(25)
#ifndef CONFIG_CLOCK_HSE
#define CONFIG_CLOCK_HSE MHZ(25)
#endif

#include <stdint.h>

Expand Down
4 changes: 4 additions & 0 deletions boards/stm32f7508-dk/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ config BOARD_STM32F7508_DK
select BOARD_HAS_LSE

select HAVE_SAUL_GPIO
select HAVE_STM32_ETH
select HAVE_FT5X06

config CLOCK_HSE
default 25000000

source "$(RIOTBOARD)/common/stm32/Kconfig"
5 changes: 5 additions & 0 deletions boards/stm32f769i-disco/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,9 @@ config BOARD_STM32F769I_DISCO

select HAVE_SAUL_GPIO


config CLOCK_HSE
default 25000000


source "$(RIOTBOARD)/common/stm32/Kconfig"
3 changes: 0 additions & 3 deletions boards/stm32f769i-disco/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,3 @@ FEATURES_PROVIDED += periph_usbdev

# Put other features for this board (in alphabetical order)
FEATURES_PROVIDED += tinyusb_device

# stm32f769i-disco provides a custom default Kconfig clock configuration
KCONFIG_BOARD_CONFIG += $(RIOTBOARD)/stm32f769i-disco/clock.config
5 changes: 0 additions & 5 deletions boards/stm32f769i-disco/clock.config

This file was deleted.

4 changes: 3 additions & 1 deletion boards/stm32f769i-disco/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
#endif

/* The HSE provides a 25MHz clock */
#define CLOCK_HSE MHZ(25)
#ifndef CONFIG_CLOCK_HSE
#define CONFIG_CLOCK_HSE MHZ(25)
#endif

#include "periph_cpu.h"
#include "clk_conf.h"
Expand Down
3 changes: 3 additions & 0 deletions boards/ublox-c030-u201/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@ config BOARD_UBLOX_C030_U201
select HAVE_SAUL_GPIO
select MODULE_PERIPH_UART_HW_FC if TEST_KCONFIG && HAS_PERIPH_UART_HW_FC

config CLOCK_HSE
default 12000000

source "$(RIOTBOARD)/common/stm32/Kconfig"
3 changes: 0 additions & 3 deletions boards/ublox-c030-u201/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,3 @@ FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_uart_hw_fc

# ublox-c030-u201 provides a custom default Kconfig clock configuration
KCONFIG_BOARD_CONFIG += $(RIOTBOARD)/ublox-c030-u201/clock.config
5 changes: 0 additions & 5 deletions boards/ublox-c030-u201/clock.config

This file was deleted.

4 changes: 3 additions & 1 deletion boards/ublox-c030-u201/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
#endif

/* The HSE provides a 12MHz clock */
#define CLOCK_HSE MHZ(12)
#ifndef CONFIG_CLOCK_HSE
#define CONFIG_CLOCK_HSE MHZ(12)
#endif

#include "periph_cpu.h"
#include "clk_conf.h"
Expand Down
3 changes: 0 additions & 3 deletions boards/weact-f401cc/Makefile.features
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
CPU_MODEL = stm32f401cc

include $(RIOTBOARD)/common/weact-f4x1cx/Makefile.features

# weact-f401cc provides a custom default Kconfig clock configuration
KCONFIG_BOARD_CONFIG += $(RIOTBOARD)/weact-f401cc/clock.config
1 change: 0 additions & 1 deletion boards/weact-f401cc/clock.config

This file was deleted.

3 changes: 0 additions & 3 deletions boards/weact-f401ce/Makefile.features
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
CPU_MODEL = stm32f401ce

include $(RIOTBOARD)/common/weact-f4x1cx/Makefile.features

# weact-f401ce provides a custom default Kconfig clock configuration
KCONFIG_BOARD_CONFIG += $(RIOTBOARD)/weact-f401ce/clock.config
1 change: 0 additions & 1 deletion boards/weact-f401ce/clock.config

This file was deleted.

Loading