2014-09-10 07:44 AM
I have developed a simple application to test GPIOs, SPI, UART on the STM32F4 Discovery dev board (a modified demo application from the included Discovery demo V1.1.0). The demo application uses the STM32F4xx_StdPeriph_Driver.
I'm now trying to transition this code to a custom PCB that has a very similar STM32F427VIT6 processor, but a 19.2MHz external OSC instead of a 8MHz on the Discovery board.I've changed the target device in compiler settings.Could somebody help me with changing the clock frequency and the required PLL settings in order for my firmware to work with this new device. I'm just not sure where the clock configuration is set in code, and what the ''speed limits'' are. The code is just for hardware verification so ''max speed'' is not required.I'm using IAR embedded workbench IDE.I've tried generating a new project with the STM32cube application, and it does work, compile, LEDs blink, clocks are set correctly. Problem is that the STM32cube application includes a HAL driver library which is not easily compatible with the code I already have written using the STM32F4xx_StdPeriph_Driver.Thank you,Boris.2014-09-10 08:00 AM
I'm not using HAL/CUBE, for the Standard Peripheral Library the code you need is in system_stm32f4xx.c
The limits of the PLL are described in the Reference Manual, you should review these. They do have an Excel sheet to compute these things, but it's not that difficult. The key fact probably is the comparison frequency for the PLL should be in the 1-2 MHz range. I'd suggest a PLL_M of 18 for a fComp of 1.0667 MHz, a PLL_N of 315 for a processor speed of 168 MHz Alternatively 19, 332 for 167.7474 MHz2014-09-10 12:15 PM
2014-09-10 12:53 PM
The part is not rated to run at 192 MHz!?
For the baud rate it suggests the define for HSE_VALUE is wrong, ie 8000000 and not 192000002014-09-11 07:32 AM
How did the 192MHz number come up?
I've included a screen shot of the clock config tool.Shouldn't the HSE_VALUE match the actual oscillator frequency or you are saying that the UART library only expects a 8MHz external OSC?