1 / 23

The ZigBee Development Environment

The ZigBee Development Environment. Speaker : Kai-Jia Chang Adviser : Quincy Wu Date : 2009-12-1. Outline:. The Embedded Compiler and Debugger CodeWarrior Tricks and Tips Debugging the Network Introduction to Daintree SNA Example Development Sessions.

sblais
Télécharger la présentation

The ZigBee Development Environment

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The ZigBeeDevelopment Environment Speaker : Kai-Jia Chang Adviser : Quincy Wu Date : 2009-12-1

  2. Outline: • The Embedded Compiler and Debugger • CodeWarrior Tricks and Tips • Debugging the Network • Introduction to Daintree SNA • Example Development Sessions

  3. The Embedded Compiler and Debugger (cont.) PC with compiler (binary image)  ZigBee board

  4. The Embedded Compiler and Debugger (cont.) As part of putting the binary image together, a process called “ linking ” is used. There is usually a file associated with linking called a locator file, which tells the linker where to place the code and data within the target MCU. MCU : Micro Controller Unit ;微控制單元 指隨著超大型積體電路將CPU,RAM,ROM,I/O... 集成在一晶片中。

  5. The Embedded Compiler and Debugger (cont.) A debugger uses a JTAG or BDM connection (through USB) to program the application into flash memory in the target board. Once the download is complete, can now run independently of the PC. JTAG: Joint Test Action Group;聯合測試行動小組 是一種國際標準測試協議(IEEE 1149.1兼容) ,主要用於晶片內部測試。 標準的JTAG接頭是4線:TMS、TCK、TDI、TDO,分別為 模式選擇、時鐘、數據輸入和數據輸出。 BDM: Background Debug Mode;背景除錯模式 Freescale半導體公司推出的一種單線(Single Wire)調試方式,是目前單片機普通采用的調試方式之一。 (註1)

  6. CodeWarrior Tricks and Tips • Hyper-links aren’t available until the compiler has compiled a module. • Source code is automatically pulled into the project if it has the same name and is in the project tree. • The debugger gets stuck in an interrupt handler when single stepping (F10 or F11) through source code. • Breakpoints can only be set when the debugger has stopped code execution. • The optimizer can make debugging confusing.

  7. The Embedded Compiler and Debugger A compiler takes the source code of the ZigBee application, the source code of the ZigBee stack, and combines it with ZigBee libraries to create a binary image. The binary image is then downloaded into the ZigBee development (also called target) board for debugging.

  8. Debugging the Network Some bugs require looking at the network as a whole, or examining the over-the-air packets in order to solve them. To accomplish this, another type of debugger, a protocol analyzer, is used. Other bugs can happen because packets are received out-of-sequence. If an application must sequence packets, make sure to wait for the reply before sending another one. Note: A Network Analyzer allows debugging the entire network from an over-the-air perspective.

  9. San Juan Software’s private profile ID 0xc035 Freescale’s private profile ID 0xc021

  10. Introduction to Daintree SNA(Sensor Network Analyzer) This analyzer does a great job of decoding ZigBee and 802.15.4 MAC packets, and displays the data in a wide variety of formats, including time line views, network-topology views, packet views, or physical-node-placement views. Sniffers generally only sniff a single channel at a time. Note: The Daintree Sensor Network Analyzer is easy to use and very robust and understands well the complex ZigBee protocol.

  11. The window on the upper right (Packet Decode) shows the contents of a packet selected in the Packet List window in a more detailed form, including the entire set of octets (bytes) sent over the air, and each ZigBee layer, separated by different colors. The window on the upper left (Visual Device Tree) displays the nodes in the network. The window on the bottom (Packet List) lists all of the packets received, and can be sorted and filtered by time, source address, destination address, network, or any combination desired.

  12. Example Development Sessions This section walks you through two complete development sessions, from the out-of-the-box experience, to downloading real applications into ZigBee development boards, and then running and debugging them. To follow along with the examples with hardware, purchase the Freescale Network Starter Kit (NSK) available at http://www.freescale.com/zigbee . This kit has everything required to follow nearly all the examples in this book.

  13. Example Session 1: The On/Off Light This example session shows you how to build a small two-node network with a light and a switch, similar to the example in Section 1.4 of Chapter 1, “ Hello ZigBee. ” The switch can turn the light on, off, or toggle it, both with and without end-to-end acknowledgment. The example uses the Freescale common user interface, the one used with all of the Freescale sample programs.

  14. NCB Coordinator (ZC) OnOffLight SRB Router (ZR) OnOffLight Sniffer BDM Has the Blue Light

  15. Step 1.Install the software and hardware: • Purchase the Freescale Network Starter Kit (NSK) • Purchase the Freescale sniffer • Install BeeKit • Install CodeWarrior • Install Daintree SNA • Connect and install the BDM • Connect and install the Freescale sniffer • Connect and install the NCB and two SRB boards • Download and install example code

  16. Step 2.Create, compile, and download each project: • Modify and/or export the solution in BeeKit • Import each project into CodeWarrior • Compile the code • Download (debug) the code

  17. Step 3.Run the example: • Optionally set up the sniffer • Boot the ZigBee boards • Bind the application • Press buttons and watch the fun This was using Windows XP!

  18. Note: The basic steps used to create an application with BeeKit are: • Install CodeWarrior, BeeKit, and Daintree (first time only). • Create project(s) in BeeKit from templates and export them. • Import projects into CodeWarrior, compile and download them. • Reset the boards to run the application (most use the Freescale Common UI).

  19. Example Session 2: Morse Code It was originally created by Samuel F. B.Morse for the electric telegraph in the early 1840s. This code uses a series of “ dots ” and“ dashes ” to represent the letters in the English alphabet and the numbers 0 through 9. (註2)

  20. The steps for an example which includes additional source code are as follows: • Open the existing BeeKit solution file. • Export the solution (the collection of projects). • Copy the additional source files from the example source directory to each project directory. • Import each project into CodeWarrior. • Compile and download each project into the proper board. • Run the application.

  21. Note: The steps to add example source code to a project are: • Export projects from the BeeKit solution. • Copy example source code into the projects. • Import projects into CodeWarrior, compile and download them. • Reset the boards to run the applications.

  22. 備註: • 註1:BDM延伸閱讀 • http://www.autooo.net/utf8-classid124-id45545.html • 註2:Morse Code延伸閱讀 • http://0rz.tw/ngp5s

  23. Thank for listening!!!

More Related