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.

CC2652P: Cluster attributes in sampleApp_Attrs[ ] generated by Syscfg Zigbee Application Builder are not in ascending order

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

Hello,

I'm using zed_sampleapp as the basis for a custom zed application using  simplelink_cc13x2_26x2_sdk_4_40_00_44  with sysconfig_1.7.0.  I modified zed_sampleapp.syscfg my purposes and generated the associated code.  Below is a snippet from zcl_config.c.  

/*********************************************************************
 * ZCL Attribute List
 *********************************************************************/
// NOTE: The attributes listed in the AttrRec must be in ascending order
// per cluster to allow right function of the Foundation discovery commands
const zclAttrRec_t sampleApp_Attrs[] =
{
#ifdef ZCL_BASIC
	{
		ZCL_CLUSTER_ID_GENERAL_BASIC,
			{
				ATTRID_BASIC_ZCL_VERSION ,
				ZCL_DATATYPE_UINT8,
				ACCESS_CONTROL_READ,
				(void *)&sampleApp_Basic_ZCLVersion
			}
	},
	{
		ZCL_CLUSTER_ID_GENERAL_BASIC,
			{
				ATTRID_BASIC_POWER_SOURCE ,
				ZCL_DATATYPE_ENUM8,
				ACCESS_CONTROL_READ,
				(void *)&sampleApp_Basic_PowerSource
			}
	},
	{
		ZCL_CLUSTER_ID_GENERAL_BASIC,
			{
				ATTRID_CLUSTER_REVISION,
				ZCL_DATATYPE_UINT16,
				ACCESS_CONTROL_READ,
				(void *)&sampleApp_Basic_ClusterRevision
			}
	},
	{
		ZCL_CLUSTER_ID_GENERAL_BASIC,
			{
				ATTRID_BASIC_MANUFACTURER_NAME ,
				ZCL_DATATYPE_CHAR_STR,
				ACCESS_CONTROL_READ,
				(void *)&sampleApp_Basic_ManufacturerName
			}
	},
	{
		ZCL_CLUSTER_ID_GENERAL_BASIC,
			{
				ATTRID_BASIC_MODEL_IDENTIFIER ,
				ZCL_DATATYPE_CHAR_STR,
				ACCESS_CONTROL_READ,
				(void *)&sampleApp_Basic_ModelIdentifier
			}
	},...

So, the attribute ID order for the generated is:

ZCL_CLUSTER_ID_GENERAL_BASIC - 

ATTRID_BASIC_ZCL_VERSION (0x000)

ATTRID_BASIC_POWER_SOURCE (0x0007)

ATTRID_CLUSTER_REVISION (0xFFFD)

ATTRID_BASIC_MANUFACTURER_NAME (0x0004)

ATTRID_BASIC_MODEL_IDENTIFIER (0x0005)

Per the comment at the beginning of the generated code the attributes need to be in ascending order, however, the generated code is not, which seems odd, so here are my questions:

Is the comment no longer accurate and unnecessary? 

Is this a known issue with the zigbee application builder? 

Are there nuances with application builder that cause this behavior that users should be aware of?

FYI - other cluster attributes in the generated code were also not in ascending order.

Thank you for your help.

Gene

  • Hi Gene,

    Thank you for reporting this observation!  I am coordinating with the Software Development Team to further investigate and will provide more information when available.  Can you share the exact SysConfig Zigbee Application Builder steps necessary to reproduce this output?

    Regards,
    Ryan

  • Ryan,

    Below is the .syscfg file.  Let me know if you need additional information.

    Gene

    /**
     * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
     * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
     * @cliArgs --device "CC1352P1F3RGZ" --package "RGZ" --part "Default" --product "simplelink_cc13x2_26x2_sdk@4.40.00.44"
     * @versions {"data":"2021010520","timestamp":"2021010520","tool":"1.7.0+1746","templates":null}
     */
    
    /**
     * Import the modules used in this configuration.
     */
    const CCFG     = scripting.addModule("/ti/devices/CCFG");
    const rfdesign = scripting.addModule("/ti/devices/radioconfig/rfdesign");
    const AESCBC   = scripting.addModule("/ti/drivers/AESCBC");
    const AESCBC1  = AESCBC.addInstance();
    const AESCCM   = scripting.addModule("/ti/drivers/AESCCM");
    const AESCCM1  = AESCCM.addInstance();
    const AESECB   = scripting.addModule("/ti/drivers/AESECB");
    const AESECB1  = AESECB.addInstance();
    const DMA      = scripting.addModule("/ti/drivers/DMA");
    const ECDH     = scripting.addModule("/ti/drivers/ECDH");
    const ECDH1    = ECDH.addInstance();
    const ECDSA    = scripting.addModule("/ti/drivers/ECDSA");
    const ECDSA1   = ECDSA.addInstance();
    const ECJPAKE  = scripting.addModule("/ti/drivers/ECJPAKE");
    const ECJPAKE1 = ECJPAKE.addInstance();
    const GPIO     = scripting.addModule("/ti/drivers/GPIO", {}, false);
    const GPIO11   = GPIO.addInstance();
    const GPIO12   = GPIO.addInstance();
    const NVS      = scripting.addModule("/ti/drivers/NVS");
    const NVS1     = NVS.addInstance();
    const Power    = scripting.addModule("/ti/drivers/Power");
    const RF       = scripting.addModule("/ti/drivers/RF");
    const SHA2     = scripting.addModule("/ti/drivers/SHA2");
    const SHA21    = SHA2.addInstance();
    const TRNG     = scripting.addModule("/ti/drivers/TRNG");
    const TRNG1    = TRNG.addInstance();
    const UART     = scripting.addModule("/ti/drivers/UART");
    const UART1    = UART.addInstance();
    const Button   = scripting.addModule("/ti/drivers/apps/Button");
    const Button1  = Button.addInstance();
    const Button2  = Button.addInstance();
    const Button3  = Button.addInstance();
    const Button4  = Button.addInstance();
    const Button5  = Button.addInstance();
    const Button6  = Button.addInstance();
    const Button7  = Button.addInstance();
    const LED      = scripting.addModule("/ti/drivers/apps/LED");
    const LED1     = LED.addInstance();
    const LED2     = LED.addInstance();
    const LED3     = LED.addInstance();
    const zstack   = scripting.addModule("/ti/zstack/zstack");
    
    /**
     * Write custom configuration values to the imported modules.
     */
    CCFG.xoscCapArrayDelta        = 0xC1;
    CCFG.enableBootloader         = true;
    CCFG.enableBootloaderBackdoor = true;
    CCFG.dioBootloaderBackdoor    = 15;
    CCFG.levelBootloaderBackdoor  = "Active low";
    CCFG.ccfgTemplate.$name       = "ti_devices_CCFGTemplate0";
    
    rfdesign.rfDesign = "LAUNCHXL-CC1352P-2";
    rfdesign.fbSub1g  = "none";
    
    AESCBC1.$name = "CONFIG_AESCBC_0";
    
    AESCCM1.$name             = "CONFIG_AESCCM_0";
    AESCCM1.interruptPriority = "2";
    
    AESECB1.$name             = "CONFIG_AESECB_0";
    AESECB1.interruptPriority = "1";
    
    ECDH1.$name = "CONFIG_ECDH_0";
    
    ECDSA1.$name = "CONFIG_ECDSA_0";
    
    ECJPAKE1.$name = "CONFIG_ECJPAKE_0";
    
    GPIO11.$name             = "CONFIG_GPIO_TIMING_DO";
    GPIO11.mode              = "Output";
    GPIO11.pull              = "Pull Up";
    GPIO11.gpioPin.$assign   = "DIO_10";
    GPIO11.pinInstance.$name = "CONFIG_PIN_6";
    
    GPIO12.$name             = "CONFIG_GPIO_ENABLE_BLUE_LED";
    GPIO12.pull              = "Pull Up";
    GPIO12.gpioPin.$assign   = "DIO_11";
    GPIO12.pinInstance.$name = "CONFIG_PIN_7";
    
    NVS1.$name                    = "CONFIG_NVSINTERNAL";
    NVS1.internalFlash.$name      = "ti_drivers_nvs_NVSCC26XX0";
    NVS1.internalFlash.regionBase = 0x52000;
    NVS1.internalFlash.regionSize = 0x4000;
    
    RF.globalCallbackFunction = "rfDriverCallback";
    RF.rfAntennaPinSymbol1    = "CONFIG_RF_HIGH_PA";
    RF.pinSelectionAntenna    = 2;
    RF.rfAntennaPinSymbol0    = "CONFIG_RF_24GHZ";
    RF.rfAntennaPin0.$assign  = "DIO_6";
    RF.rfAntennaPin1.$assign  = "DIO_5";
    
    SHA21.$name = "CONFIG_SHA2_0";
    
    TRNG1.$name = "CONFIG_TRNG_0";
    
    UART1.$name               = "CONFIG_DISPLAY_UART";
    UART1.uart.$assign        = "UART0";
    UART1.uart.txPin.$assign  = "DIO_16";
    UART1.uart.rxPin.$assign  = "DIO_17";
    UART1.txPinInstance.$name = "CONFIG_PIN_UART_TX";
    UART1.rxPinInstance.$name = "CONFIG_PIN_UART_RX";
    
    Button1.$name                     = "CONFIG_BTN_LEFT";
    Button1.gpioPin.$name             = "CONFIG_GPIO_BTN1";
    Button1.gpioPin.gpioPin.$assign   = "DIO_21";
    Button1.gpioPin.pinInstance.$name = "CONFIG_PIN_BTN1";
    
    Button2.$name                     = "CONFIG_BTN_RIGHT";
    Button2.gpioPin.$name             = "CONFIG_GPIO_BTN2";
    Button2.gpioPin.gpioPin.$assign   = "DIO_14";
    Button2.gpioPin.pinInstance.$name = "CONFIG_PIN_BTN2";
    
    Button3.$name                     = "CONFIG_BTN_CTRL_1";
    Button3.gpioPin.$name             = "CONFIG_GPIO__CTRL_1";
    Button3.gpioPin.gpioPin.$assign   = "DIO_22";
    Button3.gpioPin.pinInstance.$name = "CONFIG_PIN_0";
    
    Button4.$name                     = "CONFIG_BTN_CTRL_2";
    Button4.gpioPin.$name             = "CONFIG_GPIO__CTRL_2";
    Button4.gpioPin.gpioPin.$assign   = "DIO_23";
    Button4.gpioPin.pinInstance.$name = "CONFIG_PIN_1";
    
    Button5.$name                     = "CONFIG_BTN_CTRL_3";
    Button5.gpioPin.$name             = "CONFIG_GPIO__CTRL_3";
    Button5.gpioPin.gpioPin.$assign   = "DIO_24";
    Button5.gpioPin.pinInstance.$name = "CONFIG_PIN_2";
    
    Button6.$name                     = "CONFIG_BTN_CTRL_4";
    Button6.gpioPin.$name             = "CONFIG_GPIO__CTRL_4";
    Button6.gpioPin.gpioPin.$assign   = "DIO_25";
    Button6.gpioPin.pinInstance.$name = "CONFIG_PIN_3";
    
    Button7.$name                     = "CONFIG_BTN_CTRL_5";
    Button7.gpioPin.$name             = "CONFIG_GPIO__CTRL_5";
    Button7.gpioPin.gpioPin.$assign   = "DIO_26";
    Button7.gpioPin.pinInstance.$name = "CONFIG_PIN_4";
    
    LED1.$name                     = "CONFIG_LED_RED";
    LED1.gpioPin.$name             = "CONFIG_GPIO_RLED";
    LED1.gpioPin.pinInstance.$name = "CONFIG_PIN_RLED";
    
    LED2.$name                     = "CONFIG_LED_GREEN";
    LED2.gpioPin.$name             = "CONFIG_GPIO_GLED";
    LED2.gpioPin.pinInstance.$name = "CONFIG_PIN_GLED";
    
    LED3.$name                     = "CONFIG_LED_BLUE";
    LED3.gpioPin.gpioPin.$assign   = "DIO_20";
    LED3.gpioPin.pinInstance.$name = "CONFIG_PIN_5";
    
    zstack.deviceType                              = "zed";
    zstack.deviceTypeReadOnly                      = true;
    zstack.appBuilder                              = true;
    zstack.touchlink.$name                         = "ti_zstack_touchlink_zstack_touchlink0";
    zstack.pm.$name                                = "ti_zstack_pm_zstack_pm0";
    zstack.pm.pollPeriod                           = 7000;
    zstack.pm.rejoinMessagePollPeriod              = 1200;
    zstack.rf.$name                                = "ti_zstack_rf_zstack_rf0";
    zstack.rf.primaryChannels                      = [24];
    zstack.rf.txPower                              = "4";
    zstack.rf.radioConfig.$name                    = "ti_devices_radioconfig_settings_ieee_15_40";
    zstack.rf.radioConfig.codeExportConfig.$name   = "ti_devices_radioconfig_code_export_param0";
    zstack.network.$name                           = "ti_zstack_network_zstack_network0";
    zstack.advanced.$name                          = "ti_zstack_advanced_zstack_advanced0";
    zstack.advanced.routing.$name                  = "ti_zstack_advanced_zstack_routing0";
    zstack.advanced.packetSending.$name            = "ti_zstack_advanced_zstack_packet_sending0";
    zstack.advanced.tableSize.$name                = "ti_zstack_advanced_zstack_table_size0";
    zstack.app.$name                               = "ti_zstack_app_zstack_app0";
    zstack.app["0x0001addServer"]                  = ["0x0001"];
    zstack.app["0x0001acoaServer"]                 = ["0x0021"];
    zstack.app.bdbReportingMaxAnalogAttrSize       = 2;
    zstack.app.server0x00010x0021reportableChange  = 0x2;
    zstack.app.server0x00010x0021maxReportInterval = 0x12C;
    zstack.app["0x0001recClient"]                  = ["0x0004","0x0005"];
    zstack.app["0x0000mcoaServer"]                 = ["0x0004","0x0005"];
    zstack.app.zigbeeDeviceType                    = "0xFFFE";
    zstack.app["0xFFFEaddServer"]                  = ["0x0001"];
    zstack.app["0xFFFEaddClient"]                  = ["0x0003","0x0004","0x0005","0x0006","0x0008"];
    zstack.otaClient.$name                         = "ti_zstack_app_zstack_ota_client0";
    
    /**
     * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
     * version of the tool will not impact the pinmux you originally saw.  These lines can be completely deleted in order to
     * re-solve from scratch.
     */
    LED1.gpioPin.gpioPin.$suggestSolution = "DIO_7";
    LED2.gpioPin.gpioPin.$suggestSolution = "DIO_8";

  • Thank you for providing this so quickly.

    Regards,
    Ryan

  • This behavior is easily replicated by adding optional attributes to the pre-determined clusters of any provided device types, we are continuing to investigate.

    Regards,
    Ryan

  • Ryan,

    When do you expect feedback from the software development team?

    Gene

  • Hi,

    Many areas in Dallas metroplex are currently experiencing unforeseen power outages due to harsher-than-normal winter weather; we appreciate your patience, as responses may be delayed here.

    We will provide you update about this as soon as we are able to.

    Regards,
    Toby

  • Hi Gene,

    Thanks again for providing this information and my apologies for the late response.  I've confirmed that the ZCL Specification requires that the attribute list be provided in ascending order for Discover Response Commands but that the Z-Stack ZCL implementation does not re-order the attribute list from the application data file.  I've submitted this information to the Software Development Team and am waiting for their recommended resolution path.

    Regards,
    Ryan

  • Hi Ryan,

    Thank you for the update.  Based on my reviews I concur with both of your assertions.  Keep me posted.

    Regards,

    Gene