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.

Beaglebone Black with CC2530

Other Parts Discussed in Thread: CC2531, CC2530, Z-STACK

Hi there,

I have a BBB connected to CC2530 via UART. Reason of having this project is I would like to explore myself in ZigBee world with Linux. I am looking for some application note which is using CC2530 with Linux OS but the closest I found is CC2531.

I managed to download this setup from TI: Z-STACK-LINUX-GATEWAY which I had install this into my Ubuntu machine. My understanding is, it came with a prebuild binary that I need to copy into BBB lib directory then run the two scripts. Am I right? Do I need to rebuild anything to make it running in my BBB. My BBB is running Debian Wheezy OS and Linux is Kernel 3.8.13.

About the ZNP hex file, because I am using CC2530 can I use this hex from the project I downloaded from TI website and the zip file name:  swrc126.zip.

Do I need to modify anything in order to make the application in Linux talk to my CC2530 zigBee. Do not worry about the UART port in my BBB since I have enable from the Device Tree. 

Please let correct if I have overlook something?

Thank you

  •  I suggest you to install Z-Stack Home 1.2 and there are prebuild CC2530 ZNP HEX FILE.

  • Hi YiKai,

    Do you mean for the firmware for CC2530 ZNP? I though I need to modify the firmware for the GPIO pins in order to make it working? Does the Z-Stack Linux will talk to CC2530 ZNP ? and what are the available hardware that I can get from TI for testing (to verify the ZigBee is working)?

    Please advice. Thank you.

  • Hi Zhi,

    Gateway installer includes CC2531 ZNP image (CC2531-GW-ZNP_38724.hex ), It is not CC2530 ZNP. In case your aim is to get acquainted to ZigBee/Gateway, I suggest you work with Beaglebone +CC2531 dongle instead to avoid complexity since you are missing CC2530 ZNP plus you will have to make modifications to gateway scripts /cfg files since Gateway assumes ZNP is connected to USB Host. Please refer to user guide, addendum and other installed docs.

    Thanks,

    Saurabh

  • Hi Saurabh,

    I am sure someone out there are trying my approached. Will this a show stopper if I insist want to use CC2530? I though e2e forum will provide supports on their products?

    Is it diffucult to get CC2530ZNP image from TI? So is TI not expecting CC2530 work as ZNP? and what about the cfg files? Will it be too difficult to modify the cfg file? My understanding is, CC2531 will be detected as a typical USB to Serial device. All the communication are done via ttyUSB0 or ttyOx and the only different I can see is the Reset pin control. Are these hard to implement onto the CC2531?

  • I think TI only provide an example for user reference and they choose CC2531 dongle. It might because it is easy to connect with USB. I suggest you follow Saurabh's suggestion to do the steps on default set and make it work first. Then, you can modify anything you want accordingly.

  • Hi,

    we started releasing the Z-Stack Linux gateway as a combination of USB dongle only product, associated to BeagleBone black. These boards can be purchased on TI estore and on beagleboard.org so very easily used for prototyping and system evaluation. We therefore recommend using these boards.

    As mentioned we are running ZNP firmware on the USB dongle, so from an architecture standpoint this is the same as a CC2530 ZNP firmware. As Saurabh said, the configuration script which triggers the reset of the chip would have to be modified when moving to CC2530. The gateway middleware won't change, as the gateway servers we developed are independent of the serial transport layer underneath.

    The CC2531 USB dongle provides a USB serial interface as USB modem (tty/ACMx)

    The Linux gateway product we built is the first of its kind and we are listening to customer feedback as to ways to improve this product, as we aim at ease of integration and simplicity in adopting ZigBee in Linux.

    Thanks,

    TheDarkSide

  • Hi,

    Excellent. Yes I am using CC2530 ZNP firmware and therefore I will be required to modified the zigbeeHAgw script file in order to reset the CC2530 chip. Please correct me if I am wrong.

    I think the following modification shall be apply:

    1. replace /dev/ttyACM0 to /dev/ttyO1 in zigbeeHAgw and NPI_Gateway.cfg

    2. The function, hw_reset_soc() in zigbeeHAgw shall be modify to replace "../tools/bbb_usbreset.bin" by some line of code to pull-down the reset-gpio pin and send 0x07 to CC2530 5 seconds after its reset-gpio pin is pull low?

    I guess the above chances shall make it works?

  • Hi Zhi Yong,

    I'm interested to use SmartRF05+CC2530+serialtousb(ttyUSB0) just like you did. Any luck yet? How about ZNP gateway firmware for CC2530? I try using sampleswitch firmware, it did not work.

  • hi Sir,

    Do you know why we need to reset USB dongle before use it?

    Because it will cause trouble if we have usb hub connect on with BBB.

    wenij

  • Hi Zhi Yong Woo,
    I have done the modifications suggested by you but when I run that script (./zigbeeHAgw bbb) then it is not working
    It is stuck here:
    ./zigbeeHAgw bbb
    running zigbeegw.scr on an ARM
    resetting beaglebone black
    sleeping 6 seconds after reset... Using serial port: /dev/ttyO4

    Then I just made "ignore_zigbee_reset=1" then it was running but showing error:
    root@beaglebone:~/z-stack_linux_gateway_arm_binaries/servers# ./zigbeeHAgw bbb
    running zigbeegw.scr on an ARM
    skipping zigbee reset
    Starting the ZigBee gateway subsystem
    deviceKey = 0 (0 )
    devPath = '/dev/ttyO4'
    logPath = './NpiLnxLog.txt'
    ... freeing memory (ret 0)
    Port: 2533
    Following IP addresses are available:

    IPv4: interface: lo IP Address 127.0.0.1
    IPv4: interface: eth0 IP Address 192.168.1.6
    IPv4: interface: usb0 IP Address 192.168.7.2
    IPv6: interface: lo IP Address ::1
    IPv6: interface: eth0 IP Address fd5d:45af:ba6c:0:6eec:ebff:fead:a857
    IPv6: interface: eth0 IP Address fe80::6eec:ebff:fead:a857
    IPv6: interface: usb0 IP Address fe80::ac89:23ff:fe06:3a58
    The socket will listen on the following IP addresses:

    IPv4: 0.0.0.0
    IPv6: ::
    0.0.0.0 means it will listen to all available IP address

    waiting for first connection on #3...
    NPI started (pid 2307) at Mon Sep 21 07:12:57 UTC 2015
    Connected to #5.(127.0.0.1 / ::5868:d7be:a068:d7be)
    ZLSZNP started (pid 2312) at Mon Sep 21 07:13:02 UTC 2015
    [NWK_MGR/MAIN] : there are 2 args
    [NWK_MGR/MAIN] : argv[0] = ./NWKMGR_SRVR_arm
    [NWK_MGR/MAIN] : argv[1] = 127.0.0.1:2536
    [NWK_MGR/MAIN] : ************************************************
    [NWK_MGR/MAIN] : * Network Manager Server v1.0.1 *
    [NWK_MGR/MAIN] : * The following are the avaible key commands: *
    [NWK_MGR/MAIN] : * Exit Program. - q *
    [NWK_MGR/MAIN] : ************************************************
    NETWORK MANAGER started (pid 2319) at Mon Sep 21 07:13:03 UTC 2015
    [GATEWAY/MAIN] :
    [GATEWAY/MAIN] : ************************************************
    [GATEWAY/MAIN] : * Gateway Server v1.0.1 *
    [GATEWAY/MAIN] : * The following are the avaible key commands: *
    [GATEWAY/MAIN] : * Exit Program. - q *
    [GATEWAY/MAIN] : ************************************************

    GATEWAY SERVER started (pid 2325) at Mon Sep 21 07:13:05 UTC 2015
    [OTASRVR/MAIN] :
    [OTASRVR/MAIN] : ************************************************
    [OTASRVR/MAIN] : * OTA Upgrade Server 1.0.1 *
    [OTASRVR/MAIN] : * The following are the avaible key commands: *
    [OTASRVR/MAIN] : * Exit Program. - q *
    [OTASRVR/MAIN] : ************************************************

    [NWK_MGR/MAIN] ERROR: Endpoint Registration Failed
    [NWK_MGR/MAIN] ERROR: Registering ZDO Callbacks Failed
    [NWK_MGR/MAIN] ERROR: Reading Local Network Information Failed
    [NWK_MGR/MAIN] : Initialization failed. Quitting now. mhoyt

    OTA SERVER started (pid 2334) at Mon Sep 21 07:13:07 UTC 2015
    [OTASRVR/MAIN] :
    Error - Could not register OTA endpoint with zstackserver.Exiting...

    starting tracker with our pid ./zigbeeHAgw and pid list 2307 2312 2325 2334
    ===================================================
    NETWORK MANAGER exited with code 255 at Mon Sep 21 07:13:07 UTC 2015
    ./zigbeeHAgw: line 482: 2346 Killed ./track_servers $$ "$pids"
    OTA_SRVR_arm: no process found
    unexpected exit code (255) from netmgr!

    can you help me with this?

    regards,
    Aashish Khairnar.
  • Do you plug CC2531 USB dongle to BBB? By the way, what FW do you use on your CC2531 USB dongle?
  • Hi sir,
    I'm actually using CC2530 so for that I have made changes in script .
    For CC2530 I have done connections for UART.
    Thank you.
  • In order to create a fully compatible firmware, you will have to rebuild the znp project with ENABLE_MT_SYS_RESET_SHUTDOWN defined (refer to e2e.ti.com/.../1450380. Do you do this?
  • Sorry for late reply sir.
    Yes I followed instruction given on that link and created fully compatible firmware.
    Regards,
    Aashish Khairnar
  • Hi Aashish Khairnar26,

    How did you get it to work. I've been trying to make a compatible ZNP firmware for CC2531 to use with TI ZigBee Home Automation Gateway.

    This is my setup:
    BBB + Debian Wheezy+CC2531

    If using CC2531 firmware given together with TI ZigBee Home Automation Gateway, all is working fine.
    But I try to make my own firmware by using ZNP source and add ENABLE_MT_SYS_RESET_SHUTDOWN compile option. I never had success.

    This is what I find so far:

    If using IAR 9.20.1, IAR 9.10.1 or even newer and Z-Stack Home 1.2.2,

    I will get this error:
    Error[Pe223]: function "MAC_RADIO_RXTX_OFF" declared implicitly C:\Texas Instruments\Z-Stack Home 1.2.2 SAINS\Components\mt\MT_SYS.c 2150
    Error[Pe223]: function "MAC_RADIO_FLUSH_RX_FIFO" declared implicitly C:\Texas Instruments\Z-Stack Home 1.2.2 SAINS\Components\mt\MT_SYS.c 2153
    Error[Pe223]: function "MAC_RADIO_CLEAR_RX_THRESHOLD_INTERRUPT_FLAG" declared implicitly C:\Texas Instruments\Z-Stack Home 1.2.2 SAINS\Components\mt\MT_SYS.c 2156
    Error[Pe223]: function "MAC_RADIO_TIMER_SLEEP" declared implicitly C:\Texas Instruments\Z-Stack Home 1.2.2 SAINS\Components\mt\MT_SYS.c 2159
    Error[Pe223]: function "MAC_RADIO_TURN_OFF_POWER" declared implicitly C:\Texas Instruments\Z-Stack Home 1.2.2 SAINS\Components\mt\MT_SYS.c 2162
    Error while running C/C++ Compiler

    To fix that I made a changes in \Z-Stack Home 1.2.2 SAINS\Components\mt\MT_SYS.c

    and comments all the related error line:

    /* turn off the receiver */
    //MAC_RADIO_RXTX_OFF();

    /* just in case a receive was about to start, flush the receive FIFO */
    //MAC_RADIO_FLUSH_RX_FIFO();

    /* clear any receive interrupt that happened to squeak through */
    //MAC_RADIO_CLEAR_RX_THRESHOLD_INTERRUPT_FLAG();

    /* put MAC timer to sleep */
    //MAC_RADIO_TIMER_SLEEP();

    /* power of radio */
    //MAC_RADIO_TURN_OFF_POWER();

    All compile fine now. I get the binary in \Projects\zstack\ZNP\CC253x\CC2531-ProdHex\Exe,
    Flash and put at Beaglebone, lsusb command did not see any TI CC2531 USB dongle. It did if use firmware from TI.

    Then I go back to use old IAR 8.30.2.
    Z-Stack Home 1.2.2 - cannot open, so now I use Z-Stack Home 1.2.1.

    Compile fine without the need of any changes that I did previously.
    Flash and put at Beaglebone, lsusb command still did not see any TI CC2531 USB dongle.

    I did follow exactly as said in e2e.ti.com/.../1450380

    ZNP project, select CC2531-ProdHex, add compile option "ENABLE_MT_SYS_RESET_SHUTDOWN"

    What I had in Defined Symbols:
    FEATURE_SYSTEM_STATS
    CC2531ZNP
    POWER_SAVING
    ASSERT_RESET
    FAKE_CRC_SHDW
    ENABLE_MT_SYS_RESET_SHUTDOWN

    The only different is output location mention should be C:\Texas Instruments\Z-Stack Home 1.2.1\Projects\zstack\ZNP\CC253x\dev\CC2530ZNP-Prod.hex

    I never had that dev folder. my output location is \Projects\zstack\ZNP\CC253x\CC2531-ProdHex\Exe\CC2530ZNP-Prod.hex

    If I use Debug or TestHex, both can be seen with lsusb command.
    But it did not recognize by TI gateway server. ttyACM0 is not found. Already check in /dev/ttyACM0 is the only serial available.

    Test with ProdSBl or ProdHex, CC2531 cannot be seen with lsusb command. And cannot run woth TI gateway. ttyACM0 not found.

    Any suggestion?
  • Hi cyclonmaster geostigma,
    I have followed exact steps as you have done and it was working. So I don't know why it is showing error.
    Regards,
    Aashish Khairnar.
  • Hi Ashish,
    Do you mean it is used to work on your BBB but it doesn't work now? If so, I would suggest you to rebuild a new SD card and install Z-Stack Linux Home GW and test again.
  • Hi Everyone,
    Yesterday I was able to start my server successfully by doing this:
    1. replaced ttyACM0 by ttyO4 in line no 915,997,287 and 293.
    2. Also commented line no 989 as it was for resetting for USB so that is not a case in CC2530.
    3. in NPI_Gateway.conf :
    deviceKey = 0;
    devPath ="dev/ttyO4" ;
    Thanks for help everyone.
    Regards,
    Aashish Khairnar.
  • You are welcome and it's good to know you solve the issue.
  • Hi Aashish Khairnar26,

    May I know what version of IAR ___ and Z-Stack Home ___ do you use?
    Is it IAR 9.20.1 and Z-Stack Home 1.2.2?
    Also, do you use default ZNP source in Z-Stack Home? No changes, only add in Defined Symbols ENABLE_MT_SYS_RESET_SHUTDOWN.
    No changes also in BBB TI ZigBee Home Automation Gateway?

    I need to know what went wrong at my side. Thank you.
  • I'm using IAR 8.30.3 and and Z-Stack Home 1.2.1 .
    And also I have only added ENABLE_MT_SYS_RESET_SHUTDOWN and nothing is changed except that.
    Regards,
    Aashish
  • If you use CC2350, I think you should make sure you revise all ttyACM0 to your ttyXXX that is generated by your USB-to-Serial connection to CC2530.
  • Looks like the same setup as mention by OD here:
    e2e.ti.com/.../1450380

    He is using IAR EW8051 8.30.3 (8.30.3.41795) and Z-Stack Home 1.2.1

    Mine was IAR EW8051 8.30.2 and Z-Stack Home 1.2.1. Need to find IAR EW8051 8.30.3 installer.
    I wonder where is the old version link. I think I save it somewhere.

    Thank you for your answer.
  • I manage to use CC2530 as a coordinator and use it with TI Linux Gateway on Beaglebone instead of USB CC2531.
    I use Z-Stack 1.2.2, ZNP firmware with the compile option as follows:

    FEATURE_SYSTEM_STATS
    ASSERT_RESET
    POWER_SAVING
    FAKE_CRC_SHDW
    TC_LINKKEY_JOIN
    ENABLE_MT_SYS_RESET_SHUTDOWN

    By just adding "ENABLE_MT_SYS_RESET_SHUTDOWN" in existing compile option. I wonder, why "POWER_SAVING" is there? Is it ok and not give problem gateway? It will not sleep? i try remove it, then I get compilation error.

    How about:
    NV_INIT
    NV_RESTORE

    Will this required?

    For the optimization from TI Notes, I add this:
    INT_HEAP_LEN=3280
    CONCENTRATOR_ENABLE=1
    CONCENTRATOR_DISCOVERY_TIME=120
    SRC_RTG_EXPIRY_TIME=2
    CONCENTRATOR_ROUTE_CACHE=1
    MTO_RREQ_LIMIT_TIME=5000
    LINK_DOWN_TRIGGER=12
    NWK_ROUTE_AGE_LIMIT=30
    BCAST_DELIVERY_TIME=100
    DEF_NWK_RADIUS=15
    DEFAULT_ROUTE_REQUEST_RADIUS=8
    ROUTE_DISCOVERY_TIME=13
    ZDNWKMGR_MIN_TRANSMISSIONS=0
    NWK_LINK_STATUS_PERIOD=30

    I have some problem with CC2530 as a coordinator. Some of the devices connnected to it will disconnected by itself after a while.
    This case is not happen when use USB CC2531 with given coordinator firmware.

    Any idea?

    Thank you.
  • 1. Since application programmer would connect ZAP to ZNP and ZAP might be coordinator, router, or end device so ZNP defines "POWER_SAVING". You should keep it there and it won't cause problem.
    2. NV_INIT and NV_RESTORE are defined in znp.cfg.
    3. I suggest you to use Ubiqua Packet Analyzer to check disconnected issue.
  • Ok, I'm working on the sniffer log.

    I have another question. In TI Linux gateway, there is soft reset and hard reset.
    About hard reset, is it also factory reset the zigbee module?
  • If you do factory reset on gateway, it will also factory reset ZNP.
  • So, does it mean by using TI Linux Gateway, press 'X' button for hard reset will reset the Ti Linux gateway including factory reset the zigbee module?