Using Python and Segger command line tools to automate the compilation of executables, programming the embedded device, and measuring the execution timing and energy of a code of interest in embedded C. The energy was mesaured in joules using Joulescope. The timing was measured in number of CPU cycles using the Debug Watchpoint and Trace (DWT) unit in an ARM-based SoC. This number is then divided by the device’s operating frequency to get the execution time in seconds.
The power supply used in the above picture, on the mid-left with a small display, is the one from a previous project - Build a Power Supply Monitoring and Control System.
The automation of the measurement is carried out using Python, which also stores the collected data in a database using local MongoDB instance for data logging purposes.