Page 1 of 1

Demo for STM32F2 doesn't complie

Posted: Fri Feb 14, 2014 11:50 am
by part1zan_
I'm trying to build an STM32F205VCT6-supporting binary. Using a demo for an STM32F4Discovery (slightly modified though), I get the following errors:

Code: Select all

Compiling test.c
In file included from ChibiOS-RT/os/hal/include/hal.h:36,
                 from ChibiOS-RT/test/test.c:26:
ChibiOS-RT/os/hal/platforms/STM32F4xx/hal_lld.h:1337:2: error: #error "STM32_PLLCLKOUT outside acceptable range (STM32_PLLOUT_MIN...STM32_PLLOUT_MAX)"
ChibiOS-RT/os/hal/platforms/STM32F4xx/hal_lld.h:1357:2: error: #error "STM32_SYSCLK above maximum rated frequency (STM32_SYSCLK_MAX)"
ChibiOS-RT/os/hal/platforms/STM32F4xx/hal_lld.h:1426:2: error: #error "STM32_HCLK exceeding maximum frequency (STM32_SYSCLK_MAX)"
ChibiOS-RT/os/hal/platforms/STM32F4xx/hal_lld.h:1450:2: error: #error "STM32_PCLK1 exceeding maximum frequency (STM32_PCLK1_MAX)"
ChibiOS-RT/os/hal/platforms/STM32F4xx/hal_lld.h:1474:2: error: #error "STM32_PCLK2 exceeding maximum frequency (STM32_PCLK2_MAX)"
make: *** [build/obj/test.o] Error 1

I slightly modified Makefile and board.h to fit the change from STM32F4 to STM32F2, yet I get the errors. What can I do to fix that?

Re: Demo for STM32F2 doesn't complie

Posted: Fri Feb 14, 2014 12:17 pm
by Giovanni
Edit mcuconf.h in ordet to obtain frequencies compatible with the F2. The maximum is 120mhz for that one.

Giovanni

Re: Demo for STM32F2 doesn't complie

Posted: Fri Feb 14, 2014 12:46 pm
by part1zan_
Hm, could you tell me which values in mcuconf.h I should change?

Re: Demo for STM32F2 doesn't complie

Posted: Fri Feb 14, 2014 1:28 pm
by Giovanni
Try

#define STM32_PLLN_VALUE 240

#define STM32_PLLQ_VALUE 5

Giovanni

Re: Demo for STM32F2 doesn't complie

Posted: Fri Feb 14, 2014 1:52 pm
by part1zan_
It worked, thank you very much.