Collecting Energy Results with the Automated Test Framework
ARM (stm32vl):
1. Firstly you'll need to download the energy monitor, test framework, and benchmarks.
git clone https://github.com/jpallister/stm32f4-energy-monitor git clone https://github.com/mageec/benchmark-framework git clone https://github.com/mageec/lowpower-benchmarks
2. Next we'll compile the energy monitor firmware, and put it onto the STM32F4 board.
cd stm32f4-energy-monitor make energy_monitor
Now plug in the F4 board via the mini USB port. Start stlink (in a different terminal window):
st-util
Back in energy monitor terminal window, start ARM's GDB, and flash the energy monitor firmware onto the board:
arm-none-eabi-gdb target extended :4242 file energy_monitor monitor reset halt load
Now press the black reset button on the board, then quit GDB.
quit
You could now continue using the board with it plugged in, but it's easier to remove everything before you move on. Unplug the F4 board, and quit stlink. Now plug the F4 board back in, this time with both USBs.
3. Next we'll build the host receiver module for the GDB runner of the test framework.
cd host ./configure --with-python=/path/to/python3 make
(Where /path/to/python3 is the path to your Python 3 binary.
The python module is built into ./.libs as 'pyenergy.so'. Copy this file into the directory that contains the test framework's GDB runners.
cp .libs/pyenergy.so ../../benchmark-framework/src/gdb_runners/
4. Next we'll set up the STM32VL board. This is just a case of plugging in the board, and then running stlink.
st-util -1
(We need to use -1 to force stlink to connect to the VL board, instead of the F4 board)
5. Now we're going to start setting up the test framework.
5.1. Firstly, change the Pyro HMAC key in src/gdb_manager.py and all gdb runners in src/gdb_runners. Then tell the Pyro nameserver to use this key.
export PYRO_HMAC_KEY=<HMAC key>
(Where <HMAC key> is the key you've just put into the GDB manager and GDB runners.)
Then start the Pyro nameserver.
python -m Pyro4.naming
5.2. Now start up the ARM GDB runner.
cd benchmark-framework/src/gdb_runners/ arm-none-eabi-gdb "-ex=source arm_runner.py"
6. Finally, we'll start up the framework and collect our results.
cd lowpower-benchmarks python3 ../benchmark-framework/src/framework.py
The log file is saved in the current directory. By default, the database is saved in the benchmark-framework/db directory, as development.sqlite3.