Wednesday, August 31, 2016

How to handle end node announcement, active endpoint response, and simple descriptor response in Z-Stack for CC2530 and CC2538.

When a Zigbee device joins network, it would broadcast end node announcement with its short and IEEE address. We can register a callback event in Z-Stack to receive end node announcement and store short/IEEE address of device to a device list. Then, we usually call ZDP_ActiveEPReq to request active endpoint and register a callback event in Z-Stack to receive active endpoint response and store it to device list. Finally, we can call ZDP_SimpleDescReq to request simple descriptor and register a callback event in Z-Stack to receive simple descriptor response and store it to device list too.

The following steps show you how to handle end node announcement in Z-Stack SampleLight.

1. Add "ZDO_RegisterForZDOMsg(task_id, Device_annce);" in zclSampleLight_Init().

2. Add the following codes to process Device_annce event in zclSampleLight_ProcessZDOMsgs and you would get end node announcement  information in devAnnce structure.

  ZDO_DeviceAnnce_t devAnnce;

if ( pMsg->clusterID == Device_annce )
      ZDO_ParseDeviceAnnce( pMsg, &devAnnce );





The following steps show you how to handle active endpoint response in Z-Stack SampleLight.

1. Add "ZDO_RegisterForZDOMsg(task_id, Active_EP_rsp);" in zclSampleLight_Init().

2. Add the following codes to process Active_EP_rsp event in zclSampleLight_ProcessZDOMsgs and you would get end node announcement information in pActiveEndpointRsp pointer of ZDO_ActiveEndpointRsp_t structure.

  ZDO_ActiveEndpointRsp_t *pActiveEndpointRsp;

  if ( pMsg->clusterID == Active_EP_rsp )
      pActiveEndpointRsp = ZDO_ParseEPListRsp( pMsg );


The following steps show you how to handle simple descriptor response in Z-Stack SampleLight.

1. Add "ZDO_RegisterForZDOMsg(task_id, Simple_Desc_rsp);" in zclSampleLight_Init().

2. Add the following codes to process Simple_Desc_rsp event in zclSampleLight_ProcessZDOMsgs and you would get simple descriptor in simpleDescRsp structure.

  ZDO_SimpleDescRsp_t simpleDescRsp;

  if ( pMsg->clusterID == Simple_Desc_rsp )
      ZDO_ParseSimpleDescRsp( pMsg, &simpleDescRsp );

Monday, August 22, 2016

How to use backdoor serial boot loader for CC2650/CC2640/CC2630/CC2538

The following steps show you how to use backdoor serial boot loader for CC2650/CC2640/CC2630/CC2538

1. CC2650/CC2640/CC2630/CC2538 support backdoor Serial Bootloader Interface by default. It might be sometimes overwritten by your application so you might need to do "Mass Erase" from Flash Programmer 2 to make it come back.


2. Hold "SELECT" and press "RESET" button on SmartRF06EB.

3. Select correct chip from virtual COM port simulated by SmartRF06EB. In my case, I use CC2650


4. Then click mouse right button to connect CC2650 from virtual COM port.


5. Select FW and download it to CC2650. You would get the following error and "Failed" on Flash Programmer2 but it actually program and verify successfully.

>Initiate access to target: COM53.
>Reading file: C:/ti/simplelink/ble_sdk_2_02_00_31/examples/hex/cc2650lp_host_test_rel.hex.
>Start flash erase ...
>Erase finished successfully.
>Start flash programming ...
>Warning: CC2650 bootloader will be disabled.
>Flash programming locked bootloader access. No further actions possible.
>Programming finished successfully.
>Start flash verify ...
>ERROR: No connection between interface and target.
>Reset target ...


6. Test your application on CC2650