IDT ZWIR4512 User manual

ZWIR4512 Application Note -
Development Kit Getting Started Guide
© 2016 Integrated Device Technology, Inc.
1
April 15, 2016
Contents
1Introduction.......................................................................................................................................................2
2Initial Preparation .............................................................................................................................................3
3Creating a New Project ....................................................................................................................................5
4The “Getting Started” Example.......................................................................................................................10
5Related Documents........................................................................................................................................11
6Glossary.........................................................................................................................................................11
7Document Revision History............................................................................................................................12
List of Figures
Figure 1.1 ZWIR4512 Development Kit...............................................................................................................2
Figure 2.1 License Manager ................................................................................................................................3
Figure 3.1 New Project Window—Select a New Project Template .....................................................................5
Figure 3.2 New Project Window - Select Files to Add to the Project...................................................................6
Figure 3.3 Project Explorer ..................................................................................................................................7
Figure 3.4 Project Explorer after Compiling.........................................................................................................8
Figure 3.5 CrossStudio™ in Debugging Mode ....................................................................................................9
Figure 4.1 COM Port Settings............................................................................................................................10

ZWIR4512 Application Note -
Development Kit Getting Started Guide
© 2016 Integrated Device Technology, Inc.
2
April 15, 2016
1 Introduction
This document is a step-by-step manual that describes how to install all required software and demonstrates
creating a simple first project with the ZWIR4512 Development Kit (see Figure 1.1). The integrated development
environment (IDE) CrossStudio™* for ARM®* from Rowley Associates is used. CrossStudio™ is available for
Microsoft® Windows, Linux, MAC OS, and Solaris computers. This document describes the installation of the
Microsoft® Windows version of CrossStudio™ that is included on the ZWIR4512 Development Kit DVD. If the
DVD is unavailable or a different operating system is used, Rowley CrossStudio™ can be downloaded from the
Rowley Associates web page: http://www.rowley.co.uk/arm/index.htm.
Figure 1.1 ZWIR4512 Development Kit
* CrossStudio™ is a trademark of Rowley Associates. ARM® is a trademark of ARM, Ltd.

ZWIR4512 Application Note -
Development Kit Getting Started Guide
© 2016 Integrated Device Technology, Inc.
3
April 15, 2016
2 Initial Preparation
During the following steps, the development environment will be installed with all packages. These steps are only
done once to set up CrossStudio™.
1. Install CrossStudio™ for ARM from the DVD by activating the following executable:
install\CrossStudio\arm_crossworks_2_3_5_win_x86_setup.exe
Alternately, download and install CrossStudio™ for ARM from Rowley’s website:
http://www.rowley.co.uk/arm/releases.htm
2. A valid license is required before CrossStudio™ can be used. For initial testing, it is possible to get a 30-
day evaluation license. Get the license by following these steps after installing CrossStudio™ and starting
the application:
a. Open the license manager by clicking on the menu bar Tools
License Manager.
See Figure 2.1 for the resulting dialog box.
Figure 2.1 License Manager

ZWIR4512 Application Note -
Development Kit Getting Started Guide
© 2016 Integrated Device Technology, Inc.
4
April 15, 2016
b. Click on the Evaluate CrossWorks button, and follow the steps.
c. After receiving the activation key, click on the Activate CrossWorks button in the “License
Manager” dialog box and enter the key.
3. To support the STM32 microcontroller and the ZWIR4512 modules, the corresponding support package
must be installed from the DVD or downloaded from the web.
The ZWIR4512 Board Support Package can be downloaded* from the ZWIR4512 product page on IDT’s
website: http://www.IDT.com/ZWIR4512.
The STM32 CPU Support Package can be downloaded from Rowley’s website:
http://www.rowleydownload.co.uk/arm/packages/STM32.htm.
Install the SMT32 CPU and ZWIR4512 Board Support Packages by double-clicking each of the following
files in the package:
install\CrossStudio\CMSIS_3.hzq
install\CrossStudio\STM32.hzq
install\CrossStudio\ZWIR4512.hzq
4. The connection between the microcontroller JTAG and UART interface and the development PC is via a
USB virtual COM port interface, provided by a FTDI chip. This chip requires installation of a special VCP
driver from the DVD or downloaded from the FTDI website: http://www.ftdichip.com/Drivers/VCP.htm
Install the VCP driver by clicking on the following file:
install\FTDI\CDM20830_Setup.exe
5. Connect the ZWIR4512 test board to the user’s PC via the USB cable included in the kit. The PC
operating system will automatically install the newly found USB device. An appropriate installation guide
can be found under http://www.ftdichip.com/Support/Documents/InstallGuides.htm
During the installation, two new COM ports are created. The first one performs the communication
between CrossStudio™ and the microcontroller JTAG interface. The second one is connected to the
microcontroller UART interface.
* Access to on-line ZWIR45xx software downloads requires a free customer login account. See section 7. After login, click on “ZWIR4512
API RCS” under the “Software” heading.

ZWIR4512 Application Note -
Development Kit Getting Started Guide
© 2016 Integrated Device Technology, Inc.
5
April 15, 2016
3 Creating a New Project
After the successful initial preparation, a first simple application can demonstrate the development process with
CrossStudio™.
1. Start CrossStudio™.
2. In the menu bar, select File
New Project.
3. In the New Project window, complete the following steps:
a. Scroll to the ZMDI section as shown in Figure 3.1.
b. In the project template window, click on 6LoWPAN project template targeted at
ZWIR4512AC1xx modules or 6LoWPAN project template targeted at ZWIR4512AC2xx
modules depending on which module is used.
c. Enter a project name, and select a project path.
Note: creating a separate folder for each project is recommended.
d. Click Next.
Figure 3.1 New Project Window—Select a New Project Template

ZWIR4512 Application Note -
Development Kit Getting Started Guide
© 2016 Integrated Device Technology, Inc.
6
April 15, 2016
4. Select files to add to the project.
a. Select all files as shown in Figure 3.2.
b. Ensure that the libraries libZWIR45xx-IKEv2.a and libZWIR45xx-IPSec.a are NOT selected.
Note: If the libraries libZWIR45xx-IKEv2.a and/or libZWIR45xx-IPSec.a are selected,
communication over IPv6 is not possible without configuring the security module.
c. Click Finish.
Figure 3.2 New Project Window - Select Files to Add to the Project

ZWIR4512 Application Note -
Development Kit Getting Started Guide
© 2016 Integrated Device Technology, Inc.
7
April 15, 2016
5. At this point, the project has been created and all required files have been added to the project.
The Project Explorer on the right side shows all project files. All libraries, the startup code, the linker
script, and the reset script can be found in the System Files folder as shown in Figure 3.3.
The application-specific code is in the Source Files folder. For this example, open the automatically
created main.c file by double clicking it.
Figure 3.3 Project Explorer
6. Write the program.
A first example is the “getting started”. The code can be found on the DVD under
src/Examples/GettingStarted/src/gettingStarted.c.
It is also included in the IDT software zip file available for download* on the ZWIR4512 product web page:
www.IDT.com/ZWIR4512.
To use this example, the “getting started” c-code (from the gettingStarted.c) must be copied into the
current project main.c (Figure 3.3)
For more details about the “getting started” program, see section 4.
* Access to on-line ZWIR45xx software downloads requires a free customer login account. See section 7. After login, the
gettingStarted.c example code is available under the “Software” heading.

ZWIR4512 Application Note -
Development Kit Getting Started Guide
© 2016 Integrated Device Technology, Inc.
8
April 15, 2016
7. Compile the program:
Right click on the project in the Project Explorer and then click on Build on the resulting drop-down
menu. Figure 3.4 shows the “Project Explorer” after the program has been compiled for this example.
Figure 3.4 Project Explorer after Compiling
Note: The following steps must be done only at the project initialization.
8. Connect to the device:
a. On the main menu bar, click Target
Targets.
b. Right click in the opened Target window.
c. Select New Target Interface
Generic FT2232 Device.
d. On the main menu bar, click Target
Connect
Generic FT2232 Device.

ZWIR4512 Application Note -
Development Kit Getting Started Guide
© 2016 Integrated Device Technology, Inc.
9
April 15, 2016
9. Start debugging:
a. On the main menu bar, click Debug
Go (or press F5).
b. Wait until the application was loaded successfully at the microcontroller.
Note: if uploading errors occur, try the uploading again.
10. Start the program by pressing the Continue Execution button on the main menu or press F5.
Figure 3.5 CrossStudio™ in Debugging Mode
It is possible to debug the uploaded program in CrossStudio™. All debug features are explained in CrossStudio’s
Help function accessible via the main menu.

ZWIR4512 Application Note -
Development Kit Getting Started Guide
© 2016 Integrated Device Technology, Inc.
10
April 15, 2016
4 The “Getting Started” Example
The “getting started” example provides a basic introduction to the ZWIR4512-I-Development Kit. This program
can be found on the DVD under src\examples\gettingstarted. For this example, at least two devices must
be pre-programmed with the “getting started” code.
This example shows how to receive and send UDP packets. It also shows how data can be transmitted over the
UART Interface.
During module initialization, two UDP sockets (port 1000 to receive data and port 1001 to receive blink packets)
are opened and the UART receiver is enabled to receive user input.
Every 5 seconds, the program sends one blink packet to all nodes. The sending device indicates packet
transmission with LED 2 while the receiving device indicates packet reception with LED 4. The receiver writes a
message containing the sender’s address to the serial interface.
All characters received by the UART interface are saved in a buffer until a return character is received or the
buffer runs out of free space. In this case, the device broadcasts the buffer contents to all other nodes and
indicates transmission with LED 1. Receiving devices will write the transmitted buffer contents to their serial
interface and indicate packet reception with LED 3.
To use this example, connect at least one device with a PC and power the other devices either with an external
power supply or also via the PC.
Open a UART terminal (e.g., Microsoft® HyperTerminal) on the PC and establish a connection to the second
virtual COM port with the parameters set as in Figure 4.1.
Figure 4.1 COM Port Settings

ZWIR4512 Application Note -
Development Kit Getting Started Guide
© 2016 Integrated Device Technology, Inc.
11
April 15, 2016
If any other “getting started” device is powered, the terminal should print out the received blink packets as
Received blink from fe80:0000:0000:0000:0211:7d00:002f:0003: 5232
To test the data transfer function, connect a second device and open a second terminal. Now it is possible to
enter a message (e.g., “hello world” in the example below) in one of the terminals and transmit it to the other one
by pressing “return.” The second terminal should display the received message as follows (note that the sender
address will differ from this example):
Received data from fe80:0000:0000:0000:0211:7d00:002f:0003:
hello world
5 Related Documents
Document
ZWIR4512 Data Sheet
ZWIR451x Programming Guide*
Visit the ZWIR4512 product page www.IDT.com/ZWIR4512 or contact your nearest sales office for the latest
version of these documents.
*Note: Documents marked with an asterisk (*) require a free customer login account for access.
6 Glossary
Term Description
COM Name of the serial port interface
JTAG Joint Test Action Group
UART Universal Asynchronous Receiver/Transmitter
UDP User Datagram Protocol
VCP Virtual COM Port

ZWIR4512 Application Note -
Development Kit Getting Started Guide
© 2016 Integrated Device Technology, Inc.
12
April 15, 2016
7 Document Revision History
Revision Date Description
1.00 October 25, 2010 First release.
1.10 March 25, 2011 Improved “getting started” example.
1.20 May 21, 2011 Improved specification of library setup.
Added figure explaining COM port settings.
1.30 June 18, 2012 Updated installation instructions.
1.31 July 23, 2012 Minor edits for clarity.
Minor corrections.
1.32 August 26, 2013 Changed example images to match new CrossWorks™ version.
1.40 October 2, 2014 Changed example images to match new libraries.
April 15, 2016 Changed to IDT branding.
Corporate Headquarters
6024 Silver Creek Valley Road
San Jose, CA 95138
www.IDT.com
Sales
1-800-345-7015 or 408-284-8200
Fax: 408-284-2775
www.IDT.com/go/sales
Tech Support
www.IDT.com/go/support
DISCLAIMER Integrated Device Technology, Inc. (IDT) reserves the right to modify the products and/or specifications described herein at any time, without notice, at IDT's sole discretion. Performance
specifications and operating parameters of the described products are determined in an independent state and are not guaranteed to perform the same way when installed in customer products. The
information contained herein is provided without representation or warranty of any kind, whether express or implied, including, but not limited to, the suitability ofIDT's products for any particular purpose, an
implied warranty of merchantability, or non-infringement of the intellectual property rights of others.This document is presented only as a guide and does not convey any license under intellectual property
rights of IDT or any third parties.
IDT's products are not intended for use in applications involving extreme environmental conditions or in life support systems or similar devices where the failure or malfunction of an IDT product can be
reasonably expected to significantly affect the health or safety of users. Anyone using an IDT product in such a manner does so at their own risk, absent an express, written agreement by IDT.
Integrated Device Technology, IDT and the IDT logo are trademarks or registered trademarks of IDT and its subsidiaries in the United States and other countries. Other trademarks used herein are the
property of IDT or their respective third party owners. For datasheet type definitions and a glossary of common terms, visit www.idt.com/go/glossary. All contents of this document are copyright of Integrated
Device Technology, Inc. All rights reserved.
Table of contents
Other IDT Microcontroller manuals