This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

CPU load (with SD) ?

Hello,

Is there any way to know CPU load (active vs sleep time) ?

  • The idea is good, the difficulty is the precision of the measure and the current consumption pattern. Advanced improvements in your code modify current for the last micro ampers and current is not constant versus time so you have to integrate current (because voltage is just a quasi constant factor here) to get energy consumption or mean power (if you divide by time). Next thing you have to substract consumptions of RF frontend, ... there could be higher (when your code load is low) and not defined with enough precision so you are looking at a candle near the sun :-)

  • So using a CPU load indicator could be easier to deploy and you can store it for different situations in a log.

  • Some CPU have a debug current probe integrated, maybe it's a good idea for a future nRF53 :-)

  • I still don't get it. What special "load" you have in mind? If I get it right this isn't anything like ARM Cortex-A or x86/AMD64 with out-of-order execution, variable clock, multicore, turbo etc. Here once the CPU works it executes the instructions pretty much linearly at constant clock. So the power consumption depends only on peripherals turned on (and I guess only radio have really dynamic power characteristic, right?). So unless your code has some disturbing busy wait loops it should be easy to see from the power consumption when you execute the code (= CPU is 100% busy) and when you go to sleep (assuming you use this standard architecture of asynchronous event-based BLE app with just app_sd_evt_wait() - or directly WFE - in the main program loop). Or you want to filter SoftDevice processing out of it?

  • Load is active time divided by total time (active + idle / sleep). You are right but in application, you cannot monitor sd activity (sd interrupts are at a higher level) so i need nordic to manage it.

Related