Starting an Energy Analysis Session#

An energy analysis session can be started from either the Simplicity IDE Perspective or from the Energy Profiler.

From the Simplicity IDE Perspective#

Some Silicon Labs SDKs contain examples that are pre-configured to deliver energy profiling data to the Energy Profiler. In the Simplicity Studio Launcher perspective, you can find example titles such as "Powertest" or "Energy modes" or "Emode" for many development kits. In the figure below, the selected device is an EFR32 development kit. The Flex SDK has been installed.

energy prof examplesenergy prof examples

Create an example (in this case Flex(RAIL) - Energy Mode). Because this is a RAIL example, the Simplicity IDE perspective opens with the Radio Configurator open. If this is an AppBuilder project, click Generate.

Right-click the project directory. In the context menu select Profile As > Simplicity Energy Profiler Target.

energy prof build projectenergy prof build project

SSv5 then:

  1. Rebuilds the entire project.

  2. Flashes the application to compatible hardware.

  3. Starts energy capture for that device.

  4. Switches to the Energy Profiler perspective.

  5. Displays the device data on Single-Node View, Multi-Node View, and Scope View.

In step 2 above, if more than one connected device is compatible with the application being profiled, SSv5 prompts you to select a device. Select the target of interest and click OK.

energy prof select deviceenergy prof select device

After the application is built and the firmware flashed, the Energy Profiler perspective is displayed, with a release notes dialog. Click OK.

energy prof rel notesenergy prof rel notes

From the Energy Profiler#

If application firmware is already running on a device, you can connect to it from the Energy Profiler tool. Open the Energy Profiler perspective. Click Quick Access to display its menu and select Start Energy Capture.

energy prof quick startenergy prof quick start

If more than one connected device is compatible with the application being profiled, SSv5 prompts you to select a device. Select the target of interest and click OK.

energy prof select deviceenergy prof select device

Energy Profiler then:

  • Starts energy capture for that device.

  • Depending upon which view is currently active, displays the device’s energy data on Single-Node view, Multi-Node view, or Scope view.

Customer Hardware and Software Design Information#

Hardware Design#

EFM8 Hardware Interface

To use the Energy Profiler functionality on a board design, the board needs to include a debug interface that can be connected to a Silicon Labs starter kit (STK) or wireless starter kit (WSTK). For the basic Energy Profiler current measurements, the board must be powered from the VAEM supply of a Silicon Labs STK or WSTK. Both the current measurement and EFM8 C2 Debug interface can be obtained by using the Silicon Labs Mini Simplicity 10 pin connector. This connector is detailed in AN958: Debugging and Programming Interfaces for Custom Designs. The EFM8 C2 interface signals are on SWDIO (Pin 7 C2D) and SWCLK (Pin 8 C2CK) pins shown in the following figure.

energy prof efm8energy prof efm8

Code correlation is not possible with the EFM8 parts as they do not include the SWO pin that is used to transmit the program counter information. As mentioned in AN958: Debugging and Programming Interfaces for Custom Designs, using the Silicon Labs debug adapter board (BRD8010A) is the easiest way to get the Mini Simplicity pinout from a Silicon Labs STK or WSTK development kit.

EFM32 and EFR32 Hardware Interface

To use the Energy Profiler functionality on a board design, the board needs to include a debug interface that can be connected to a Silicon Labs STK or WSTK. For the basic Energy Profiler current measurements, the board must be powered from the VAEM supply of a Silicon Labs STK or WSTK. To also include code correlation, the debug interface must include the SWD interface. Both the current measurement and the code correlation (SWD) can be obtained by using the Silicon Labs Mini Simplicity 10 pin connector. This connector is detailed in AN958: Debugging and Programming Interfaces for Custom Designs. The Mini Simplicity 10 pin connector can be used with all EFM32 and EFR32 parts. The pinout is shown in the following figure.

energy prof efm8energy prof efm8

As mentioned in AN958: Debugging and Programming Interfaces for Custom Designs, using the Silicon Labs debug adapter board (BRD8010A) is the easiest way to get the Mini Simplicity pinout from a Silicon Labs STK or WSTK development kit. The debug adapter board is not compatible with the older EFM32 Development Kits (DKs) and some of the older EFM32 starter kits (STK) that have a different debug connector on them (Gecko, Giant Gecko (EFM32GG-STK3700), Leopard Gecko, Tiny Gecko, Wonder Gecko, Zero Gecko).

Software Design#

To use the current monitoring functionality provided by the AEM interface, no software changes or setup are required. To use the code correlation functionality, the SWD interface must be configured to output periodic program counter information.

EFM8 Software Configuration

Currently, code correlation is not possible with the EFM8 family. The Multi-Node Energy Profiler can still be used to monitor the overall energy use of the parts over time / usage scenarios.

EFM32 Software Configuration

  1. Add bsp_trace.c to the project. (from <SSv5 install>\developer\sdks\gecko_sdk_suite&lt;version>\hardware\kit\common\bsp)

  2. The macros BSP_TRACE_SWO_PIN, BSP_TRACE_SWO_PORT and BSP_TRACE_SWO_LOC must be defined. For EFM32 parts this is done by default for Silicon Labs development kits in <SSv5 install>\developer\sdks\gecko_sdk_suite\<version>\hardware\kit\<board>/hal-config-board.h. For a custom board design the Silicon Labs hal-config-board.h can be used as an example for defining the values. The following is an example for the Pearl Gecko Starter Kit (SLSTK3401A):

    // $[GPIO]
    #define    PORTIO_GPIO_SWV_PIN                              (2)
    #define    PORTIO_GPIO_SWV_PORT                             (gpioPortF)
    #define    PORTIO_GPIO_SWV_LOC                              (0)
    
    #define    BSP_TRACE_SWO_PIN                                (2)
    #define    BSP_TRACE_SWO_PORT                               (gpioPortF)
    #define    BSP_TRACE_SWO_LOC                                (0)
    // [GPIO]$
  3. The code must enable SWO output from the MCU. To enable this output, add #include bsp_trace.h to main.c and call BSP_TraceProfilerSetup() during initialization after the EMU_DCDCInit() call in main().

    #include 
    #include "bsp_trace.h"
    .
    .
    .
    /* Initialize DCDC. Always start in    low-noise mode. */
    dcdcInit.dcdcMode = emuDcdcMode_LowNoise;
    EMU_DCDCInit(&dcdcInit);
    
    // Setup SWD for code correlation
    BSP_TraceProfilerSetup();
  4. The program must be built with debug information enabled so that source code lookup is possible. If you create your project in SSv5, this is enabled by default. If you import a project into SSv5, check compiler options in project context menu Properties... > C/C++ Build > Settings. If you build your program outside of SSv5, check compiler options of the build tools.

EFR32 Software Configuration

  1. Add bsp_trace.c to the project. (from <SSv5 install>\developer\sdks\gecko_sdk_suite&lt;version>\hardware\kit\common\bsp)

  2. The macros BSP_TRACE_SWO_PIN, BSP_TRACE_SWO_PORT and BSP_TRACE_SWO_LOC must be defined.

    1. With the BLE SDK this is done by default for Silicon Labs development kits in <SSv5 install>\developer\sdks\gecko_sdk_suite\<version>\hardware\kit\<board>/hal-config-board.h. For a custom board design the Silicon Labs hal-config-board.h can be used as an example for defining the values. Below is an example of these macros for a SiLabs BGM121 radio board:

      // $[GPIO]
      #define       PORTIO_GPIO_SWV_PIN                                 (2)
      #define       PORTIO_GPIO_SWV_PORT                                      (gpioPortF)
      #define       PORTIO_GPIO_SWV_LOC                                 (0)
      
      #define       BSP_TRACE_SWO_PIN                                   (2)
      #define       BSP_TRACE_SWO_PORT                                        (gpioPortF)
      #define       BSP_TRACE_SWO_LOC                                   (0)
      // [GPIO]$
    2. Use the Hardware Configurator or Pin Tool to enable the GPIO module. This adds the BSPTRACE_SWO* macros to the hal-config.h file.

  3. The code must enable SWO output from the MCU. To enable this output, add #include bsp_trace.h to the appropriate module and call BSP_TraceProfilerSetup() during initialization as indicated in the following sections, based on the product family and SDK being used:

    1. EFR32 - BLE SDK: Place BSP_TraceProfilerSetup() in main.c after the initApp() call.

      #include "bsp.h"
      #include "bsp_trace.h"
      .
      .
      .
      // Initialize application
      initApp();
      
      // Setup SWD for code correlation
      BSP_TraceProfilerSetup();
      
      // Initialize LEDs
      BSP_LedsInit();
    2. EFR32 - Flex SDK: Place BSP_TraceProfilerSetup() in main.c after the BSP_Init() call.

      #include "hal_common.h"
      #include "bsp_trace.h"
      .
      .
      .
      // Initialize the BSP
      BSP_Init(BSP_INIT_BCC);
      
      // Setup SWD for code correlation
      BSP_TraceProfilerSetup();
    3. EFR32 - EmberZNet SDK: Place BSP_TraceProfilerSetup() in af-main-soc.c after the emberInit() call.

      #include "afv2-bookkeeping.h"
      
      #if defined(CORTEXM3_EFR32_MICRO) ||  defined    (CORTEXM3_EMBER_MICRO)
        #define EXTENDED_RESET_INFO
        #include "hal/micro/cortexm3/ diagnostic.h"
      #endif
      #include "bsp_trace.h"
      .
      .
      .
      int emberAfMain (MAIN_FUNCTION_PARAMETERS)
      {
        EmberStatus status;
      
        {
          int returnCode;
          if (emberAfMainStartCallback(&     returnCode,      APP_FRAMEWORK_MAIN_ARGUMENTS)) {
            return returnCode;
        }
      }
      
      // Initialize the Ember Stack.
      status = emberInit();
      
      if (status != EMBER_SUCCESS) {
         emberAfCorePrintln("%pemberInit  0x%x",     "ERROR: ", status);
      
         // The app can choose what to do  here.      If the app is running
         // another device then it could  stay     running and report the
         // error visually for example. This  app     asserts.
         assert(false);
      } else {
         emberAfDebugPrintln("init pass");
        }
      // Setup SWD for code correlation
      BSP_TraceProfilerSetup();
  4. The program must be built with debug information enabled so that source code lookup is possible. If you create your project in SSv5, this is enabled by default. If you import a project into SSv5, check compiler options in project context menu Properties... > C/C++ Build > Settings. If you build your program outside of SSv5, check compiler options of the build tools.