Tool/software:
Hello,
I have a core that runs a control loop using an EPWM interrupt plus other interrupts and ISRs.
I would like to measure the time spent in idle (i.e. not in the ISRs or any other code) in order to calculate CPU load.
The idea was to use WFI to measure the uninterrupted time as follows:
/* Record when uC goes to idle using a free run timer. */ wfi_ticks_start = CycleCounterP_getCount32(); /* Wait here until an interrupt occurs. WFI: Wait-For-Interrupt. */ CSL_armR5SetWFIMode(); /* If here, an interrupt has occurred. */ wfi_ticks_end = CycleCounterP_getCount32(); wfi_ticks = wfi_ticks_end - wfi_ticks_start;
However, the value of wfi_ticks is too small to be plausible. I suspect that when in low power mode (WFI), the cycle counter is also stopped giving low return values for CycleCounterP_getCount32().
<Q> Does the clock source for CycleCounterP_getCount32() stop when WFI is executed?
Thank you.