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.

zigbee pro stack on cc2531 dongle ( and using USB )

Other Parts Discussed in Thread: CC2531, Z-STACK

There is an  example on how to use cc2531 to connect 2 computers via MRFI

I am wondering if there is an example of the same or similar app while using ZigBee PRO stack: cc2531 + ZigBee PRO + usb

Thanks

  • Hi,

     

    Any sample application distributed with Z-stack installation can be quite easily adjusted to work

    with cc2531 USB dongle. There are several threads describing how these adjustments can be

    done. Here's a link to one of these threads (try to read it till the end).

  • I understand that it is frustrating to you that Z-Stack 2.5.0 did not have any sample applications besides the ZNP which are built for the CC2531 out-of-the-box, and believe me, I am doing everything in my very limited power to add some to a future release. But in the mean time, it is also very, very frustrating to see redundant questions asked by community members who do not even make the simple effort to first searching for their question before making a new post. Would you please review this post:

    http://e2e.ti.com/support/low_power_rf/f/158/t/36068.aspx

     

  • Thank you but no luck. I think it might be not that simple after all. 

    BTW, USB project extracted to fresh copy 2.5.0 ( into General app ) doesn't build either.  IAR 8.10

    The bottom line is that claim of cc2531 running Z stack 2.5.0 and supporting USB 2.0 has to be supported by some working application example.

     

  • Please unzip this folder here:

    C:\Texas Instruments\ZStack-CC2530-2.5.0\Projects\zstack\Samples\GenericApp

     

     

    GenericApp-CC2531.zip
  • Or try this one here:

    C:\Texas Instruments\ZStack-CC2530-2.5.0\Projects\zstack\Utilities\SerialApp

     

    SerialApp-CC2531.zip
  • Thank you DH,

    That is exactly what I was looking for. Generic App is working as advertised

     

    Regarding serialApp,  I still cannot make it work the same way as in an example that comes with cc2531 ( using mrfi ). Devices are recognized but no serial communication.

    Loopbacks to terminals  are working (USB), but have I have problems to connect dongles OTA

    Can you please shorty describe the procedure of setting this up? Or correct me on follows.

      1. one dongle is loaded with the code built for coordinator, another one with the code built for router ( dongle with the code built for end device  for some reasons cannot be connected to PC terminal, although USB is recognized by windows 7 )

      2. S2 button ( SW2) on a router ( or end device )is used to send a Bind request. I do not see it 

       So, no progress from here ...

    3. S1 is not used ?  Or it  should be used to Initiate a Match discovery ( HAL_KEY_SW6 instead of SW4 ) ?

     

    Really appreciate your quick response with code drops !

    Regards,

     

    Nick

     

     

  • Hi,

     

    nick wolf said:
    dongle with the code built for end device  for some reasons cannot be connected to PC terminal, although USB is recognized by windows 7

    Try it on a PC with XP and hyperterminal.

     

    nick wolf said:

      2. S2 button ( SW2) on a router ( or end device )is used to send a Bind request. I do not see it 

       So, no progress from here ...

    3. S1 is not used ?  Or it  should be used to Initiate a Match discovery ( HAL_KEY_SW6 instead of SW4 ) ?

    Dongles uses  slightly different pinout for SW1 and SW2 than the smartRF05EB/BB boards.

    For the Match Description Request initiation the content under if ( keys & HAL_KEY_SW_4 ) should be copied

    and commented out (not necessary) and pasted under if ( keys & HAL_KEY_SW_1 ). 

    Attached is an example of changes to be done

        if ( keys & HAL_KEY_SW_1 )
        {
    	  HalLedSet ( HAL_LED_4, HAL_LED_MODE_OFF );
          
          // Initiate a Match Description Request (Service Discovery)
          txAddr.addrMode = AddrBroadcast;
          txAddr.addr.shortAddr = NWK_BROADCAST_SHORTADDR;
          ZDP_MatchDescReq( &txAddr, NWK_BROADCAST_SHORTADDR,
                            SERIALAPP_PROFID,
                            SERIALAPP_MAX_CLUSTERS, (cId_t *)SerialApp_ClusterList,
                            SERIALAPP_MAX_CLUSTERS, (cId_t *)SerialApp_ClusterList,
                            FALSE );
        }
    	
        if ( keys & HAL_KEY_SW_2 )
        {
          HalLedSet ( HAL_LED_4, HAL_LED_MODE_OFF );
          
          // Initiate an End Device Bind Request for the mandatory endpoint
          txAddr.addrMode = Addr16Bit;
          txAddr.addr.shortAddr = 0x0000; // Coordinator
          ZDP_EndDeviceBindReq( &txAddr, NLME_GetShortAddr(), 
                                SerialApp_epDesc.endPoint,
                                SERIALAPP_PROFID,
                                SERIALAPP_MAX_CLUSTERS, (cId_t *)SerialApp_ClusterList,
                                SERIALAPP_MAX_CLUSTERS, (cId_t *)SerialApp_ClusterList,
                                FALSE );
        }
    
        if ( keys & HAL_KEY_SW_3 )
        {
        }
    
        if ( keys & HAL_KEY_SW_4 )
        {
    /*      HalLedSet ( HAL_LED_4, HAL_LED_MODE_OFF );
          
          // Initiate a Match Description Request (Service Discovery)
          txAddr.addrMode = AddrBroadcast;
          txAddr.addr.shortAddr = NWK_BROADCAST_SHORTADDR;
          ZDP_MatchDescReq( &txAddr, NWK_BROADCAST_SHORTADDR,
                            SERIALAPP_PROFID,
                            SERIALAPP_MAX_CLUSTERS, (cId_t *)SerialApp_ClusterList,
                            SERIALAPP_MAX_CLUSTERS, (cId_t *)SerialApp_ClusterList,
                            FALSE );
    */
        }
     

    The reason to this change lies in the hal_key.c, HakKeyRead() function.

    So now Nick, you have to initiate Match description request first and then bind two nodes. It should be working now.

  • Thank you Igor.

    Yes,

    I figured this part and using S1 ( HAL_KEY_SW_1) to initiate match desr request.

    Now, I got bind and match request ACKs and the whole sequence looks good.

    But,

    1) It works only for Coord - Router pair and, it is working in one direction only ( sending characters ) from Router to Coordinator ( using termpro)

    2) I have no luck to get End Device working ( not even beacon requests coming out ). Settings in a project?

    3) If I use a debugger on router side, I see warnings of IDATA overflow and it dies in a few seconds ( optimization is high )

    Regards,

    Nick

     

     

     

  • Hi,

     

    I'll start answering out of order:

    nick wolf said:
    2) I have no luck to get End Device working ( not even beacon requests coming out ). Settings in a project?

    Dongles have no 32KHz crystal installed, so you must add OSC32K_CRYSTAL_INSTALLED=FALSE

    (copy and paste it) to defined symbols. Open serialApp proj in IAR EW,

    then go to project options (Alt+F7) -> C/C++ Compiler-> Preprocessor (tab) -> Defined symbols (sub window).

    Actually, for consistency you should add this line to Coordinator and router projects too, well at least when

    you'r working with TI's USB dongles.

    You wasn't supposed to guess this. I myself completely forgotten of it.

     

    nick wolf said:
    1) It works only for Coord - Router pair and, it is working in one direction only ( sending characters ) from Router to Coordinator ( using termpro)

    I don't remember very well the binding thing. May be you'll find something useful in the

    "Z-Stack Sample Applications.pdf" document,

    section 3.

     

    nick wolf said:
    3) If I use a debugger on router side, I see warnings of IDATA overflow and it dies in a few seconds ( optimization is high )

    May be some problem with the new application (I mean for USB dongle). Since it probably will be distributed in future Z-stack releases, it is importent

    that DH will know about these overflows.

  • 1) Now it works in both directions if S2 is pressed on both coordinator and router at  the same time ( End Device Bind Request). So your referral  to Z-Stack Sample Application doc was very useful.  I was trying to do binding/ matching  from a router...and got one directional ( router to coordinator ) cable replacement connection

    2) The problem with End Device is still here, device not  sending beacon requests even after adding OSC32K_CRYSTAL_INSTALLED=FALSE as described in Igor's message

    Probably something else needs to be added/changed.

    Thank you for help, I have something to build on now.

    Regards,

     

    Nick

  • Hi Igor,

     In your post u have mentioned this

    For the Match Description Request initiation the content under if ( keys & HAL_KEY_SW_4 ) should be copied

    and commented out (not necessary) and pasted under if ( keys & HAL_KEY_SW_1 ).

    If we do only this much change will it work. Is there any changes need to be done in hal_key.c or hal_key.h.

    Thanks,

    abcd

  • Hi abcd,

     

    If I remember this right, you are using cc2531USB dongle?

    I think no changes to be done in the hal_key.c and hal_key.h

    as long as those source files taken from CC2530USB folder.

    If you are not sure, attach these files so I can take a look.