Friday, January 22, 2016

How to clone an existing Z-Stack coordinator.

The following steps are used for cloning an existing Z-Stack coordinator.

1. Enable Compiler option MT_SYS_KEY_MANAGEMENT on coordinator.

2. Use MT command to read out the following NV items from coordinator that you want to clone.

  • ZCD_NV_EXTADDR(0x0001)
  • ZCD_NV_BOOTCOUNTER(0x0002) – optional, If Diagnostics feature is necessary (new for HA spec.1.2)
  • ZCD_NV_NIB(0x0021)
  • ZCD_NV_EXTENDED_PAN_ID(0x002D)
  • ZCD_NV_NWK_ACTIVE_KEY_INFO(0x003A)
  • ZCD_NV_NWK_ALTERN_KEY_INFO(0x003B)
  • ZCD_NV_APS_USE_EXT_PANID(0x0047)
  • ZCD_NV_PRECFGKEY(0x0062)
  • ZCD_NV_TCLK_TABLE_START(0x0101)

3. Turn off old coordinator.

4. Flash the same coordinator binary to the new coordinator.

5. Using MT command to write NV items data that are read out in step 2.

6. Restart new coordinator to work.


3 comments:

  1. 第4 点 Flash the same coordinator binary to the new coordinator

    如何个flash 法? 是不是在协调器的应用程序里面 加入串口接收的代码? 然后在代码中自己调用 写NV 的函数?

    ReplyDelete
  2. Hi YK,

    Thanks for the guide!

    I did try cloning a HA1.2.2a network and here are my findings:
    If you are using the BDB commissioning interface, you have to initialize other nv items like the addrMgr, for which is very convenient to create a network and power cycle the device, after which you can write the nwk parameters of the ZC to be cloned. Also you have to write ZCD_NV_BDBNODEISONANETWORK to TRUE so bdb can restore the nwk parameters.
    Additionally, you have to take care of the security material table ZCD_NV_NWK_SEC_MATERIAL_TABLE_START, which is the frame counter + the Ext PAN ID of the network, also you can use the debugging MT interface to match the nwk frame counter of the cloning device.

    Hope this helps!

    ReplyDelete
  3. Is this also applicable for a Z-Stack 3.0 ZC?

    ReplyDelete