Z-Stack Compile Options
Z-Stack Compile Options
Compile Options
Table of Contents
1. INTRODUCTION ...............................................................................................................................................1
1.1. SCOPE .............................................................................................................................................................1
2. REQUIREMENTS...............................................................................................................................................1
2.1. TARGET DEVELOPMENT SYSTEM REQUIREMENTS ..........................................................................................1
3. USING Z-STACK COMPILE OPTIONS .........................................................................................................1
3.1. SELECTING THE LOGICAL DEVICE TYPE..........................................................................................................1
3.2. LOCATING COMPILE OPTIONS .........................................................................................................................1
3.2.1. COMPILE OPTIONS IN LINKER CONTROL FILES ...........................................................................................2
3.2.2. COMPILE OPTIONS IN IAR PROJECT FILES ..................................................................................................5
3.3. USING COMPILE OPTIONS ...............................................................................................................................6
4. SUPPORTED COMPILE OPTIONS AND DEFINITIONS............................................................................7
4.1. GENERAL COMPILE OPTIONS ..........................................................................................................................7
4.2. NON-CHANGEABLE COMPILE OPTIONS ...........................................................................................................9
4.3. MONITOR-TEST (MT) COMPILE OPTIONS .......................................................................................................9
4.4. ZIGBEE DEVICE OBJECT (ZDO) COMPILE OPTIONS ........................................................................................9
1. Introduction
1.1. Scope
This document provides information and procedures for using compiler options with Texas Instruments Z-Stack™,
and it's recommend that you don't change compile flags that aren't listed in this document.
2. Requirements
2.1. Target Development System Requirements
Z-Stack is built on top of the IAR Embedded Workbench suite of software development tools (www.iar.com).
These tools support project management, compiling, assembling, linking, downloading, and debugging for various
development platforms. The following are required support for the Z-Stack target development system:
Open the project by double-clicking on the SampleLight.eww file, select the Coordinator configuration from the
pull-down list below Workspace, and then open the Tools folder. Several linker control files are located in the
Tools folder. This folder contains various configuration files and executable tools used in Z-Stack projects. Generic
compile options are defined in the f8wConfig.cfg file. This file, for example, specifies the channel(s) and the PAN ID
that will be used when a device starts up. This is the recommended location for a user to establish specific channel
settings for their projects. This allows developers set up “personal” channels to avoid conflict with others. Device
specific compile options are located in the f8wCoord.cfg, f8wEndev.cfg, and f8wRouter.cfg files:
The SampleLight Coordinator project uses the f8wCoord.cfg file. As shown below, compile options that are specific
to Coordinator devices and options that provide “generic” Z-Stack functions are included in this file:
The f8wCoord.cfg file is used by all projects that build Coordinator devices. Therefore, any change made to this file
will affect all Coordinators. In a similar manner, the f8wRouter.cfg and f8wEnd.cfg files affect all Router and End-
Device projects, respectively.
To add a compile option to all projects of a certain device type, simply add a new line to the appropriate linker
control file. To disable a compile option, comment that option out by placing // at the left edge of the line. You could
also delete the line but this is not recommended since the option might need to be re-enabled at a later time.
Select the C/C++ Compiler item and click on the Preprocessor tab. The compile options for this configuration are
located in the box labeled Defined symbols: (one per line):
To add a compile option to this configuration, simply add the item on a new line within this box. To disable a
compile option, place an x at the left edge of the line. Note that the ZTOOL_P1 option has been disabled in the
example shown above. This option could have been deleted but this is not recommended since it might need to be re-
enabled at a later time.
Each of the Z-Stack sample applications (ex. SampleApp) provide an IAR project file which specifies the compile
options to be used for that specific project. The programmer can add or remove options as needed to include or
exclude portions of the available software functions. Note that changing compile options may require other changes
to the project file (see 3.2). For example, adding the MT_NWK options requires MT_NWK.c to be in the list of source
files and the use of the appropriate MT-enabled network library - if you are changing the SampleLight Coordinator
project, which normally uses the Router<Platform>.lib file, the Router<Platform>MT.lib file must be used instead.
The next sections of this document provide lists of the supported compile options with a brief description of what
feature they enable or disable. Options that are listed as “do not change” are required for proper operation of the
compiled programs. Options that are listed as “do not use” are not appropriate for use with the board.
Minimum number of milliseconds to hold off the start of the device in the
NWK_START_DELAY
network and the minimum delay between joining cycles
OSAL_TOTAL_MEM Track OSAL memory heap usage (display if LCD_SUPPORTED)
For end devices only: number of milliseconds to wait between data request
POLL_RATE polls to its parent. Example POLL_RATE=1000 is a data request every
second. This is changed in f8wConfig.cfg.
POWER_SAVING Enable power saving functions for battery-powered devices
This is used after receiving a data indication to poll immediately for queued
QUEUED_POLL_RATE
messages (in milliseconds)
REFLECTOR Enable binding
This is used as an alternate response poll rate only for rejoin request. This
REJOIN_POLL_RATE rate is determined by the response time of the parent that the device is trying
to join
This is used after receiving a data confirmation to poll immediately for
RESPONSE_POLL_RATE
response messages (in milliseconds)
Number of seconds before an entry expires in the routing table; set to 0 to
ROUTE_EXPIRY_TIME
turn off route expiry
RTR_NWK Enable Router networking
SECURE Enable ZigBee security (SECURE=0 to disable, SECURE=1 to enable)
ZAPP_Px Enable ZApp messages via serial port Px where x is the port (1 or 2)
Coordinator’s PAN ID; used by Routers and End Devices to join PAN with
ZDAPP_CONFIG_PAN_ID
this ID
ZDO_COORDINATOR Enable the device as a Coordinator
ZIGBEEPRO Enable usage of ZigBee Pro features
ZTOOL_Px Enable ZTool messages via serial port Px where x is the port (1 or 2)