This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/CC2530: Z-STACK WORKING WITH Z-TOOL

Part Number: CC2530
Other Parts Discussed in Thread: Z-STACK,

Tool/software: TI C/C++ Compiler

Hello. 

I am using generic app in z-stack 3.0 to create a coord and a router device. I am using Z-TOOL to show it information .

COORDINATOR :

Start Time: 4/14/2018 10:22:31 AM

<TX>10:22:43.58 COM3 UTIL_GET_DEVICE_INFO (0x2700)

<RX>10:22:43.59 COM3 UTIL_GET_DEVICE_INFO_RESPONSE (0x6700)
   Status: SUCCESS (0x0)
   IEEEAddr: 0x00124B000DAEBED3
   ShortAddress: 0xFFFE
   DeviceType: COORDINATOR (0x1)
   DeviceState: DEV_HOLD (0x0)
   NumAssocDevices: 0x00
   AssocDevicesList

<TX>10:22:46.36 COM3 UTIL_GET_NV_INFO (0x2701)

<RX>10:22:46.45 COM3 UTIL_GET_NV_INFO_RESPONSE (0x6701)
   Status: 8 (0x8)
   IEEEAddress: 0x00124B000DAEBED3
   ScanChannels: NONE (0x0)
   PanID: 0x0000
   SecurityLevel: 0x00
   PreConfigKey: ......L.v...H 5. (0x0B, 0xFF, 0xFF, 0xFF, 0x12, 0xA4, 0x4C, 0xFB, 0x76, 0x03, 0xE7, 0x81, 0x48, 0x20, 0x35, 0xF8)

ROUTER :

Start Time: 4/14/2018 10:22:33 AM

<TX>10:23:03.11 COM6 UTIL_GET_DEVICE_INFO (0x2700)

<RX>10:23:03.12 COM6 UTIL_GET_DEVICE_INFO_RESPONSE (0x6700)
   Status: SUCCESS (0x0)
   IEEEAddr: 0x00124B000DAEC0B8
   ShortAddress: 0xFFFE
   DeviceType: ROUTER (0x2)
   DeviceState: DEV_HOLD (0x0)
   NumAssocDevices: 0x00
   AssocDevicesList

<TX>10:23:04.95 COM6 UTIL_GET_NV_INFO (0x2701)

<RX>10:23:05 COM6 UTIL_GET_NV_INFO_RESPONSE (0x6701)
   Status: 8 (0x8)
   IEEEAddress: 0x00124B000DAEC0B8
   ScanChannels: NONE (0x0)
   PanID: 0x0000
   SecurityLevel: 0x00
   PreConfigKey: .....z....S,.... (0x0B, 0xFF, 0xFF, 0xFF, 0xFE, 0x7A, 0x01, 0xC3, 0xC0, 0x11, 0x53, 0x2C, 0xFF, 0x9D, 0x82, 0x89)

Why shortaddr of coord and Router is 0XFFFE ? Scanchanel is 0x0 ?

  • Both your coordinator and router are in hold state which means you don’t start them correctly.
  • if i need define  HOLD_AUTO_START

  • I think it’s nothing to do with HOLD_AUTO_START. I remember you don’t use TI CC2530ZDK so do you call bdb_StartCommision to start network on coordinator?
  • I call "bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_FORMATION)" in coordinator application and call "bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_STEERING)" in router but this is output :
    Start Time: 4/14/2018 5:31:06 PM
    ROUTER :
    <TX>05:31:34.49 COM5 UTIL_GET_DEVICE_INFO (0x2700)

    <RX>05:31:34.51 COM5 UTIL_GET_DEVICE_INFO_RESPONSE (0x6700)
    Status: SUCCESS (0x0)
    IEEEAddr: 0x00124B000DAEC0B8
    ShortAddress: 0xFFFE
    DeviceType: ROUTER (0x2)
    DeviceState: DEV_HOLD (0x0)
    NumAssocDevices: 0x00
    AssocDevicesList

    <TX>05:31:39.11 COM5 UTIL_GET_NV_INFO (0x2701)

    <RX>05:31:39.16 COM5 UTIL_GET_NV_INFO_RESPONSE (0x6701)
    Status: 8 (0x8)
    IEEEAddress: 0x00124B000DAEC0B8
    ScanChannels: NONE (0x0)
    PanID: 0xFF07
    SecurityLevel: 0xF0
    PreConfigKey: ....Q.?TQ.?..... (0x00, 0xFF, 0xFF, 0xFF, 0x51, 0xCF, 0x3F, 0x54, 0x51, 0x9F, 0x3F, 0x08, 0x91, 0xA6, 0xEF, 0x1A)

    COORDINATOR :

    Start Time: 4/14/2018 5:31:06 PM

    <TX>05:31:15.15 COM3 UTIL_GET_DEVICE_INFO (0x2700)

    <RX>05:31:15.17 COM3 UTIL_GET_DEVICE_INFO_RESPONSE (0x6700)
    Status: SUCCESS (0x0)
    IEEEAddr: 0x00124B000DAEBED3
    ShortAddress: 0x0000
    DeviceType: COORDINATOR (0x1)
    DeviceState: DEV_ZB_COORD (0x9)
    NumAssocDevices: 0x00
    AssocDevicesList

    <TX>05:31:22 COM3 UTIL_GET_NV_INFO (0x2701)

    <RX>05:31:22.08 COM3 UTIL_GET_NV_INFO_RESPONSE (0x6701)
    Status: 8 (0x8)
    IEEEAddress: 0x00124B000DAEBED3
    ScanChannels: NONE (0x0)
    PanID: 0x0000
    SecurityLevel: 0x08
    PreConfigKey: ....ho...e..I.5. (0x00, 0xFF, 0xFF, 0xFF, 0x68, 0x6F, 0x2E, 0x8C, 0xDE, 0x65, 0x1A, 0xEB, 0x49, 0x8F, 0x35, 0xA4)

    Router state is DEV_HOLD, scane channel is 0x0, i don't change PANID but it change from 0xFFFF to 0xFF07.
    What is problem ?
    Thanks.
  • It seems your router can’t join Coordinator when it start network steering so it turns itself into distributed router. You have to enable permit join on coordinator when your router starts and try to join Network otherwise this would happen.
  • How i enable it to try join network ?
  • You can use ZDO_MGMT_PERMIT_JOIN_REQ with AddrMode=2, DstAddr=0x0000, and Duration=seconds you want enable permit join (max is 254) to enable permit join on coordinator.
  • after i send message it give a status : ZNWK_INVALID_REQUEST (0xC2)
  • Can you show me how you do it?
  • Start Time: 4/14/2018 9:56:47 PM

    <TX>09:57:22.7 COM5 ZDO_MGMT_PERMIT_JOIN_REQUEST (0x2536)
    AddrMode: 0x02 (ADDRESS_16_BIT) (0x2)
    DstAddr: 0x0000
    Duration: 0x15
    TCSignificance: 0x01

    <RX>09:57:22.71 COM5 ZDO_MGMT_PERMIT_JOIN_REQ_SRSP (0x6536)
    Status: ZNWK_INVALID_REQUEST (0xC2)

    <TX>09:57:35.32 COM5 ZDO_MGMT_PERMIT_JOIN_REQUEST (0x2536)
    AddrMode: 0x02 (ADDRESS_16_BIT) (0x2)
    DstAddr: 0x0000
    Duration: 0xFF
    TCSignificance: 0x01

    <RX>09:57:35.34 COM5 ZDO_MGMT_PERMIT_JOIN_REQ_SRSP (0x6536)
    Status: ZNWK_INVALID_REQUEST (0xC2)

    <TX>09:58:03.2 COM5 ZDO_MGMT_PERMIT_JOIN_REQUEST (0x2536)
    AddrMode: 0x0F (BROADCAST) (0xF)
    DstAddr: 0x0000
    Duration: 0xFF
    TCSignificance: 0x01

    <RX>09:58:03.21 COM5 ZDO_MGMT_PERMIT_JOIN_REQ_SRSP (0x6536)
    Status: INVALID_PARAMETER (0x2)
  • I think you have to define MT_ZDO_MGMT in compile options.
  • Dear YiKai Chen
    After i change to bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_FORMATION | BDB_COMMISSIONING_MODE_NWK_STEERING | BDB_COMMISSIONING_MODE_FINDING_BINDING | BDB_COMMISSIONING_MODE_INITIATOR_TL);
    They start successful, but scanchannel still 0x0 and PANID is 0x0000.
    And when i send ZDO_ACTIVE_EP_REQ from coordinator, it return only status , not have list of endpoint active and in router RX not have message comming.

    Start Time: 4/15/2018 9:16:29 AM
    COORDINATOR:

    <TX>09:23:31.36 COM3 UTIL_GET_DEVICE_INFO (0x2700)

    <RX>09:23:31.4 COM3 UTIL_GET_DEVICE_INFO_RESPONSE (0x6700)
    Status: SUCCESS (0x0)
    IEEEAddr: 0x00124B000DAEBED3
    ShortAddress: 0x0000
    DeviceType: COORDINATOR (0x1)
    DeviceState: DEV_ZB_COORD (0x9)
    NumAssocDevices: 0x00
    AssocDevicesList

    <TX>09:23:32.84 COM3 UTIL_GET_NV_INFO (0x2701)

    <RX>09:23:32.91 COM3 UTIL_GET_NV_INFO_RESPONSE (0x6701)
    Status: 8 (0x8)
    IEEEAddress: 0x00124B000DAEBED3
    ScanChannels: NONE (0x0)
    PanID: 0x0000
    SecurityLevel: 0x00
    PreConfigKey: ....;..X.Z%.X#.. (0x0B, 0xFF, 0xFF, 0xFF, 0x3B, 0xDF, 0x12, 0x58, 0x8F, 0x5A, 0x25, 0xFB, 0x58, 0x23, 0xFA, 0xB9)

    <TX>09:29:52.62 COM3 ZDO_ACTIVE_EP_REQ (0x2505)
    DstAddr: 0x0000
    NWKAddrOfInterest: 0x15D8

    <RX>09:29:52.63 COM3 ZDO_ACTIVE_EP_REQ_SRSP (0x6505)
    Status: afStatus_SUCCESS (0x0)

    Start Time: 4/15/2018 9:16:31 AM

    ROUTER :
    <TX>09:23:22.4 COM4 UTIL_GET_DEVICE_INFO (0x2700)

    <RX>09:23:22.42 COM4 UTIL_GET_DEVICE_INFO_RESPONSE (0x6700)
    Status: SUCCESS (0x0)
    IEEEAddr: 0x00124B000DAEC0B8
    ShortAddress: 0x15D8
    DeviceType: ROUTER (0x2)
    DeviceState: DEV_ROUTER (0x7)
    NumAssocDevices: 0x00
    AssocDevicesList

    <TX>09:23:24.93 COM4 UTIL_GET_NV_INFO (0x2701)

    <RX>09:23:24.98 COM4 UTIL_GET_NV_INFO_RESPONSE (0x6701)
    Status: 8 (0x8)
    IEEEAddress: 0x00124B000DAEC0B8
    ScanChannels: NONE (0x0)
    PanID: 0x0000
    SecurityLevel: 0x08
    PreConfigKey: ......Z.y...K... (0x00, 0xFF, 0xFF, 0xFF, 0xDD, 0xF1, 0x5A, 0x84, 0x79, 0xC3, 0xE1, 0x91, 0x4B, 0xCC, 0xF6, 0xF5)
  • I suppose you should use “bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_FORMATION | BDB_COMMISSIONING_MODE_NWK_STEERING) on Coordinator and “bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_STEERING)” on Router to make Router joins Coordinator formed network.
  • when i do it, router state come to DEV_HOLD
  • Where do you call “bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_STEERING)” on Router ?
  • yes. if i call bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_FORMATION | BDB_COMMISSIONING_MODE_NWK_STEERING | BDB_COMMISSIONING_MODE_FINDING_BINDING | BDB_COMMISSIONING_MODE_INITIATOR_TL) , it come to DEV_ROUTER
  • Yes??? I suggest you to use “bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_STEERING)” on Router but you use “bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_FORMATION | BDB_COMMISSIONING_MODE_NWK_STEERING | BDB_COMMISSIONING_MODE_FINDING_BINDING | BDB_COMMISSIONING_MODE_INITIATOR_TL)?”
  • No. when i call bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_STEERING), it is DEV_HOLD. when i call bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_FORMATION | BDB_COMMISSIONING_MODE_NWK_STEERING | BDB_COMMISSIONING_MODE_FINDING_BINDING | BDB_COMMISSIONING_MODE_INITIATOR_TL), it is DEV_ROUTER
  • I suggest you to use Sniffer to check over the air messages to see why your router turned into DEV_HOLD when calling “bdb_StartCommissioning(BDB_COMMISSIONING_MODE_NWK_STEERING)” on Router
  • I can't capturing any device when use Sniffer. I think cause of it is scanchanel is NONE and PANID is 0x000. Do you known how reslove it ?
  • Do you setup primary channel and secondary channel correctly? You can set both of them to use channel 11 and also use sniffer to sniff channel 11.
  • yes. in generic app, defaul chanel is 11 and in sniffer, i set it to 0x0B ( chanel 11 )
  • Try to erase your CC2530 flash and test again.
  • it will not active. When i try change to z-stack 1.0.0, PANI ID is 0xFFFF , Scanchanel still is 0x0000. Router state is DEV_ROUTER_DISC.
    But router will not connect to coordinator. Can you tell me if i need call any API in z-stack 1.0.0 or please share me a sample app for connection testing.
    Thanks you.
  • You can try to use ZDP_MgmtPermitJoinReq to enable permit join on coordinator first and then start router to join.
  • it still not join to network
  • When you start router, do you see beacon requests in your sniffer?
  • I think i known cause of error. My board not have an external 32 Khz , and i need define OSC32K_CRYSTAL_INSTALLED = FALSE.

    Thanks you for support YiKai Chen.