128 Kb CPU hangs up when 128Mhz overclocking is applied STM32103

Post here first, or if you can't find a relevant section!
PIRVCB
Posts: 7
Joined: Wed Jan 27, 2021 11:03 pm

128 Kb CPU hangs up when 128Mhz overclocking is applied STM32103

Post by PIRVCB »

In arduino 1.8.3, when i select the 128 Mhz overclocking option CPU hangs up for 128 Kb memory version; the same code runs ok at 72 legacy frequency. In 64 Kb version, at 128 Mhz, everything is ok.
Both chips are original STM and the Arduino compiler gives back NO ERRORS for both cases.
I cant understand why...
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: 128 Kb CPU hangs up when 128Mhz overclocking is applied STM32103

Post by ag123 »

you are doing what is called binning, if you get a bunch of 100 stm32f103 then try to overclock all of them a certain percentage would probably reach higher speeds, and many won't and st did not promise anything more than the spec speeds.
and desktop cpu manufacturers sells you that extra hz for an extra exorbitant price
(oh thinking about this did it occur to you the 'glamor' factor added by that 'extra' hz cpu that cost a lot 'extra' is to get your 'extra' dollars? :lol: )

and normally when you overclock usb won't work (and maybe other things won't work as well)
to overclock try the stm32f4 series. stm32f4 has a much more flexible clock divisor setup
and overclock is not an 'option', u'd need to learn how to run your mcu at whatever clock speeds u need, if you don't know how to to that you are not quite ready to overclock. i.e. given any board and any external crystal mhz, you can find a clock divisor combo that make the whole thing just works.
those magic are in the 'variants'. real stm32duino hackers don't need 'variants', it is possible to run any board off any mhz crystal in the spec range
Last edited by ag123 on Tue Jun 08, 2021 2:27 pm, edited 2 times in total.
dannyf
Posts: 447
Joined: Sat Jul 04, 2020 7:46 pm

Re: 128 Kb CPU hangs up when 128Mhz overclocking is applied STM32103

Post by dannyf »

NO ERRORS for both cases
the compiler would have no way of knowing if you over-clocked the chip.

I tried this way back but I remember those chips doing no problem in the 90 - 108Mhz territory. 128Mhz might just be too much for a 72Mhz-rated device.

In comparison, PIC32MX (50Mhz rated) could do 60Mhz but craps out at 75Mhz.
AndrewBCN
Posts: 105
Joined: Sun Apr 25, 2021 3:50 pm
Answers: 1
Location: Strasbourg, France

Re: 128 Kb CPU hangs up when 128Mhz overclocking is applied STM32103

Post by AndrewBCN »

PIRVCB wrote: Tue Jun 08, 2021 1:06 pm ... when i select the 128 Mhz overclocking option CPU hangs up
...
I cant understand why...
Here is the datasheet: https://www.st.com/resource/en/datashee ... f103c8.pdf

As far as I can see, overclocking is not supported. :o
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: 128 Kb CPU hangs up when 128Mhz overclocking is applied STM32103

Post by ag123 »

normally one would escape if system clock is marginally higher than spec
e.g. stm32f411 has a spec for 100 mhz max, but if you need usb it is 96 mhz max
stm32f401 has a spec fo 84mhz, i tend to be able to do that stretch for 96mhz, any thing more it breaks.
and for what is worth this is kind of i got a lucky bin of a good mcu :lol:

the record somewhere in the old stm32duino forums is getting something like 500 mflops (yes floating point, whetstone benchmark) running a stm32f407 at 250mhz. for the record stm32f407 is 168 mhz spec (max)
oh and for those interested in those, there is some fun in this thread
viewtopic.php?f=7&t=92

videos that used to wow the crowds are like these
https://www.youtube.com/watch?v=bRNcfsDIc2A
https://www.youtube.com/watch?v=yIm7Yz8Ppeg
https://www.youtube.com/watch?v=0ETyFmAMFjY
that's before the 'arduino' age for a 'micro-controller'
PIRVCB
Posts: 7
Joined: Wed Jan 27, 2021 11:03 pm

Re: 128 Kb CPU hangs up when 128Mhz overclocking is applied STM32103

Post by PIRVCB »

dannyf wrote: Tue Jun 08, 2021 2:19 pm
NO ERRORS for both cases
the compiler would have no way of knowing if you over-clocked the chip.

I tried this way back but I remember those chips doing no problem in the 90 - 108Mhz territory. 128Mhz might just be too much for a 72Mhz-rated device.

In comparison, PIC32MX (50Mhz rated) could do 60Mhz but craps out at 75Mhz.
Thanks for your reply!
Not useless as others.
I'm stating that 64 Kb works ok at 128 Mhz, i'm not asking IF or WHY.
They do the work on my desktop.
I just was asking about difference and cause that 128 Kb doos not the same.
Thanks again!
PIRVCB
Posts: 7
Joined: Wed Jan 27, 2021 11:03 pm

Re: 128 Kb CPU hangs up when 128Mhz overclocking is applied STM32103

Post by PIRVCB »

ag123 wrote: Tue Jun 08, 2021 4:18 pm normally one would escape if system clock is marginally higher than spec
e.g. stm32f411 has a spec for 100 mhz max, but if you need usb it is 96 mhz max
stm32f401 has a spec fo 84mhz, i tend to be able to do that stretch for 96mhz, any thing more it breaks.
and for what is worth this is kind of i got a lucky bin of a good mcu :lol:

the record somewhere in the old stm32duino forums is getting something like 500 mflops (yes floating point, whetstone benchmark) running a stm32f407 at 250mhz. for the record stm32f407 is 168 mhz spec (max)
oh and for those interested in those, there is some fun in this thread
viewtopic.php?f=7&t=92

videos that used to wow the crowds are like these
https://www.youtube.com/watch?v=bRNcfsDIc2A
https://www.youtube.com/watch?v=yIm7Yz8Ppeg
https://www.youtube.com/watch?v=0ETyFmAMFjY
that's before the 'arduino' age for a 'micro-controller'
Well, i'm not so trained in STM world.
I just found a library to build up complex sounds: Mozzi i mean that is ported on STM32 platform.

https://sensorium.github.io/Mozzi/

Becuase of my needs of calculation power, and because i found the STM321038 working up to 128 Mhz, i just tried out to getting 128Kb version and i've found that they dont. I dont care about USB. I just post this question for what it is...
AndrewBCN
Posts: 105
Joined: Sun Apr 25, 2021 3:50 pm
Answers: 1
Location: Strasbourg, France

Re: 128 Kb CPU hangs up when 128Mhz overclocking is applied STM32103

Post by AndrewBCN »

PIRVCB wrote: ... when i select the 128 Mhz overclocking option CPU hangs up
...
I cant understand why...
...
PIRVCB wrote: Tue Jun 08, 2021 4:42 pm ...
I'm stating that 64 Kb works ok at 128 Mhz, i'm not asking IF or WHY.
...
:roll:
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: 128 Kb CPU hangs up when 128Mhz overclocking is applied STM32103

Post by ag123 »

ok here are some suggestions, Mozzi is apparently adapted to run on 'rogers' (libmaple) core on stm32f103
https://github.com/sensorium/Mozzi
however, it isn't adapted for 'new' hardware. e.g. 'steves F4' (which is also in 'rogers') (libmaple) core

if you try to run that on the 'official' stm32duino core, chances are that things will break.
unfortunately, for dsp stuff, a large amount of processing power is required and stm32f103 isn't a best mcu for that.
in fact i'd say go for stm32f405 168mhz, stm32f407 168 mhz or stm32f7 - much higher than that and superscalar
stm32f4xx in addition to more 'hz' has that 'ART accelerator' and *single precision hardware floating point unit* it absolutely blow away every benchmark you can try to do on stm32f103. there is *no way* stm32f103c8 is going to catch up, never mind the 'hz'
take for a simplistic case running from flash maybe takes like 8-10 wait states for codes to run, stm32f4 'ART' accelerator is an on chip cache.
in a lucky case reduce all that 8-10 waits to 0 waits, so even at 84mhz it is 1 clock cycle every instruction and try to divide that by 10 that will get you like 8 mhz at best on stm32f103, and the hardware fpu is probably like 10x speeds doing the same in codes, so if you are able to get both that 10x from ART and another 10x from fpu, that works out to be like 100x in the most lucky scenario. i.e. running single fpu instructions in 1 clock cycle - this is impossible to catch up for hardware without all that. in a real case the true acceleration is much lower than that (cache miss and not everything is just fpu calcs), but still significant.

i'm not too sure if mozzi would run on the stm32f4xx boards with libmaple core. chances are that it would break something at least.
libmaple isn't written to make life easier for users, 'compatibility' is ignored, it is written for 'libmaple hackers' by 'libmaple hackers', moto is keep codes simple no if defs. and only very specific hardware. sometimes it is faster than the official core possibly by chance due to the simplier codes.

but if you need to run anything on different stm32 boards, unfortunately the 'official' stm32duino core probably has the best 'cross soc' support as it uses hal as a base. But chances are that it would be significant porting effort to get mozzi running.

there are apparently many synth projects but hardly any yet on stm32duino
https://www.youtube.com/watch?v=fcLrcDCaI7w
https://github.com/MrBlueXav/Dekrispator_v2
https://github.com/deadsy/googoomuck
https://www.youtube.com/watch?v=SS7UrrUPdn0
https://github.com/laurent-latorre/Synthol
https://github.com/deadsy/googoomuck
there are some which are simply a 'demo' e.g. stm32f7
(there are different interpretations of what it means by 'wavetable' (midi) synth, to some wavetable could mean different combinations of waves.
an ideal case is 'everything is digital' including the patches. then there is also the issue of the number of concurrent polyphonic voices.
all that means needing high raw cpu processing power)
https://www.youtube.com/watch?v=XHbQxqyg31w
another 'demo' stm32f405 + faust
https://www.youtube.com/watch?v=7w-DwwoFKhU
i'd guess 'faust' is this
https://faust.grame.fr/

and perhaps some early attempts in stm32duino
viewtopic.php?t=122

and a most elaborate synthesizer ever !
https://www.youtube.com/watch?v=IvUU8joBb1Q
PIRVCB
Posts: 7
Joined: Wed Jan 27, 2021 11:03 pm

Re: 128 Kb CPU hangs up when 128Mhz overclocking is applied STM32103

Post by PIRVCB »

ag123 wrote: Tue Jun 08, 2021 6:00 pm
ok here are some suggestions, Mozzi is apparently adapted to run on 'rogers' (libmaple) core on stm32f103
https://github.com/sensorium/Mozzi
however, it isn't adapted for 'new' hardware. e.g. 'steves F4' (which is also in 'rogers') (libmaple) core
if you try to run that on the 'official' stm32duino core, chances are that things will break.
Exactly as you told! No F4 adaptation.
ag123 wrote: Tue Jun 08, 2021 6:00 pm
unfortunately, for dsp stuff, a large amount of processing power is required and stm32f103 isn't a best mcu for that.
I dont require so much DSP power, just a little more smoothnes than running it on AVR and a very cheap and small dimensions hardware.
This will be part of an integrated project, it'is not the main goal.
Said this, i thank you to point me in deep and for your linked suggestions, but i already found them.
I'll stay with STM32103 and Mozzi.
I just posted this as try to be lucky!!!
Thnks again for your time.
Davide
Post Reply

Return to “General discussion”