Guide for under- and over-clocking the blue-pill needed

Post here first, or if you can't find a relevant section!
victor_pv
Posts: 1049
Joined: Mon Apr 27, 2015 12:12 pm

Re: Guide for under- and over-clocking the blue-pill needed

Postby victor_pv » Mon Jan 09, 2017 9:38 pm

RogerClark wrote:So its safer to do as @stevstrong has suggested, and document how to overclock, but not put it on a menu where inexperienced users can select, something which makes their system non functional.


I would think this is the best too. Too many options and novices won't know what to use and how it works, then more questions in the forum.
Instead a wiki page anyone can read and follow if they wish, doesn't complicate anything for people that doesn't read it.

stevestrong
Posts: 880
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Guide for under- and over-clocking the blue-pill needed

Postby stevestrong » Wed Jan 11, 2017 10:55 pm

Guys, I have a strange behavior here.
I follow the guide to set the CPU to 80MHz, only using different settings in boards.txt, restarting the IDE each time, having correct multipliers for RCC

Code: Select all

  #if F_CPU==96000000
   #define BOARD_RCC_PLLMUL RCC_PLLMUL_12
  #elif F_CPU==88000000
   #define BOARD_RCC_PLLMUL RCC_PLLMUL_11
  #elif F_CPU==80000000
   #define BOARD_RCC_PLLMUL RCC_PLLMUL_10
  #elif F_CPU==72000000
   #define BOARD_RCC_PLLMUL RCC_PLLMUL_9
  #elif F_CPU==64000000
   #define BOARD_RCC_PLLMUL RCC_PLLMUL_8
  #elif F_CPU==56000000
   #define BOARD_RCC_PLLMUL RCC_PLLMUL_7
  #elif F_CPU==48000000
   #define BOARD_RCC_PLLMUL RCC_PLLMUL_6

The SPI clock frequency is settled to 20 MHz. :o
I set the CPU back to 72 MHz. The SPI goes to 36 MHz. OK.
I set the CPU to 88 MHz, SPI -> 22 MHz :o :o

So with any CPU clock above 72MHz will get an SPI clock set only to half of the expected one. I assume the CPU is also running with half of the expected frequency. Flash wait states was set to 2.

What a hell is going on here?
Last edited by stevestrong on Wed Jan 11, 2017 11:34 pm, edited 2 times in total.

User avatar
RogerClark
Posts: 5470
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: Guide for under- and over-clocking the blue-pill needed

Postby RogerClark » Wed Jan 11, 2017 11:11 pm

@stevstrong

I think you'd need to test the speed in some other way, e.g. toggle a gpio in loop or perhaps run the dhrystone test to confirm CPU clock frequency.

I think Pito successfully overclocked his STM32's. I've definitely done it with the GD32 and looked at the dhrystone test to confirm it

stevestrong
Posts: 880
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Guide for under- and over-clocking the blue-pill needed

Postby stevestrong » Wed Jan 11, 2017 11:22 pm

OK, so the CPU frequency seems to be the one set, bit toggle checked with scope.
The SPI frequency does not. The funny thing is that it worked before I tried to play with the flash wait states.. is the pill tired?

stevestrong
Posts: 880
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Guide for under- and over-clocking the blue-pill needed

Postby stevestrong » Wed Jan 11, 2017 11:40 pm

OK, it's me...
I only forgot to change the frequency in the SPI.beginTransaction() part...
So I better go sleep now, before I "invent" some other non-existing self-generated issues...

User avatar
Pito
Posts: 797
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Guide for under- and over-clocking the blue-pill needed

Postby Pito » Thu Jan 12, 2017 8:33 am

Yes, my 103ZET6 has been working few days 128MHz fine. Even from EXRAM.
When you change F_CPU, the SPI clock must change when the sketch's SPI settings are left untouched.
Mind the 36MHz SPI is already "overclocked". So 64MHz SPI with 128MHz F_CPU will most probably not work - try.

stevestrong
Posts: 880
Joined: Mon Oct 19, 2015 12:06 am
Location: Munich, Germany

Re: Guide for under- and over-clocking the blue-pill needed

Postby stevestrong » Thu Jan 12, 2017 12:40 pm

36 MHz SPI_1 is "normal", and it works.
Pito wrote:So 64MHz SPI with 128MHz F_CPU will most probably not work - try.

I have tried. It also works. ;)

User avatar
Pito
Posts: 797
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Guide for under- and over-clocking the blue-pill needed

Postby Pito » Thu Jan 12, 2017 1:04 pm

Fantastic :!: :!: :!:
Now, how to force my Sdcard to follow :)

racemaniac
Posts: 342
Joined: Sat Nov 07, 2015 9:09 am

Re: Guide for under- and over-clocking the blue-pill needed

Postby racemaniac » Thu Jan 12, 2017 2:17 pm

Pito wrote:Fantastic :!: :!: :!:
Now, how to force my Sdcard to follow :)

see if it has a tiny turbo button somewhere. if i remember anything from my 286-386-486 youth, it's that the turbo button solves any speed related problems :).

User avatar
Pito
Posts: 797
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: Guide for under- and over-clocking the blue-pill needed

Postby Pito » Thu Jan 12, 2017 8:21 pm

Nope, in past the Reset button solved all the problems.. :)
Yea, I can remember that button too, not sure my Sdcard does..

Few months back I had a good discussion with BillG (SdFat's author) and I pushed him to introduce CMD6 command (switching high speed mode on) for the new Sdcards (like CL10, UHS-I), but at the end of the day he decided not to do as the cards can work 50MHz without CMD6 (moreover we did not see the CMD6 to be really switched on). He also claimed somebody ran Sdcard at 80MHz with ESP8266..
So we must elaborate, 64MHz SPI with an sdcard could be nice to have :)


Return to “General discussion”

Who is online

Users browsing this forum: Bing [Bot], ddrown and 1 guest