Generating HEX files for Zigbee production configuration

nRF Util

tags
nRF Util

You can use the nrf5sdk-tools zigbee production_config (or zigbee production_config) command to generate production configuration HEX files for Zigbee devices.

Production configuration HEX files can be used to set the production configuration flash memory block in the Zigbee stack when working with the nRF5 SDK for Thread and Zigbee. Expand the section below for more information.

Production configuration block in the Zigbee stack

The Zigbee stack includes a production configuration block feature. This block is useful for per-device customization and is supposed to be written at device production time. The size of the production block must not exceed 128 bytes.

The production configuration block:

  • Is placed into flash memory - by default it is stored in the next flash page after ZIGBEE_NVRAM.
  • Is not directly visible to the application. Zigbee stack reads it during initialization and sets its internal parameters.
  • Must be written to the flash before launching the application.

The block is loaded at the very start of zboss_main_loop_iteration(), so it rewrites all the corresponding data from NVRAM.

The production configuration block has a system part and an optional application-specific part:

  • The Zigbee stack applies the system part internally.
  • The application can handle its specific part by receiving the ZB_ZDO_SIGNAL_PRODUCTION_CONFIG_READY signal that carries the neccessary information needed for the application to proceed.
    case ZB_ZDO_SIGNAL_PRODUCTION_CONFIG_READY:
        if (status != RET_OK)
        {
            /* Production config is not present or invalid */
        }
        else
        {
            zb_uint32_t app_data_length = zb_buf_len(param) - sizeof(zb_zdo_app_signal_hdr_t);
            if (app_data_length != 0)
            {
                example_application_config_t * ex_cfg = ZB_ZDO_SIGNAL_GET_PARAMS(p_sg_p, example_application_config_t);
                process_example_application_config(ex_cfg);
            }
        }
        break;
    

Data that can be placed into the system part of the production configuration block includes:

  • 802.15.4 channel mask
  • Device IEEE address
  • Definition of the maximum TX power per channel per page
  • Install code of the device

Moreover, the data specific to your application can be placed in the application part of the production configuration block.

Note

  • The size of the application block of production configuration is limited to 74 bytes for first version of production config. It may change across versions because newer versions of the production configuration may include additional data.
  • After the production configuration is applied, do not call functions that would overwrite this data (zb_set_long_address() and so on).
  • An alternative way to change the long address for the final product is to modify the zb_osif_get_ieee_eui64 function. When used during development, the function uses a random EUI64 address from the FICR registry. Modify it to use your own OUI.

Apart from the system part parameters, the production configuration includes the application configuration app_data made of three bytes: 0x01, 0xAB, 0xCD.

Tip

For more information about Zigbee production configuration, see the dedicated section in the nRF5 SDK for Thread and Zigbee documentation.