cancel
Showing results for 
Search instead for 
Did you mean: 

improving progam executiion speed

KumarTP
Associate II

To improve the execution time of a program being run on the board 'Nucleo-439ZI' from the current 20 ms period to less than 1 ms [more than 20 times reduction]. To reduce the same, I tried to switch the clock frequency source of the timer to HSE (8 MHz) instead of the internal clock (32.768KHz) [That means 24 times higher frequency to improve system latency ]. However, some issues are observed when tried by clicking 'Resolve Clock Issues' could not be resolved.

 

How can I improve execution time from 20ms to 1 ms?

34 REPLIES 34

@Andrew Neil 

No, even you select HSI as clock source (16MHz) you get the same warning. So it's not related to the PLL.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

@SofLit wrote:

@KumarTP You need to disable USB and ETH in your ioc file to reach lower frequencies, as these peripherals need at least 25MHz for HCLK to work correctly.


But the goal was to speed things up - so the lower limit shouldn't be a problem to @KumarTP  ?

Yes but, in the middle of the discussion he raised an issue when he switches to HSE (@8MHz) which is related to min HCLK clock.

But frankly from my side I didn't catch yet the problem from his first post (confused with the wording "timer" and internal clock at 32.768KHz).

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

KumarTP_0-1707318426372.png

HSE clock-related issue is resolved, missed to connect the oscillator external to the board.

there is issue with 'HSI (High-Speed Internal)' which is 32MHz would that give better execution time?

KumarTP_1-1707318644168.png

 

 

SofLit
ST Employee

Again the pictures you are sharing have poor resolutions we can't see what is going on. If you can't please share again the ioc file showing these warnings.

Please share readable images.

Also you can click on the boxes in RED to show the warning(s).

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

@KumarTP wrote:

there is issue with 'HSI (High-Speed Internal)' which is 32MHz 


Again, you're going to have to tell us what, exactly, the issue is before anyone can help you with that!

You've seen how the configuration editor tells you what the issue is - in a pop-up - so pay attention to what that pop-up says.

 


@KumarTP wrote:

would that give better execution time?


Again, that depends on what's slowing-down your code - so impossible to say.

See earlier replies:

https://community.st.com/t5/stm32-mcus-boards-and-hardware/improving-progam-executiion-speed/m-p/636837/highlight/true#M17052

And:

https://community.st.com/t5/stm32-mcus-boards-and-hardware/improving-progam-executiion-speed/m-p/636880/highlight/true#M17059

 

LCE
Principal

@KumarTP There are really some pros here at work to help you, but as they all pointed out, your basic problem description is still rather cryptic.

What do you exactly mean with "execution time", or of what?

So, which peripherals are you using?

Which clock speed do you need or expect, SYSCLK for the CPU, which for the peripherals? 

Note: for a few peripherals / applications HSI might be too inaccurate or jittery.

I wish someone could clearly articulate what the problem is here, and where the 32.768 KHz LSE (32 KHz of the LSI) would be involved.

TIM5 can be used to measure LSI/LSE, but not as a source

TIM11 can be used related to HSE_RTC (1 MHz)

Still have no-idea "what" is taking 20 ms, its relationship to the MCU clock, or if 1 ms is remotely realistic.

If it takes 20 ms at 168-180 MHz the F439 normally clocks, there's going to need to be a better explanation of the task being performed, perhaps from the driving requirement rather than the current deficient solution.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Please find the clk settings.

 

LCE
Principal

Sigh...

Now you post a pdf including another low resolution picture.

Which still shows that there might be some bad clock settings.

Start reading the datasheet and reference manual about possible PLL settings, compare to the code that Cube throws out.

And what about "execution time 20 ms"?