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.

CC2530: How to compile ZED and ZR ii one? z-stack 3.0.1

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

I did program base of  GenericApp example and i want to make all-in-one ZED and ZR.  For this i set options like in the ZNP  

-DZSTACK_DEVICE_BUILD="(DEVICE_BUILD_ROUTER | DEVICE_BUILD_ENDDEVICE)"

and setup AllDevice-PRO.lib in IAR

but i get four errors

Error[Pe020]: identifier "BDB_NETWORK_STEERING_CAPABILITY" is undefined C:\Texas Instruments\Z-Stack 3.0.1_ForTest\Components\stack\bdb\bdb.c 112

Error[Pe020]: identifier "BDB_NETWORK_FORMATION_CAPABILITY" is undefined C:\Texas Instruments\Z-Stack 3.0.1_ForTest\Components\stack\bdb\bdb.c 112

Error[Pe020]: identifier "BDB_FINDING_BINDING_CAPABILITY" is undefined C:\Texas Instruments\Z-Stack 3.0.1_ForTest\Components\stack\bdb\bdb.c 112
Error[Pe020]: identifier "BDB_TOUCHLINK_CAPABILITY" is undefined C:\Texas Instruments\Z-Stack 3.0.1_ForTest\Components\stack\bdb\bdb.c 112

Which of  options can i set?

  • Since CC2530 has limited RAM/Flash, I don’t think it’s feasible to make all-in-one ZED and ZR.

  • why?
    The ZNP is example. It is can be ZC, ZR or ZED? Uou can chamge role of ZNP without reprogramming flash
  • ZNP is much more compact than SOC application. For example, ZNP doesn’t have all BDB and UI related codes.
  • my application also dosen't have UI. It consist MT. I don't have problem with place in flash but have problem with compile.
    Now i found out same thing - I can set option for ZNP only with coordinator options.
    For example I can set
    -DZSTACK_DEVICE_BUILD="(DEVICE_BUILD_COORDINATOR | DEVICE_BUILD_ROUTER | DEVICE_BUILD_ENDDEVICE)"
    -DZSTACK_DEVICE_BUILD="(DEVICE_BUILD_COORDINATOR | DEVICE_BUILD_ENDDEVICE)"
    -DZSTACK_DEVICE_BUILD="(DEVICE_BUILD_COORDINATOR | DEVICE_BUILD_ROUTER)"

    But i can not set
    -DZSTACK_DEVICE_BUILD="( DEVICE_BUILD_ROUTER | DEVICE_BUILD_ENDDEVICE)"
    -DZSTACK_DEVICE_BUILD="( DEVICE_BUILD_ENDDEVICE)"


    In second case i get compile error
    Error[Pe020]: identifier "BDB_NETWORK_STEERING_CAPABILITY" is undefined C:\Texas Instruments\Z-Stack 3.0.1_ForTest\Components\stack\bdb\bdb.c 112
    Error[Pe020]: identifier "BDB_NETWORK_FORMATION_CAPABILITY" is undefined C:\Texas Instruments\Z-Stack 3.0.1_ForTest\Components\stack\bdb\bdb.c 112
    Error[Pe020]: identifier "BDB_FINDING_BINDING_CAPABILITY" is undefined C:\Texas Instruments\Z-Stack 3.0.1_ForTest\Components\stack\bdb\bdb.c 112
    Error[Pe020]: identifier "BDB_TOUCHLINK_CAPABILITY" is undefined C:\Texas Instruments\Z-Stack 3.0.1_ForTest\Components\stack\bdb\bdb.c 112

    or (for -DZSTACK_DEVICE_BUILD="( DEVICE_BUILD_ENDDEVICE)")
    Error[e46]: Undefined external "gLINK_STATUS_JITTER_MASK" referred in nwk ( C:\Texas Instruments\Z-Stack 3.0.1_ForTest\Projects\zstack\Libraries\
  • The includes and macros in bdb.h need to be revised to better specify the build types, please refer to the new entry in the following Wiki page:
    processors.wiki.ti.com/.../Zigbee_Known_Issues_and_Proposed_Fixes

    I've submitted this feedback to the Software Development Team. For the -DZSTACK_DEVICE_BUILD="( DEVICE_BUILD_ENDDEVICE)" case I simply added:
    #else
    CONST uint16 gLINK_STATUS_JITTER_MASK = 0;

    Regards,
    Ryan
  • Thank you! I try.
  • Hi Pavel,

    I changed the default configuration of Coordinator as follows.

    On bdb.h add ZG_BUILD_JOINING_TYPE flag in the next lines:


    Line 65

    #if (ZG_BUILD_JOINING_TYPE || (ZSTACK_DEVICE_BUILD == DEVICE_BUILD_ROUTER) || (ZSTACK_DEVICE_BUILD == DEVICE_BUILD_ENDDEVICE)) // ++ CHANGE THIS LINE
    //Optional
    #if defined ( INTER_PAN ) && ( defined ( BDB_TL_INITIATOR ) || defined ( BDB_TL_TARGET ) )
    #define BDB_TOUCHLINK_CAPABILITY_ENABLED 1
    #else
    #define BDB_TOUCHLINK_CAPABILITY_ENABLED 0
    #endif
    #else
    #if defined ( INTER_PAN ) && ( defined ( BDB_TL_INITIATOR ) || defined ( BDB_TL_TARGET ) )
    #error TouchLink cannot be enabled for coordinator. Please make sure not to define either BDB_TL_INITIATOR or BDB_TL_TARGET
    #endif
    #endif

    Line 104

    /*********************************************************************
    * MACROS
    */

    // bdbNodeCommissioningCapability MACROS
    #if (ZG_BUILD_COORDINATOR_TYPE)
    #define BDB_NETWORK_STEERING_CAPABILITY (BDB_NETWORK_STEERING_CAPABILITY_ENABLED<<0)
    #define BDB_NETWORK_FORMATION_CAPABILITY (BDB_NETWORK_FORMATION_CAPABILITY_ENABLED<<1)
    #define BDB_FINDING_BINDING_CAPABILITY (BDB_FINDING_BINDING_CAPABILITY_ENABLED<<2)
    #define BDB_TOUCHLINK_CAPABILITY (0<<3) //ZC cannot perform TL proceedure
    #endif
    #if (ZG_BUILD_JOINING_TYPE || (ZSTACK_DEVICE_BUILD == DEVICE_BUILD_ROUTER )) // ++ CHANGE THIS LINE
    #define BDB_NETWORK_STEERING_CAPABILITY (BDB_NETWORK_STEERING_CAPABILITY_ENABLED<<0)
    #define BDB_NETWORK_FORMATION_CAPABILITY (BDB_ROUTER_FORM_DISTRIBUTED_NWK_ENABLED<<1)
    #define BDB_FINDING_BINDING_CAPABILITY (BDB_FINDING_BINDING_CAPABILITY_ENABLED<<2)
    #define BDB_TOUCHLINK_CAPABILITY (BDB_TOUCHLINK_CAPABILITY_ENABLED<<3)
    #endif

    Modify f8wCoord.cfg by commenting coordinator setting and adding router and device build:

    /* Coordinator Settings */
    //-DZDO_COORDINATOR // Coordinator Functions
    //-DRTR_NWK

    /* Generic All-in-One Settings */
    -DZSTACK_DEVICE_BUILD="(DEVICE_BUILD_ROUTER | DEVICE_BUILD_ENDDEVICE)"

    /* Other Settings */
    -DNWK_AUTO_POLL

     

    Change the device library with -C $PROJ_DIR$\..\..\..\Libraries\TI2530DB\bin\AllDevice-Pro.libz

     

    With this changes the project compiles but it will need further testing to guarantee than nothing is broken.

     

    Regards,

     

  • Thank you!  I'm  wating for your  resault of test.  

    What about this line? Do  I need change it?

    I've submitted this feedback to the Software Development Team. For the -DZSTACK_DEVICE_BUILD="( DEVICE_BUILD_ENDDEVICE)" case I simply added:

    #else

    CONST uint16 gLINK_STATUS_JITTER_MASK = 0;

  • There was an update provided on the Wiki which deprecates the need to use this statement.

    Regards,
    Ryan
  • The following descriptions seems nothing to do with section header "Errors due to BDB header build types". They are needed only when you want to combine ZR/ZED on the same device. Should you be more specific on your section header in case of any misunderstanding from developer.

    Modify f8wCoord.cfg by commenting coordinator setting and adding router and device build:

    /* Coordinator Settings */
    //-DZDO_COORDINATOR // Coordinator Functions
    //-DRTR_NWK

    /* Generic All-in-One Settings */
    -DZSTACK_DEVICE_BUILD="(DEVICE_BUILD_ROUTER | DEVICE_BUILD_ENDDEVICE)"

    /* Other Settings */
    -DNWK_AUTO_POLL

    Change the device library with -C $PROJ_DIR$\..\..\..\Libraries\TI2530DB\bin\AllDevice-Pro.lib and replace all instances of "#if ( ZSTACK_ROUTER_BUILD ) || defined ( ZBIT )" with "#if ( ZSTACK_ROUTER_BUILD ) || (ZG_BUILD_ENDDEVICE_TYPE) || defined ( ZBIT )"