Programming the Installation Code on a Zigbee Device#

Format of the Installation Code File#

To program the installation code, create a simple text file with the value of the installation code (without the CRC). In these instructions the file is named install-code-file.txt. This file is subsequently passed to em3xx_load or Simplicity Commander.

The format of the file is as follows:

Install Code: <ascii-hex>

Here is a sample installation code file. The CRC for that code is 0xB5C3 and is not included in the file.

Install Code: 83FED3407A939723A5C639B26916D505

Checking the Installation Code on an EFR32 Device#

To get started, it is best to verify there is connectivity with the device to be programmed, and what information is currently stored on the node. To do this, execute the following command to print all manufacturing token data from an EFR32-based device. The tokendump command prints manufacturing token data as key-value pairs. Simplicity Commander supports more than one group of tokens. In this example, the token group named "znet" is used.

$ commander tokendump --tokengroup znet

You should see the following output, where the code in bold below reflects the significant fields related to the installation code:

#
# The token data can be in one of three main forms: byte-array, integer, or string.
# Byte-arrays are a series of hexadecimal numbers of the required length.
# Integers are BIG endian hexadecimal numbers.
# String data is a quoted set of ASCII characters.
#
# MFG_EMBER_EUI_64     : A8D417FEFF570B00
MFG_CUSTOM_VERSION   : 0xFFFF
MFG_CUSTOM_EUI_64    : FFFFFFFFFFFFFFFF
MFG_STRING           : ""
MFG_BOARD_NAME       : ""
MFG_MANUF_ID         : 0xFFFF
MFG_PHY_CONFIG       : 0xFFFF
MFG_SYNTH_FREQ_OFFSET: 0xFFFF
MFG_CCA_THRESHOLD    : 0xFFFF
MFG_EZSP_STORAGE     : FFFFFFFFFFFFFFFF
MFG_CTUNE            : 0xFFFF
MFG_XO_TUNE          : 0xFFFF
MFG_LOCKBITS_PLW     : 0x000000000000000000000000FFFFFFFF
MFG_LOCKBITS_CLW0    : 0xFFFFFFFF
MFG_LOCKBITS_MLW     : 0xFFFFFFFF
MFG_LOCKBITS_ULW     : 0xFFFFFFFF
MFG_LOCKBITS_DLW     : 0xFFFFFFFF
MFG_BOOTLOAD_AES_KEY : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
MFG_SECURITY_CONFIG  : 0xFFFF
MFG_ASH_CONFIG[0]  : 0xFFFF
MFG_ASH_CONFIG[1]  : 0xFFFF
MFG_ASH_CONFIG[2]  : 0xFFFF
MFG_ASH_CONFIG[3]  : 0xFFFF
MFG_ASH_CONFIG[4]  : 0xFFFF
MFG_ASH_CONFIG[5]  : 0xFFFF
MFG_ASH_CONFIG[6]  : 0xFFFF
MFG_ASH_CONFIG[7]  : 0xFFFF
MFG_ASH_CONFIG[8]  : 0xFFFF
MFG_ASH_CONFIG[9]  : 0xFFFF
MFG_ASH_CONFIG[10] : 0xFFFF
MFG_ASH_CONFIG[11] : 0xFFFF
MFG_ASH_CONFIG[12] : 0xFFFF
MFG_ASH_CONFIG[13] : 0xFFFF
MFG_ASH_CONFIG[14] : 0xFFFF
MFG_ASH_CONFIG[15] : 0xFFFF
MFG_ASH_CONFIG[16] : 0xFFFF
MFG_ASH_CONFIG[17] : 0xFFFF
MFG_ASH_CONFIG[18] : 0xFFFF
MFG_ASH_CONFIG[19] : 0xFFFF
#'MFG_CBKE_DATA (Smart Energy CBKE)' token group
Device Implicit Cert :
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
CA Public Key        : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
Device Private Key   : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
# CBKE Flags         : 0xFF
#'MFG_INSTALLATION_CODE (Smart Energy Install Code)' token group
# Install Code Flags : 0xFFFF
Install Code         : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
# CRC                : 0xFFFF
#'MFG_SECURE_BOOTLOADER_KEY (Manufacture token space for storing secure bootloader key.)' token group
MFG_SECURE_BOOTLOADER_KEY : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
#'MFG_CBKE_283K1_DATA (Smart Energy 1.2 CBKE)' token group
Device Implicit Cert (283k1) :
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFpFFFFFFFFF
CA Public Key (283k1)       :
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
Device Private Key (283k1)   :
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
# CBKE FLAGS (283k1)         : 0xFF
#'MFG_SIGNED_BOOTLOADER_KEY_X (Manufacture token space for storing ECDSA signed bootloader key (X-point).)' token group
MFG_SIGNED_BOOTLOADER_KEY_X : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
#'MFG_SIGNED_BOOTLOADER_KEY_Y (Manufacture token space for storing ECDSA signed bootloader key (Y-point).)' token group
MFG_SIGNED_BOOTLOADER_KEY_Y : FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
DONE

The pre-programmed EUI64 is read out by executing the following command:

commander tokendump --tokengroup znet --token MFG_EMBER_EUI_64
#
# The token data can be in one of three main forms: byte-array, integer, or string.
# Byte-arrays are a series of hexadecimal numbers of the required length.
# Integers are BIG endian hexadecimal numbers.
# String data is a quoted set of ASCII characters.
#
# MFG_EMBER_EUI_64: A8D417FEFF570B00
DONE

Writing the Installation Code into the Manufacturing Area on an EFR32 Device#

To write the installation code into the manufacturing area, execute the following command:

$ commander flash --tokengroup znet --tokenfile install-code-file.txt

You should see output similar to the following:

Writing 2048 bytes starting at address 0x0fe04000
Comparing range 0x0FE04000 - 0x0FE047FF (2 KB)
Programming range 0x0FE04270 - 0x0FE04283 (20 Bytes)
Verifying range 0x0FE04000 - 0x0FE047FF (2 KB)
DONE

Verifying the Stored Installation Code on an EFR32 Device#

After writing the installation code, it is best to verify the information by executing the following command again:

$ commander tokendump --tokengroup znet

Output of this command should be similar to that shown in section Checking the Installation Code on an EFR32 Device, but with the MFG_INSTALLATION_CODE data now representing your chosen code and little endian CRC.