cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F407 > STM32F427 MIGRATION

jean_prieur
Associate III
Posted on July 08, 2014 at 17:39

Hi everybody!

I want to migrate from STM32F407 to STM32F427, and use the full power of this microprocessor (180MHz instead of 168MHz), because I need more speed ressources.

First, I find this new application note:

http://www.st.com/web/en/resource/technical/document/application_note/DM00123028.pdf

Do you know what is the frequency overdrive mode ?

Secondly, I want to set the new maximum frequency on my project (I already use a STM32F427 but at lower frequency). I use an external oscillator of 8MHz.

I use this clock parameters for the moment:

SystemCoreClock = 168000000;

 

PLL_M  = 8

 

PLL_N  = 336

 

PLL_P  = 2

 

PLL_Q  = 7

 

AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};

 

HSE_VALUE = 8000000

 

Can I only change the parameter 

SystemCoreClock

to

180000000

? Because it works but I don't know if the speed of core change.

Thank you very much!

20 REPLIES 20
schauer
Associate II
Posted on July 08, 2014 at 18:06

Hi jean,

simply set

PLL_N = 360

the SystemCoreClock should be updated by the library. Please remember that it is required to enable overdrive mode when operating at more than 168MHz!

The overdrive mode is, as far as i understand what's written in the user manual, an operation mode of the internal voltage regulator. See RM0090 for details.

Hope that helps,

bs

jean_prieur
Associate III
Posted on July 08, 2014 at 18:45

Hi and thanks!

I set PLL_N to 360 and it everything works. Indeed in my case (HSE / PLL_M) * PLL_N / PLL_P = 180MHz

I also needed to set PLL_Q = 8 to configure the right speed for my USB isn't it ?

------

About the over-drive, I find that on the ST app note: It is recommended to enter Over-drive mode when the application is not running critical tasks and when the system clock source is either HSI or HSE.

In my case, the system clock source is HSE = 8MHz? So I can pretend to enable Over-drive?

There is something I can't understand... To work at 180Mhz, I need to enable over-drive, it's required. Because for the moment overdrive is not enable, what is actually the real speed of my core?
Posted on July 08, 2014 at 20:13

USB isn't going to work natively if you clock the core at 180 MHz.

You might be able to clock it with a HS PHY, but I haven't done that experiment.

You're not running the part AT the HSE frequency, when you run it AT 180 MHz you SHOULD enable the over-drive mode, presumably because the switch currents are significantly higher there, or it needs some different filtering.

You probably don't have a full set of peripherals running either, the over-drive is likely important when you get closer to the operating boundaries.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jean_prieur
Associate III
Posted on July 09, 2014 at 10:54

This is the way to enter over-drive mode:

To enter Over-drive mode, follow the sequence below:

 

1. Select HSI or HSE as system clock.

 

2. Configure RCC_PLLCFGR register and set PLLON bit of RCC_CR register.

 

3. Set ODEN bit of PWR_CR register to enable the Over-drive mode and wait for the 

 

ODRDY flag to be set in the PWR_CSR register.

 

4. Set the ODSW bit in the PWR_CR register to switch the voltage regulator from Normal 

 

mode to Over-drive mode. The System will be stalled during the switch but the PLL 

 

clock system will be still running during locking phase.

 

5. Wait for the ODSWRDY flag in the PWR_CSR to be set.

 

6. Select the required Flash latency as well as AHB and APB prescalers.

 

7. Wait for PLL lock.

 

8. Switch the system clock to the PLL.

 

9. Enable the peripherals that are not generated by the System PLL (I2S clock, LCD-TFT 

 

clock, SAI1 clock, USB_48MHz clock....).

 

I think this is out of reach for me... And it seems that not a lot of people have achieved this function. So when ST indicates ''STM32F427 - 180MHz microprocessor'' it's a little bit untruth isn't it?

-------------------------------

Anyway, I set SystemCoreClock = 180MHz and PLL_N = 360

- If PLL_Q = 7, the USB com is not working in my case, my computer can't detect it (USB clock = PLL_VCO / PLL_Q = 360Mhz / 7 = 51,4Mhz)

- If PLL_Q = 8, the USB is working, my computer can interact with it (USB clock = 360Mhz / 8 = 45Mhz)

Do you know how I can increase the speed of the USB, because the USB clock can support 48Mhz?
jean_prieur
Associate III
Posted on July 09, 2014 at 12:52

Hello,

In fact the USB com behavior is a little bit random in my config (USB clock 45Mhz). I think USB clock have to be 48Mhz.

Any solution to fix my problem ?

Thanks !
Posted on July 09, 2014 at 13:34

Like I said you could try using an external PHY via the ULPI

The 48 MHz issues has been brought up several times, the PLL48CK comes off the System PLL Q Tap.

The Reference Manual (RM0090 Rev7 May 2014) mentions USB_48MHz a couple of times, and that it's not off the System PLL, but it's NEVER actually documented or described anywhere.

I've never got a satisfactory answer about USB at 180 MHz. This doesn't of course preclude anyone from running the part at 180 MHz for application which don't use USB, which is likely a significant portion of the market.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on July 09, 2014 at 13:39

Pushed to moderation

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on July 09, 2014 at 13:57

I think this is out of reach for me... And it seems that not a lot of people have achieved this function. So when ST indicates ''STM32F427 - 180MHz microprocessor'' it's a little bit untruth isn't it?

This is ALL handled in the system_stm32f4xx.c code that's appropriate for your part, like the code in the STM32F4 Firmware/DSP Library 1.3

The processor does work at 180 MHz (and beyond), so don't confuse what you're doing, with the entirety of the market.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jean_prieur
Associate III
Posted on July 09, 2014 at 14:02

Ok thanks I understand.

Another solution is to overclock the STM32F4?

I try to set 

SystemCoreClock = 192MHz

 and 

PLL_N = 384 

in order to have a USB clock = 384 / 8 = 48Mhz, and now USB is perfectly working.

How dangerous is this overclocking ?