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
Evangelist III

@KumarTP wrote:

 some issues are observed when tried by clicking 'Resolve Clock Issues' could not be resolved.


Well, nobody can help you there without knowing what, exactly, those issues were!

 


@KumarTP wrote:

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


first you need to know what's taking all the time!

If it's in busy-wait loops, or similar, then no amount of speeding up the clock is going to help.

FBL
ST Employee

Hello @KumarTP 

Would you share your IOC file in .text format? or maybe a screenshot of your clock tree would be sufficient. 

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.

Please find the below screenshots

KumarTP_0-1707300289873.png

 

KumarTP_1-1707300321752.png


 
64 KB of 113 KB

 

 

 

Screenshots not clear.. Please share better image resolution.

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.

As @SofLit said, those screenshots are too low resolution.

However, I think the fact that there are RED boxes in the first one suggests that you have exceeded the maximum limits at those points?

Pretty sure it's not going to be running off the 32 KHz HSI source.

For order of magnitude improvements you might need to change your approach.

You have not articulated your problem well, or illustrated it clearly. Try harder.

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 attached IOC

Thank you for the sharing. But the errors are not shown in the shared ioc file!

Also I didn't catch what do you want to do:


@KumarTP wrote:

I tried to switch the clock frequency source of the timer to HSE (8 MHz) instead of the internal clock (32.768KHz)


Which timer? 

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.

error occurred after I tried to switch the clock frequency source of the timer to HSE (8 MHz) instead of the internal clock (32.768KHz).

I need this program is to be executed in 1ms can I achieve that, How can I do that? Please advise.