FreeStar Pro BeeKit Porting Guide

Free Star Pro Series
ZFSM-201-EVB-1
Evaluation Board
BeeKit™ Porting Guide
ZFSM-201-1 FreeStar Pro Module
Document # 0006-00-08-03-000
(Rev B)
FreeStar Pro BeeKit Porting Guide
Table of Contents 1 OVERVIEW ....................................................................................... 3 1.1 1.2 DESCRIPTION ............................................................................................ 3 REFERENCED DOCUMENTS .................................................................... 3 2 USING FREESCALE SEMICONDUCTOR’S BEEKIT™ .................. 4 2.1 BEEKIT™ .................................................................................................... 4 2.1.1 More Information ............................................................................................... 4 CODEBASES .............................................................................................. 4 2.2.1 Codebases For The MC1322x. ......................................................................... 4 2.3 INSTALLING BEEKIT™ .............................................................................. 4 2.3.1 Prerequisites...................................................................................................... 4 2.3.2 The Latest Version ............................................................................................ 4 2.3.3 From the CEL CD ............................................................................................... 4 2.2 3 USING BEEKIT™ WITH THE ZFSM-201-1 MODULE ..................... 5 3.1 3.2 3.3 3.4 ABOUT THE PLATFORM EDITOR.............................................................. 5 SELECTING THE CODEBASE ................................................................... 5 CREATING A NEW PROJECT USING PLATFORM EDITOR ...................... 6 CREATING A NEW PROJECT USING FREESCALE H/W TARGET ......... 12 4 REVISION HISTORY ...................................................................... 15 Rev B
Document No. 0006-00-08-03-000
Page 2 of 15
FreeStar Pro BeeKit Porting Guide
1
OVERVIEW
1.1
DESCRIPTION
One method to begin code development is to use the project supplied on the CD included in the
ZFSM-201-KIT-1 FreeStar Pro Evaluation Kit. Other users of the ZFSM-201-1 FreeStar Pro
Module may wish to start their code development with a fresh project generated by the
Freescale BeeKit™. This document will guide users through creating a project in BeeKit™ that
will be compatible with the ZFSM201-EVB-1 FreeStar Pro Evaluation Board.
This document should not be considered a substitute to documentation on BeeKit™ provided
by Freescale. Users are encouraged to consider the Freescale documentation on BeeKit™
and to become thoroughly familiar with it.
1.2
REFERENCED DOCUMENTS
Table 1 contains the documents that have been referenced by this document (or recommended
as additional information). Please consult the appropriate website to check for the latest
revisions and editions.
Table 1 – Related and Referenced Documents
Document Title
Document Name / Number
Freescale Semiconductor Documents (www.freescale.com)
BeeKit™ Wireless Connectivity Toolkit Quick Start Guide
BKWCTKQSG
BeeKit™ Wireless Connectivity Toolkit User’s Guide
BKWCTKUG
BeeKit™ Wireless Connectivity Toolkit Software Release Notes
BKWCTKRN
MC13224V Datasheet
MC1322x
MC1322x Reference Manual
MC1322xRM
MC1322x Software Driver Reference Manual
22XDRVRRM
MC1322x Simple Media Access Controller (SMAC) Reference Manual
22xSMACRM
802.15.4 Media Access Controller (MAC) MyWirelessApp
802154MWAUG
802.15.4 Media Access Controller (MAC MyStarNetworkApp
802154MSNAUG
802.15.4 MAC PHY Software Reference Manual
802154MPSRM
Simple Media Access Controller (SMAC) User’s Guide
SMACRM
Freescale Test Tool User’s Guide
TTUG
Note: The Freescale documents listed above will be loaded to the user’s PC when installing the BeeKit™ Toolkit
found on the CEL Freestar Pro CD (see Section 2.3.3)
CEL Documents (www.cel.com)
ZFSM-201-1 Datasheet
0006-00-07-00-000
ZFSM-201-KIT-1 Development Kit User Guide
0006-00-08-00-000
ZFSM-201-EVB-1 Evaluation Board Host Serial & RF Protocol Guide
0006-00-08-01-000
ZFSM-201-EVB-1 Evaluation Board SMAC Programmers Guide
0006-00-08-02-000
ZFSM-201-EVB-1 Evaluation Board BeeKit™ Porting Guide
0006-00-08-03-000
ZFSM-201-EVB-1 Evaluation Board MAC Programmers Guide
0006-00-08-05-000
ZFSM-201-KIT-1 Wireless UART Application User Guide
0006-00-08-06-000
ZFSM-201-KIT-1, ZFSM-201-EVB-1 Erratum
0006-00-08-04-000
Note: The CEL documents listed above are included on the CEL CD.
Rev B
Document No. 0006-00-08-03-000
Page 3 of 15
FreeStar Pro BeeKit Porting Guide
2
USING FREESCALE SEMICONDUCTOR’S BEEKIT™
2.1
BEEKIT™
BeeKit™ is a software utility from Freescale used to select Codebases, configure settings
regarding a wireless network, select software libraries, and select application templates.
Version 1.9.5 dated 03/2009 was used to create the accompanying firmware for the evaluation
boards.
2.1.1 More Information
See Freescale documents Freescale Semiconductors’ “BeeKit™ Wireless Connectivity Toolkit Quick
Start Guide” (Freescale Doc # BKWCTKQSG) and “BeeKit™ Wireless Connectivity Toolkit User’s
Guide” (Freescale Doc # BKWCTKUG) for more information about BeeKit™.
Note: If the Utility described in Section 2.3.3 is used to download BeeKit™, then these files can be found on the user’s
PC in the directory C:\Program Files\Freescale\Documentation\BeeKit Documentation\
2.2
CODEBASES
2.2.1
Codebases For The MC1322x.
 SMAC – Simple MAC
 MAC – IEEE 802.15.4 compliant MAC
 BeeStack – ZigBee Layer added to IEEE 802.15.4 MAC
This document and release of software specifically pertain to the SMAC and MAC for ARM7.
With the exception of the selecting the target codebase the steps outlined here pertain to all
codebases.
When building a new project using the BeeKit™ it is recommended to use the latest codebase.
See www.freescale.com/zigbee for the latest codebases and documentation.
2.3
INSTALLING BEEKIT™
2.3.1 Prerequisites
The system requirements, disc space requirements, and configuration recommendations for
BeeKit™ are contained in the Release Notes document “Freescale BeeKit™ Wireless
Connectivity Toolkit Software Version Release Notes” (Freescale Doc # BKWCTKRN) which is
contained on the CEL CD in the directory \ZFSM-201\Tools\Others\Freescale BeeKit\ in an Adobe PDF
file named ‘BeeKit Release Notes’.
2.3.2 The Latest Version
See www.freescale.com/zigbee to download the latest version of BeeKit™.
(Hint: under ‘Software and Tools’ search for “BeeKit”)
2.3.3 From the CEL CD
For simplicity, CEL has included the BeeKit™ installation utility on our CD. It will load Freescale
BeeKit™, Freescale Test Tool and documentation; codebase files, example source and project
files, and miscellaneous utilities.
The set-up file is named “BeeKitSetup” and can be found on the CEL CD in the directory:
Rev B
Document No. 0006-00-08-03-000
Page 4 of 15
FreeStar Pro BeeKit Porting Guide
\ZFSM-201\Tools\Others\Freescale BeeKit\
Open this file and follow the instructions given.
3
USING BEEKIT™ WITH THE ZFSM-201-1 MODULE
3.1
ABOUT THE PLATFORM EDITOR
Platform Editor is a software utility included in BeeKit™ that allows users to configure GPIO for
their target application at a high level. Some users may choose to use it; others may wish to
configure GPIO in their application software.
This document describes how to port a BeeKit™ project to the ZFSM-201-EVB-1 FreeStar Pro
Evaluation Board with and without Platform Editor.
3.2
SELECTING THE CODEBASE
Steps 1) through 6) are the same whether using Platform Editor or not:
1) Open BeeKit™ by clicking on the icon [
] on the user’s desktop.
2) Select the targeted codebase – SMAC, MAC or BeeStack. To select the most current Codebase click
on ‘File’ → ‘Select Codebase’ and select the desired codebase.
3) See Figure 1 to determine the Codebase being used in BeeKit™. For this demonstration, the
selected codebase is ‘ARM7 SMAC Codebase 1.0.4’.
Figure 1 – Screen BeeKit™ Codebase in Use
Figure 2 – Screen, BeeKit™ Opening a New Project
Rev B
Document No. 0006-00-08-03-000
Page 5 of 15
FreeStar Pro BeeKit Porting Guide
3.3
CREATING A NEW PROJECT USING PLATFORM EDITOR
4) To start a new Project: Click on ‘File’ → ‘New Project’ as shown in Figure 2.
5) Select the appropriate template to get your application started. In Figure 3 / Figure 4 ‘Generic
Application’ / ‘MyWirelessApp Demo Framework’ is selected.
6) On the bottom of the screen, change the ‘Project Name’, ‘Solution Name’, and ‘Location’ as
appropriate, and click ‘OK’.
Figure 3 – Screen, BeeKit™ Naming and Saving a New SMAC Project
Figure 4 – Screen, BeeKit™ Naming and Saving a New MAC Project
Rev B
Document No. 0006-00-08-03-000
Page 6 of 15
FreeStar Pro BeeKit Porting Guide
The Window in Figure 5 will appear.
7) Click the ‘Next’ button.
Figure 5 – Screen, BeeKit™ Welcome
Figure 6 – Screen, BeeKit™ Selecting the Hardware
The Window in Figure 6 will appear. BeeKit™ allows the user to select a Freescale
development board or custom hardware.
8) For the FreeStar Pro Module select ‘User Defined Target’ and click ‘Next’.
The Window in Figure 7 will appear.
9) Click the ‘Launch Platform Editor’ button.
Rev B
Document No. 0006-00-08-03-000
Page 7 of 15
FreeStar Pro BeeKit Porting Guide
Figure 7 – Screen, BeeKit™ Launching Platform Editor
Figure 8 – Screen, BeeKit™ Loading Configuration
The screen in Figure 9 will appear.
10) If the target hardware is the ZFSM-201-EVB-1 eval board, click the ‘Load Configuration From’
Button in the lower left hand corner of the window as shown in Figure 8.
11) Select the FreeStarPro.bkudp32 file in the directory \ZFSM-201\Application Source Files\CEL Beekit
Plugin v1.1\ on the CEL CD.
This file contains the hardware configuration for the ZFSM-201-EVB-1 FreeStar Pro Evaluation
Board.
If the hardware attached to the FreeStar Pro is different (or the user wants to understand the
Freescale Platform Editor) continue with the following steps.
12) In the LEDs and Switches tab shown in Figure 9 the only change made from the default by the
Configuration Load was to set the LED 4 GPIO Pin to 01. If not using the CEL FreeStar Pro Interface
Board, select these settings according to the hardware on which the module is being used.
Rev B
Document No. 0006-00-08-03-000
Page 8 of 15
FreeStar Pro BeeKit Porting Guide
Figure 9 – Screen, BeeKit™ LED and Switch Settings
Under the ‘MC1322x Control’ Tab shown in Figure 10, confirm the following settings and make
changes if necessary.
13) In the ‘Custom Crystal Settings’ area:
a. Set the ‘Crystal Frequency (Hz)’ to ‘24,000,000’.
b. Set the ‘Crystal Trim Course Tune’ to ‘4’.
c. Set the ‘Crystal Trim Fine Tune’ to ‘14’.
14) In the ‘Custom RF Settings’ area:
a. Set the ‘CCA Threshold’ box to ‘57’.
b. Set the ‘Default Power Level’ to ‘-30 dBm’.
15) In the ‘RF I/O Control’ area:
a. Check the ‘Enable Dual RF Port’ box.
b. Check the boxes ‘TX_GPO1 (Function 1)’ for ‘GPIO Pin 44 (TX_ON) Function’ and ‘TX_GPO2
(Function 1)’ for ‘GPIO Pin 45 (RX_ON) Function’ as shown in Figure 10.
c. Check the ‘Enable Power Level Lock for External PA’ box.
Rev B
Document No. 0006-00-08-03-000
Page 9 of 15
FreeStar Pro BeeKit Porting Guide
Figure 10 – Screen, BeeKit™ Custom Crystal and RF Settings
16) In the ‘GPIO Port Register’ Tab shown in Figure 11 make changes to the GPIO as necessary for
custom hardware.
a. Confirm (and configure if necessary) ‘GPIO_42’ as an ‘Output’ with a Data value of ‘1’ as shown
in Figure 11.
17) Click ‘OK’ when finished.
Figure 11 – Screen, BeeKit™ Changes to the GPIO Port Register
Rev B
Document No. 0006-00-08-03-000
Page 10 of 15
FreeStar Pro BeeKit Porting Guide
Note: Please check the cautions regarding BeeKit Platform Editor in “ZFSM-201-KIT-1, ZFSM-201-EVB-1 Errata”
(CEL Doc #0006-00-08-04-000) if making changes to the GPIOs, RF ports, etc.
18) Select use of the platform modules as indicated in Figure 12. All should be selected for the FreeStar
Pro Evaluation Board; otherwise select what is appropriate for custom hardware.
Figure 12 – Screen, BeeKit™ Selecting Platform Modules
Figure 13 – Screen, BeeKit™ Setting UART Parameters
19) Enable the UART on port1 and set the baud rate to ‘19200’ as indicated in Figure 13 for the FreeStar
Pro Evaluation board, otherwise select what is appropriate for custom hardware.
20) Click the ‘Finish’ button.
Rev B
Document No. 0006-00-08-03-000
Page 11 of 15
FreeStar Pro BeeKit Porting Guide
In the upper right hand corner of the BeeKit™ GUI notice the ‘Solutions Explorer’ toolbar.
21) Right click on the solution and select the ‘Export Solution’ or ‘Export and Open Solution in IAR
EWB…’ option. See Figure 14.
Figure 14 – Screen, BeeKit™ Exporting the Solution
Note: Please check the cautions regarding BeeKit Platform Editor in “ZFSM-201-KIT-1, ZFSM-201-EVB-1 Errata”
(CEL Doc #0006-00-08-04-000) if making changes to the GPIOs, RF ports, etc.
3.4
CREATING A NEW PROJECT USING FREESCALE H/W TARGET
(AND NOT PLATFORM EDITOR)
1) To start a new Project: Click on ‘File’ → ‘New Project’ as shown in Figure 15.
Figure 15 – Screen, BeeKit™ New Project
Rev B
Document No. 0006-00-08-03-000
Page 12 of 15
FreeStar Pro BeeKit Porting Guide
The Window in Figure 16 will appear.
2) Click the ‘Next’ button.
Figure 16 – Screen, BeeKit™ Welcome
Figure 17 – Screen, BeeKit™ Selecting Hardware
The Window in Figure 17 will appear.
3) Ensure the ‘MC1322x Sensor Node’ checkbox is selected. Click the ‘Next’ button.
Rev B
Document No. 0006-00-08-03-000
Page 13 of 15
FreeStar Pro BeeKit Porting Guide
The Window in Figure 18 will appear.
4) Ensure the ‘LEDs’, ‘Keyboard’, and ‘Low Power Module’ checkboxes are selected and click the
‘Next’ button.
Figure 18 – Screen, BeeKit™ Selecting Platform Modules
Figure 19 – Screen, BeeKit™ Setting UART Parameters
The Window in Figure 19 will appear.
5) Ensure the ‘Enable UART on USB’ checkbox is selected and the baud rate is ‘19200 bps’. Click the
‘Finish’ button.
In the upper right hand corner of the BeeKit™ GUI notice the ‘Solutions Explorer’ toolbar.
6) Right click on the solution and select the ‘Export Solution’ or ‘Export and Open Solution in IAR
EWB…’ option. See Figure 20.
Rev B
Document No. 0006-00-08-03-000
Page 14 of 15
FreeStar Pro BeeKit Porting Guide
Figure 20 – Screen, BeeKit™ Exporting the Solution
4 REVISION HISTORY
Revision
PRELIMINARY
A
B
Rev B
Date
29Oct08
04Feb09
22May09
Description
Released
Added MAC Support
Modified to support Freescale BeeKit™ v1.9.5
Document No. 0006-00-08-03-000
Page 15 of 15