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.
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.