ZigBee/IEEE802.15.4 Evaluation and Development Kit (Introduction)
The software development kit (SDK) for ZigBee/IEEE802.15.4 module TOCOS wireless engine is available for free with no functional restriction or expiry date. No extra cost will be charged even if developers are added. This allows you to minimize the initial investment at the beginning of development.
The user application is created using API specified by C language, and built using the GCC cross compiler that operates on Windows. Then, the execution binary file of the user application built is stored in the rewritable flash ROM incorporated in the TOCOS wireless engine.
This chapter describes a series of steps for the following methods:
- How to install the development tool (SDK)
- How to compile
- How to write into flash ROM
The description assumes that you have our ZigBee/IEEE802.15.4 Evaluation and Development Kit, but you can alternatively provide equivalent software separately.
The following description assumes that you know how to install an application or driver on Windows. Compiling involves command input like Linux.
See "ZigBee/IEEE802.15.4 Evaluation and Development Kit: Details" for the hardware information including the pin arrangement of ZigBee / IEEE802.15.4 Evaluation and Development Kit.
See "Programing Information" for the programing information on the TOCOS wireless engine.
The customers who have purchased ZigBee / IEEE802.15.4 Evaluation and Development Kit are provided with technical support that last for a year subsequent to the purchase. If you have any inquiry, contact us after support registration.
Computers that operate Windows XP/Vista 32bit|
USB port (to use USB UART cable)
*CPU speed or memory capacity performance is not particularly specified could result in difficulty in operation in some cases. You might need the CPU of 1GHz and the memory of 512MB (XP) to 1GB (Vista) at a minimum.
*Windows 7 32bit, Windows Vista 64bit, and Windows 7 64bit (the latest service pack applied) are not included in the operation check list provided by the SDK manufacturer, but we have confirmed their operation. TOKYO COSMOS ELECTRIC provides supports associated with installation and usages to those customers who have purchased our Evaluation and Development Kit and whose support period is not expired.
*Executions on the virtual machine (e.g. XP mode on Windows 7) are excluded from our support.
*SDK could malfunction in some environment of your computer. The use in the clean installation environment is recommended in principle.
*In the environment with Cygwin and Eclipse installed, environment-dependent problems could result. Also, Java (JDK) is installed during the installation of Eclipse.
How to Install Development Tool (SDK)
Obtain the SDK installer from the SDK folder in the CD-ROM attached to ZigBee / IEEE802.15.4 Evaluation and Development Kit, or the link in this page.
1. Download and execute JN-SW-4041-SDK-Toolchain-v1.1.exe.
Install the SDK tool chain, which contains the GCC compiler and Eclipse.
*During installation, the runtime operating environment of Java is downloaded and installed. In the local environment, download and install Java first.
*In the following description, C:\Jennic is the destination of installation.
2. Download and execute JN-SW-4040-SDK-Libraries-v1.4.exe.
Install libraries which contain the stack libraries of JenNet and ZigBee PRO*.
*The ZigBee PRO stack is directly supported by the stack developer.
For development using the ZigBee PRO stack, see JN-UG-3048 ZigBee PRO User Guide and install the ZPS Configuration Editor and JenOS Configuration Editor tools.
*In some environment, the tools might not be called due to the PATH dependence. Rewrite C:\Jennic\cygwin\Jennic_Cygwin.bat as:
@echo off C: chdir C:\Jennic\cygwin\bin bash.exe --login -c ^ 'cd /cygdrive/C/Jennic/Application; ^ PATH=/bin:/usr/bin:$PATH ; ^ exec /bin/bash -rcfile ~/.bashrc'
3. Download and execute Flash Programmer1.7.2.
Make arrangement to rewrite Flash Programmer1.6.6 to the latest Flash Programmer1.7.2.
4. Replace the "flashprogrammer" folder in "C:\Jennic\Tools\" and "Drivers" file.
In case the Evaluation and Development Kit (TWE-EK-002) is used, the LED, temperature and humidity sensor, and illuminance sensor are different from those of the Evaluation and Development Kit (TWE-EK-001). Therefore, apply the following patches to additionally install each device driver:
1. Download TOCOS-SDK-Patch.zip.
2. Install it according to the manual.
Connect UART-USB Cable
Set up your computer such that the UART-USB cable supplied with ZigBee / IEEE802.15.4 Evaluation and Development Kit can be used with your computer. This cable is used for writing firmware and debugging UART.
- 1. Insert the cable to a USB port of your computer.
- 2. Windows requires you to install the driver.
The driver is stored in C:\Jennic\Tools\Drivers\FTDI_drivers\CDM 2.04.06 WHQL Certified (the tool chain version of 1.1). Specify this folder to install the driver.
- 3. You are required to install the driver again since the driver is the 2-layer hierarchical structure. Specify the folder you specified in Step 2.
- 4. When the driver configuration is completed, the COM port will become available. Check the port on the Device Manager.
How to Compile Sample Application
This section describes how to compile a sample application.
*It might be equipped with a complied binary. While this section covers the directory structure including the location to store the binary, you are required to see the next section if you wish only to write the binary.
The procedure described in this section employs a method using "makefile" supplied with the sample. You must understand this method since you need to refer to this "makefile" even when the integrated development environment (Eclipse) is employed.
The explanation in this section takes as a sample the wireless sensor network that uses the JenNet stack. Download the sample application from here.
- 1. Decompress the downloaded file and store it in C:\Jennic\Application\JN-AN-1067-JenNet-Wireless-Sensor-Network. The directory is structured as shown below. The application will not be compiled if the file is saved in any different layer (*because the sample "makefile" contains the description assuming this directory structure).
C: \ Jennic \ Application \ JN-AN-1067-JenNet-Wireless-Sensor-Network \ CodeBlocksProjects \ Common \ Coordinator \ Doc \ EndDevice \ Router
- 2. Edit the description in Build/Makefile to "JENNIC_PCB ?= DEVKIT" and "JENNIC_PCB ?= TCSEK002" if you use the Evaluation and Development Kit (TWE-EK-001) and Evaluation and Development Kit (TWE-EK-002), respectively (to select the LCD, temperature and humidity sensor, and illuminance sensor).
- 3. Activate Jennic Bash Shell from the Windows application menu.
- 4. The command screen appears.
- 5. Execute "make" as follows:
bash-3.2$ cd JN-AN-1067-JenNet-Wireless-Sensor-Network/ bash-3.2$ ls CodeBlocksProjects Common Coordinator Doc EndDevice Makefile Router bash-3.2$ make for d in Coordinator Router EndDevice; do (cd $d; make clean ); done make: Entering directory `/cygdrive/C/Jennic/Application/JN-AN-1067-JenNet-Wireless-Sensor-Networ k/Coordinator' ...Skip... Linking EndDevice_JN5148.elf ... /cygdrive/C/Jennic/Tools/ba-elf-ba2/bin/ba-elf-gcc -Wl,--gc-sections -Wl,-u_AppColdStart -Wl,-u_AppW ...Skip... 5148 -lHWPatch_JN5148 -lBoardLib_JN514x -Wl,--end-group -Wl,-Map,EndDevice_JN5148.map Generating binary ... /cygdrive/C/Jennic/Tools/ba-elf-ba2/bin/ba-elf-size EndDevice_JN5148.elf text data bss dec hex filename 21218 1360 10736 33314 8222 EndDevice_JN5148.elf ...Skip... make: Leaving directory `/cygdrive/C/Jennic/Application/JN-AN-1067-JenNet-Wireless-Sensor-Network /EndDevice' bash-3.2＄
- 6. If "make" is successful, the .bin files have been made in Coordinator\Build, Router\Build, and ENdDevice\Build. This is the end of the compiling process.
bash-3.2$ ls Coordinator/Build/ Coordinator.d Coordinator_JN5148.bin Makefile Network.o Sensor.d Coordinator.o Coordinator_JN5148.elf Makefile_JN5139.mk Printf.d Sensor.o Coordinator_JN5139.bin Coordinator_JN5148.map Network.d Printf.o bash-3.2$ ls Router/Build/ Makefile Network.d Printf.d Router.d Router_JN5139.bin Router_JN5148.elf Sensor.d Makefile_JN5139.mk Network.o Printf.o Router.o Router_JN5148.bin Router_JN5148.map Sensor.o bash-3.2$ ls EndDevice/Build/ EndDevice.d EndDevice_JN5148.bin Makefile Network.o Sensor.d EndDevice.o EndDevice_JN5148.elf Makefile_JN5139.mk Printf.d Sensor.o EndDevice_JN5139.bin EndDevice_JN5148.map Network.d Printf.o
How to Download to Flash ROM (Write Program)
Write the compiled and built execution binary file (.bin) into the flash ROM of the wireless engine.
The writing methods include the one using GUI and the other using FlashCli.exe with the use of Jennic Bash Shell, the former of which will be explained in this section. The Tool is stored in C:\Jennic\Tools\flashprogrammer.
- 1. Insert the UART-USB cable supplied with ZigBee / IEEE802.15.4 Evaluation and Development Kit to your computer, and check the COM port (see above).
- 2. Check that the wireless sensor node supplied with ZigBee / IEEE802.15.4 Evaluation and Development Kit is powered OFF, and connect the six-pin socket at the UART to UART0 of a wireless sensor node (large or small). Insert the socket such that Pin 1 of UART0 is the black cable line.
- 3. Activate the power while pressing the PROGRAM button on the wireless sensor node, and then release the PROGRAM button. This operation switches the wireless module to the program mode.
*Alternatively, press the RESET button while pressing the PROGRAM button when the power is activated, and then release the PROGRAM button.
- 4. Activate Jennic Flash Programmer from the Windows application menu.
- 5. While the wireless module is in the program mode, select a COM port (which can be automatically selected). Values appear in the Device, Flash and AMC Address columns to check the connection between the write tool and wireless module.
*Press the Refresh button if the display has not been updated so the wireless module information will be acquired again.
*If the wireless module is not in the program mode, an error message appears in a few seconds. Then, configure the mode again and press the Refresh button.
- 6. Write the .bin files above in the Program File. In the example of the wireless sensor network compiled above, specify:
Coordinator_JN5148.bin: Coordinator side (large sensor node)
EndDevice_JN5148.bin: End Device side (1 to 3 small sensor nodes)
- 7. Press the Program button.
*The program can be written at high speed by setting the baud rate at 115200.
*Verification for writing can be skipped by ticking Skip Verification.
- 8. When writing is successfully completed, the following dialog appears. This is the end of the writing process. Power off the sensor node once. Subsequently, writing of other wireless modules is ready to be executed.
*The program could be destroyed if you remove the module or cable or power off the unit. Therefore, make sure writing is completed.
Try operating the sample application above of the wireless sensor network.
- Connect the UART-USB cable to the sensor node (large)--Coordinator_JN5148.bin.
- Activate terminal software (e.g. HyperTerminal and TeraTerm) on your computer. Specify the COM port of the cable. The condition for communication for this particular application is 19200 8N1 (19200bps 8bit with no parity, stop bit 1).
- Power on the sensor node (large). Check message.
- Power on the sensor node (small)—EndDevice_JN5148.bin. Check message.
The information on each sensor including the sensor node (large) is displayed at regular time intervals.
- An error occurs on the command line.
- Contradiction created in PATH settings could cause a different command with the same name to be executed.
In this case, rewrite C\Jennic\cygwin\Gennic_Cygwin.bat as shown below, and refer to /bin:/usr/bin preferentially at the time of activation.
@echo off C: chdir C:\Jennic\cygwin\bin bash.exe --login -c ^ 'cd /cygdrive/C/Jennic/Application; ^ PATH=/bin:/usr/bin:$PATH ; ^ exec /bin/bash -rcfile ~/.bashrc'- E.g. the file or directory name has been changed for some reason.
=> Reinstall SDK since it seems hardly possible to undo.
- cygwin or eclipse has been preinstalled.
=> These could mutually cause problems. Please create a new environment.
- gcc, etc. does not operate properly.
=> Contradiction might be created in dynamic libraries, etc. please create a new environment since it is hard to analyze the cause of this problem.
- How to use Eclipse
- Programing information
- About sample applications
- How to use packet sniffer (packet analyzer)
- JTAG debugger (JTAG ICE): Efficient tool for debugging and testing
- Wireless Products Overview
- Wireless Engine
- TWE Lite DIP
- Evaluation, Development
- Evaluation & Development Kit
- Sensor Network Evaluation Kit
- Avaliable Antennae
- Protocol Stack
- Wireless Sensor Networks
- Energy Harvesting Technology
- M2M Wireless Communications
- HEMS / BEMS / FEMS / CEMS
- Internet of Things