Measuring sleep current on Custom Board EFR32MG1 using the Z3Switch sample app

by <a href=""><font color="#000000"><font size="2">Hero Employee</font></font> </a> Lesun ‎09-26-2017 03:48 AM - edited ‎09-27-2017 01:56 AM


Measuring sleep current on Custom Board EFR32MG1 using the Z3Switch sample app



If you would like to measure the sleep current with WSTK Kit, you can refer to the following KBA. 

Measuring sleep current on EFR32MG1 using the Z3Switch sample


Sometimes, some custom would like to measure sleep current on their customize board. There are some differences from the above KBA. Here is an example of measuring sleep current on one of custom board, it is based on the EFR32MG1B132F256GM32 chip.


We are using the same Z3Switch sample app based on EmberZNet5.7.3GA following these simple steps:


  1. Create a new project based on the Z3 Switch sample app, and make these modifications in the .isc file:

- Under the "Znet stack" tab, change the device type to Sleepy End Device

- Under HAL configuration tab, make sure "Selected architecture" is your actual part number.

- Under HAL configuration tab, make sure you choose a Custom Board Header for your project. Please refer to the attached Z3SwitchSoc_board.h.

- Under Plugins tab, disable "heartbeat".

- Under Plugins tab, check the option “Stay awake when NOT joined” in “Idle/Sleep”, so that the device won’t enter sleep mode at start, and then you can use CLI console for test.

- Under Includes tab, add the following two directories. 



  1. Make sure you modify the following points in the board header file and other files.

- Add  #define DISABLE_PTI in the board header file.

- Comment #define COM_USART0_HW_FC in the board header file.

- Remove the halInternalInitButton() in halInternalInitBoard() in wstk-common.h file.

#define halInternalInitBoard() do {                                \
 halInternalInitLed();                                             \
 halInternalPowerUpBoard();                                        \
 halInternalConfigPti();                                           \
 halInternalConfigPa();                                            \
 halInternalEnableDCDC();                                          \
 halInternalInitRadioHoldOff();                                    \
 halInternalInitPta();                                             \
 halInternalInitPrs();                                             \
 halInternalInitAntennaDiversity();                                \
} while(0)

- Configure the UART  Tx/Rx Pin in com.h


 or you may use the RETARGET_USART0, so you may need modify the UART Rx/Rx in retargetserialconfig.h


  #define RETARGET_TX_LOCATION _USART_ROUTELOC0_TXLOC_LOC15  /* Location of of USART TX pin */
  #define RETARGET_RX_LOCATION _USART_ROUTELOC0_RXLOC_LOC15  /* Location of of USART RX pin */
  #define RETARGET_TXPORT      gpioPortC                    /* UART transmission port */
  #define RETARGET_TXPIN       10                            /* UART transmission pin */
  #define RETARGET_RXPORT      gpioPortC                    /* UART reception port */
 #define RETARGET_RXPIN    11                            /* UART reception pin */


  1. Generate and build the project, and upload it along with an application bootloader to the chip, usually you should build the application bootloader first by yourself. The power switch on the WSTK board should be set to "AEM".
  2. Launch the console and let the device join a network, then it will enter sleep mode.
  3. Disconnect from the node in the Network Analyzer view.
  4. Power cycle the board.
  5. Start Energy Profiler, connect to the node and start profiling. You should see sleep current around 3-4 uA.