Re: STM32F4 clock problem


Andreas Kölbl <andreas.koelbl@...>
 

This works, thanks a lot. I will work on a patch fixing this issue in
the defconfig of stm32f4_disco.

Am 31.07.2017 um 15:08 schrieb Yannis Damigos:

On Fri, Jul 28, 2017 at 10:54 AM, Andreas Kölbl
<andreas.koelbl@st.oth-regensburg.de> wrote:
Hello,

I'm quite new to zephyr and I'm working on a stm32f4_discovery board
(defconfig).
I tried the blinky application from examples (enabled the corresponding
GPIO in the config).
I didn't change the base clock setup from the configuration. With that,
I discovered the k_sleep interval is kind of wrong. It sleeps about 3,5
times longer than it should be.

I also tried another GPIO-Pin (PB8) to toggle instead of the LED in the
example and measured the frequency with a scope. It measured an
frequency (ACTIVE_HIGH->ACTIVE_HIGH) of 214.09mHz which should be 500mHz.

Am I missing something here?
Hi Andreas,

The default values could be wrong. Using the Clock configuration tool
for STM32F40x/41x microcontrollers (AN3988) from
http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-configurators-and-code-generators/stsw-stm32091.html,
the default values should be:

# Clock configuration for Cube Clock control driver
CONFIG_CLOCK_STM32_HSE_CLOCK=8000000
CONFIG_CLOCK_STM32_SYSCLK_SRC_PLL=y
# use HSE as PLL input
CONFIG_CLOCK_STM32_PLL_SRC_HSE=y
# produce 168MHz clock at PLL output
CONFIG_CLOCK_STM32_PLL_M_DIVISOR=8
CONFIG_CLOCK_STM32_PLL_N_MULTIPLIER=336
CONFIG_CLOCK_STM32_PLL_P_DIVISOR=2
CONFIG_CLOCK_STM32_PLL_Q_DIVISOR=7
CONFIG_CLOCK_STM32_AHB_PRESCALER=1
CONFIG_CLOCK_STM32_APB1_PRESCALER=4
CONFIG_CLOCK_STM32_APB2_PRESCALER=2

I don't have the hardware, could you test the above values?

Yannis



--
Andreas Kölbl

_______________________________________________
Zephyr-users mailing list
Zephyr-users@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-users

Join users@lists.zephyrproject.org to automatically receive all group messages.