mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
d78e13e906
clk_conf is a useful tool to produce clock headers for new boards. But it only supports STM32Fx families. This commits add the definition of a new family: STM32MP1. Only the STM32MP157 is supported for now. First build clk_conf: $ make -C cpu/stm32/dist/clk_conf/ Clock header can be generated with the following command once clk_conf is built: $ cpu/stm32/dist/clk_conf/clk_conf stm32mp157 208000000 24000000 1 This command line will produce a core clock of 208MHz with a 24MHz HSE oscillator and will use LSE clock which corresponds to the STM32MP157C-DK2 board configuration. The command will output the header to copy paste into the periph_conf.h of the board: /** * @name Clock settings * * @note This is auto-generated from * `cpu/stm32/dist/clk_conf/clk_conf.c` * @{ */ /* give the target core clock (HCLK) frequency [in Hz], * maximum: 209MHz */ #define CLOCK_CORECLOCK (208000000U) /* 0: no external high speed crystal available * else: actual crystal frequency [in Hz] */ #define CLOCK_HSE (24000000U) /* 0: no external low speed crystal available, * 1: external crystal available (always 32.768kHz) */ #define CLOCK_LSE (1U) /* peripheral clock setup */ #define CLOCK_MCU_DIV RCC_MCUDIVR_MCUDIV_1 /* max 209MHz */ #define CLOCK_MCU (CLOCK_CORECLOCK / 1) #define CLOCK_APB1_DIV RCC_APB1DIVR_APB1DIV_2 /* max 104MHz */ #define CLOCK_APB1 (CLOCK_CORECLOCK / 2) #define CLOCK_APB2_DIV RCC_APB2DIVR_APB2DIV_2 /* max 104MHz */ #define CLOCK_APB2 (CLOCK_CORECLOCK / 2) #define CLOCK_APB3_DIV RCC_APB3DIVR_APB3DIV_2 /* max 104MHz */ #define CLOCK_APB3 (CLOCK_CORECLOCK / 2) /* Main PLL factors */ #define CLOCK_PLL_M (2) #define CLOCK_PLL_N (52) #define CLOCK_PLL_P (3) #define CLOCK_PLL_Q (13) /** @} */ This result has been verified with STM32CubeMX, the official ST tool. Signed-off-by: Gilles DOFFE <gilles.doffe@savoirfairelinux.com> |
||
---|---|---|
.. | ||
clk_conf | ||
irqs | ||
kconfig | ||
.gitignore |