aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/STM32F0xx/hal_lld.c
diff options
context:
space:
mode:
authorRocco Marco Guglielmi <roccomarco.guglielmi@live.com>2016-12-30 15:36:49 +0000
committerRocco Marco Guglielmi <roccomarco.guglielmi@live.com>2016-12-30 15:36:49 +0000
commite6acaa5a460cc42ecd46f650a74312d6293a644c (patch)
treec36d2ef020e534468b4c266970740fb1b85acd81 /os/hal/ports/STM32/STM32F0xx/hal_lld.c
parentd7fcfd351a337677d531dbc67a24566b2d01afb4 (diff)
downloadChibiOS-e6acaa5a460cc42ecd46f650a74312d6293a644c.tar.gz
ChibiOS-e6acaa5a460cc42ecd46f650a74312d6293a644c.tar.bz2
ChibiOS-e6acaa5a460cc42ecd46f650a74312d6293a644c.zip
Fixed Bug #806
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9999 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/STM32/STM32F0xx/hal_lld.c')
-rw-r--r--os/hal/ports/STM32/STM32F0xx/hal_lld.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/os/hal/ports/STM32/STM32F0xx/hal_lld.c b/os/hal/ports/STM32/STM32F0xx/hal_lld.c
index 3422061e3..a85e92ac8 100644
--- a/os/hal/ports/STM32/STM32F0xx/hal_lld.c
+++ b/os/hal/ports/STM32/STM32F0xx/hal_lld.c
@@ -307,9 +307,10 @@ void stm32_clock_init(void) {
#endif
/* Clock settings.*/
+ /* CFGR2 must be configured first since CFGR value could change CFGR2 */
+ RCC->CFGR2 = STM32_PREDIV;
RCC->CFGR = STM32_PLLNODIV | STM32_MCOPRE | STM32_MCOSEL | STM32_PLLMUL |
STM32_PLLSRC | STM32_PPRE | STM32_HPRE;
- RCC->CFGR2 = STM32_PREDIV;
#if STM32_CECSW == STM32_CECSW_OFF
RCC->CFGR3 = STM32_USBSW | STM32_I2C1SW | STM32_USART1SW;
#else