IOsetting / hk32f030m-template

HSXP HK32F030M template project for GNU Arm Embedded Toolchain
Apache License 2.0
32 stars 3 forks source link

Fix excessive flash wait states #4

Closed deividAlfa closed 1 year ago

deividAlfa commented 1 year ago

The Datasheet specifies: <=16MHz : 0 wait states <=32MHz : 1 wait states

SetSysClockToHSI*** functions were using excessive values. This MCU doesn't have prefetch at all, so wait states hurt the performance seriously. Interestingly, SetSysClockToEXTCLK is using the correct values. I've tested zero wait states @ 32MHz, but better stick with the official specs.

IOsetting commented 1 year ago

Thank you, I will merge this.