We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I'm new to ARM and MDK, so maybe I'm missing something. For the STM32F4xx Discovery board Blinky project, the Target Options tab has a xtal frequency of 25MHz specified. The hardware, of course, has an 8MHz xtal. I assumed (silly me!) that if I altered the options tab to match the hardware, then uV4 would be smart enough to generate a #define HSE_VALUE 8000000 to override the default (25MHz) in stm32F4xx.h. But it seems not, and, of course, all timings in the MCU are wrong. I achieved the desired result by defining it myself in the Compiler tab, but surely it isn't too much to expect uV4 to do it automatically (from the xtal value in the Target tab)?
See, for example, my post of 31-Oct-2002:
http://www.keil.com/forum/1940/
Note, however, that stm32F4xx.h is not a Keil file - it is a 3rd-party file provided by ST.
So it is understable that uVision can't know that an arbitrary, 3rd-party file contains a crystal frequency definition - let alone update it!
Still doesn't excuse Keil for not providing the information - so that 3rd-parties could make use of it.
Out of interest, does anyone know if IAR et al make this kind of thing available?
"Note, however, that stm32F4xx.h is not a Keil file - it is a 3rd-party file provided by ST."
Hmmmm... yes, well... Keil is an ARM company. They know that there are fairly standard startup and configuration files for (at least) the Cortex processors, so I would have expected them to make the effort to support such common features.
i stumbled over the same behavior. but what for is this XTAL value used after all? is it only used for the simulation?
The simulator computes everything - number of core clock cycles/second, baudrate, ... based on this value.