STM32 Speed

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

Post Reply
Kisen
Posts: 73
Joined: Fri Jan 24, 2020 10:38 am
Has thanked: 4 times
Been thanked: 2 times
Contact:

STM32 Speed

Post by Kisen »

Hi,

I am working with a STM32F411. I have up to now been working with it set up with no PLL and external osc @ 16Mhz. This works perfectly, LED flashing etc

I am having some issues with the i2c hardware component (i dont seem to be able to get it to work) so i thought i will increase the oscillator speed so that the software i2c essentially runs faster (or so i thought)

Following the settings found online, i have apparently set my speed up to 96Mhz?? But because i still have the oscillator speed set to 16Mhz in the setup (it wont allow me to set it to 96Mhz) the speed of the program doesnt appear to change.

Is there any way i can see what speed the core is actually running at?

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: STM32 Speed

Post by LeighM »

For ST ARM projects the setting of “Build->Project Options->Clock Speed” should be set to the source (e.g. external crystal) frequency
(not any of the internal system clock frequency)
You can check the HCLK frequency at run time by using the C code function HAL_RCC_GetHCLKFreq().
For example, create a global ULONG variable named FREQ, then add the following in a C code icon

Code: Select all

FCV_FREQ = HAL_RCC_GetHCLKFreq();

Alkaline
Posts: 143
Joined: Mon Aug 20, 2018 11:04 am
Has thanked: 42 times
Been thanked: 41 times
Contact:

Re: STM32 Speed

Post by Alkaline »

Hello

I played with the stm32 family and saw that the speed of the i2c software increased up to a certain speed.

What clock speed are you getting on the i2c bus?

Kisen
Posts: 73
Joined: Fri Jan 24, 2020 10:38 am
Has thanked: 4 times
Been thanked: 2 times
Contact:

Re: STM32 Speed

Post by Kisen »

I have used the HAL function. Im getting back 84Mhz.
Alkaline wrote:
Wed Jun 24, 2020 4:05 pm
Hello

I played with the stm32 family and saw that the speed of the i2c software increased up to a certain speed.

What clock speed are you getting on the i2c bus?
Im not sure what i am getting on the i2c bus. Its bitbanged at the moment so i dont expect fantastic speeds. I will need to scope the clock line at some point and see what its putting out.

Post Reply