How to determine CPU load stm32h743?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-05-21 2:21 AM
Hi.
I need to estimate the cpu load and output the data as a percentage to a variable ram and to an LED. I use stm 32h 743. The microcontroller works without sleep. It is advisable to make accounting and interruptions. Can you suggest a solution?
Labels:
- Labels:
-
STM32H7 Series
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-05-21 5:36 AM
One way is to use a software counter. Pseudocode:
volatile uint32_t x = 0;
uint32_t start_tick = TICKS;
while (last_tick - TICKS < DURATION) {
++x;
}
Run that under idle conditions to establish a baseline, then run it under load conditions with other interrupts happening. Under 50% load, your final value for x will be half of the idle/baseline value.
If you feel a post has answered your question, please click "Accept as Solution".
