Hi,
I am trying to get an Olimex board (STM32_E407 Rev.F) going.
I have copied the demo files for the RT_STM32F407-DISCOVERY to RT_STM32F407-OLIMEX (in the same directory) and changed one Makefile entry to:
"include $(CHIBIOS)/os/hal/boards/OLIMEX_STM32_E407/board.mk".
Attempting to compile, the following is reported:
Compiling crt0_v7m.S
Compiling vectors.S
Compiling chcoreasm_v7m.S
Compiling crt1.c
Compiling hal.c
In file included from ../../../os/hal/include/hal.h:114,
from ../../../os/hal/src/hal.c:25:
../../../os/hal/ports/STM32/STM32F4xx/hal_lld.h:1374:2: error: #error "STM32_PLLVCO outside acceptable range (STM32_PLLVCO_MIN...STM32_PLLVCO_MAX)"
#error "STM32_PLLVCO outside acceptable range (STM32_PLLVCO_MIN...STM32_PLLVCO_MAX)"
^~~~~
and several more - all to do with PLL speed.
I am new to both Chibios and to ARM Cortex M4 processors (but quite experienced in C & Linux).
I suppose there is a config somewhere but trying to trace the 'defines backwards is quite hard.
I am running ChibiOS_18.2.1 on OpenSUSE Leap 15.0.
I would be grateful for a pointer or two as to where I should correct the clock problem.
Many thanks,
Bob von Knobloch
Clock arrangemants for STM32-F407
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Clock arrangemants for STM32-F407
Hi,
Clock settings are in two places:
board.h defines the clocks of the external oscillators
mcuconf.h contains the settings of PLLs, dividers, muxes etc which depend on values defined in board.h.
Make sure that:
1) Board.h is appropriate for your board (look at frequencies).
2) The settings in mcuconf.h are appropriate for frequencies defined in board.h.
Short version: take Makefile and mcuconf.h file from a demo for your board.
Giovanni
Clock settings are in two places:
board.h defines the clocks of the external oscillators
mcuconf.h contains the settings of PLLs, dividers, muxes etc which depend on values defined in board.h.
Make sure that:
1) Board.h is appropriate for your board (look at frequencies).
2) The settings in mcuconf.h are appropriate for frequencies defined in board.h.
Short version: take Makefile and mcuconf.h file from a demo for your board.
Giovanni
-
- Posts: 4
- Joined: Wed Jan 02, 2019 11:12 am
Re: Clock arrangemants for STM32-F407
OK thanks, I will look at mcuconf.h (that may be the piece I was missing - thanks).
Short version: would love to, but you don't appear to have a demo for this board.
Best wishes,
Bob
Short version: would love to, but you don't appear to have a demo for this board.
Best wishes,
Bob
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: Clock arrangemants for STM32-F407
Hi,
You need to change the PLL input divider if the xtal frequency is different, everything else should be fine.
Giovanni
You need to change the PLL input divider if the xtal frequency is different, everything else should be fine.
Giovanni
-
- Posts: 4
- Joined: Wed Jan 02, 2019 11:12 am
Re: Clock arrangemants for STM32-F407
Hi Giovanni,
In "mcuconf.h", I changed the entry "#define STM32_PLLM_VALUE" to 12 (was 8 in the demo, the ST board is 8MHz; the Olimex board is 12MHz) but still have the same error.
Any suggestions (am I using the right entry)?
Best wishes,
Bob
In "mcuconf.h", I changed the entry "#define STM32_PLLM_VALUE" to 12 (was 8 in the demo, the ST board is 8MHz; the Olimex board is 12MHz) but still have the same error.
Any suggestions (am I using the right entry)?
Best wishes,
Bob
Re: Clock arrangemants for STM32-F407
These are the values I use for the Olimex board (on Chibi 17.6, but doubt anything's changed):
...and in board.h:
Code: Select all
/* Settings for Olimex E407 (12MHz crystal) */
#define STM32_PLLM_VALUE 12 /* PLL input prescaler - gives 1MHz into PLL */
#define STM32_PLLN_VALUE 336 /* PLL multiplier for VCO clock - gives 336MHz */
#define STM32_PLLP_VALUE 2 /* PLL clock output divider - 168MHz */
#define STM32_PLLQ_VALUE 7 /* Nominal 48MHz clock divider - 48MHz */
...and in board.h:
Code: Select all
#if !defined(STM32_HSECLK)
#define STM32_HSECLK 12000000U
#endif
/*
* Board voltages.
* Required for performance limits calculation.
*/
#define STM32_VDD 330U
-
- Posts: 4
- Joined: Wed Jan 02, 2019 11:12 am
Re: Clock arrangemants for STM32-F407
Thanks SteveD,
all working now - I just had to adjust the ports in main.c
Best wishes,
Bob
all working now - I just had to adjust the ports in main.c
Best wishes,
Bob
Who is online
Users browsing this forum: No registered users and 13 guests