Freescale Semiconductor Li t erature Distribution Center
P.O. Box 5405
Denver, Colorado 80217
1-800-521-6274 or 480-768-2130
Japan:
Freescale Semiconductor J apan Ltd.
Technical Information Center
3-20-1, Minami-Azabu, Minato-ku
Tokyo 106-8573, Japan
81-3-3440-3569
Asia/Pacific:
Freescale Semiconductor Hong K ong Lt d.
2 Dai King Street
Tai Po Industrial Estate
Tai Po, N.T., Hong Kong
852-26668334
Home Page:
www.freescale.com
Information in this docum ent is provided solely to enable system and sof tware
implementers to use Freesc al e S em i conductor products. There are no express or
implied copyright licenses granted hereunder to design or fabricate any integrated
circuits or integrated c i rcuits based on the information i n this document.
Freescale Semiconductor reserves the right to make changes without further notice
to any products herein. Freesc al e Semiconductor makes no warranty , representation
or guarantee regarding the suitability of its products for any particular purpose, nor
does Freescale Semiconductor assume any liabilit y arising out of the application or
use of any product or circuit, and s pecifically disclaims any and all liability, inc l uding
without limitation consequential or incidental damages. “Typical” parameters that may
be provided in Freescale Semiconductor data sheets and/or specifications can and
do vary in different applications and actual performance may vary over time. All
operating parameters, including “Ty pi cals”, must be validated for each customer
application by customer’ s technical experts. Freescale Semiconductor does not
convey any license under its patent rights nor the rights of others. Freescale
Semiconductor products are not designed, intended, or authorized for use as
components in systems intended for surgical implant i nto the body, or other
applications intended to support or sustain life, or for any other application in which
the failure of the Freescale Sem i conductor product could create a s i tuation where
personal injury or death may occ ur. Should Buyer purchase or use Freesc al e
Semiconductor products for any such unintended or unauthorized application, Buyer
shall indemnify and hold Freesc al e S em i conductor and its officers, employees,
subsidiaries, affiliates, and dist ribut ors harmless against all claims, cost s, damages,
and expenses, and reasonable attorney fees arising out of, directl y or indirectly, any
claim of personal injury or deat h associated with such unint ended or unauthorized
use, even if such clai m al l eges that Freescale Semiconduc tor was negligent
regarding the design or manufacture of t he part .
Learn More: For more information about Freescale produc ts, please visit
www.freescale.com.
Revision History ........................................................................................................................................viii
Freescale Semiconductor Embedded Bootloader Reference Manual, Rev. 0.0 v
About This Book
This guide provides a detailed description of Freescale’s Embedded Bootloader and describes how to port
Freescale’s Embedded Bootloader to a specific PCB/target..
The Embedded Bootloader is intended for use with the IEEE® 802.15.4 evaluation kits (EVK). However,
it is possible to upload applications with the Embedded Bootloader in the development phase, but the
Embedded Bootloader will not provide any debug functions.
The Embedded Bootloader provides an easy and inexpensive way to upload new firmware and eliminate
the requirements for expensive debug/development tools. The only requirement is a standard PC with an
RS232 UART/USB interface running Windows 2000 or XP.
The Embedded Bootloader must be used with the Zigbee Flash Tool which can be found in the Test Tool
Suite ‘Test Tool.exe’.
This document describes Embedded Bootloader version 5.01.
Audience
This document is intended for application developers.
Organization
This document is organized into eight chapters and one appendix.
Chapter 1 Embedded Bootloader Description — This chapter gives an overview of the
Embedded Bootloader.
Chapter 2 Using the Embedded Bootloader — This chapter describes the basic
functionality of the Embedded Bootloader.
Chapter 3 Test Tool, Zigbee Flash Tool — This chapter describes the Zigbee Flash Tool.
The GUI and Command Line versions are covered.
Chapter 4 Programming the Embedded Bootloader — This chapter describes how to
program the Embedded Bootloader to flash memory.
Chapter 5 Application Integration Reference Guide — This chapter describes the
deliverables required to build an 802.15.4/Zigbee Application with the
Embedded Bootloader.
Chapter 6 Port Integration Reference Guide — This chapter describes the deliverables
required and how to integrate them to make an executable Embedded
Bootloader for a specific PCB.
Chapter 7 Embedded BootloaderPublic Function Description — This chapter provides
a description of the, from an 802.15.4/Zigbee application, accessible functions
in the Embedded Bootloader.
Chapter 8 Memory Map — This chapter describes the Bootloader Memory Map.
Appendix A Release Folder and File Structure — This appendix shows the folder and file
structure for this release.
vi Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor
Conventions
This document uses the following notational conventions:
• Courier monospaced type indicates commands, command parameters, code examples,
expressions, data types, and directives.
• Italic type indicates replaceable command parameters.
• All source code examples are in C.
Definitions, Acronyms, and Abbreviations
BDM debugger A debugger using the BDM interface for communication with the MCU. An
example is the P&E BDM Multilink debugger for HCS08.
BDM Background Debug Module
EVB Evaluation Boards - this term covers the DIG-528-2 (EVK) and DIG536-2
(SARD) boards.
EVK Evaluation Kit
GUI Graphical User Interface
MAC Medium Access Control
MCU MicroController Unit
NVM None-Volatile Memory
PC Personal Computer
PCB Printed Circuit Board
S19 ‘S19’ is the file extension used for the Motorola binary image format. The S19
file encapsulates the binary image as a list of ASCII records. Each record
contains a length -, address -, data - and checksum field. The 16 bit address field
allows a memory space for up to 64 KB. The S19 can be generated with
Metroworks Codewarrior IDE and is the product from the linking process. S19
does not contain additional information to a debugger (where to look for source
files).
Safe Mode Boot The Embedded Bootloader boots up using safe default system values.
HIWAVE P&E HCS08 debugger GUI.
CPROG P&E HCS08 flash programming tool called from HIWAVE. The tool is also
available in a command line version where scripts can be made.
Freescale Semiconductor Embedded Bootloader Reference Manual, Rev. 0.0 vii
The following table summarizes revisions to this manual since the previous release (Rev. 0.0).
Revision History
Location Revision
Entire Document
This document supercedes revision 2.4 of the
Freescale Embedded Bootloader User’s Guide,
MC13192FLUG/D.
viii Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor
Chapter 1
Embedded Bootloader Description
The Embedded Bootloader is intended for use with the IEEE® 802.15.4 evaluation kits (EVK). However,
it is possible to upload applications with the Embedded Bootloader in the development phase, but the
Embedded Bootloader will not provide any debug functions.
The Embedded Bootloader provides an easy and inexpensive way to upload new firmware and eliminate
the requirements for expensive debug/development tools. The only requirement is a standard PC with an
RS232 UART/USB
The Embedded Bootloader must be used with the Zigbee Flash Tool which can be found in the Test Tool
Suite ‘Test Tool.exe’.
This document describes Embedded Bootloader version 5.01.
The Embedded Bootloader is located in a protected 4 KB flash block in the highest memory area
(0xF000-0xFFFF) of the Freescale MC908HCS08GB60/GT60 microcontroller. (It cannot be accidentally
erased.) A BDM debugger is required to erase the Embedded Bootloader. See the Handling MAC Address Erasure Application Note, AN2825/D
1)
At least one of these communication interfaces must be supported by the target PCB.
1)
interface running Windows 2000 or XP.
1.1 Target
The Embedded Bootloader runs on the Freescale MC908HCS08GB60/GT60 MCU.
The MC908HCS08GB60/GT60 is a member of Freescale’s low-cost, high-performance HCS08 family. It
has 60 KB embedded flash (flash sector size of 512 bytes) and 4 KB embedded RAM..
The Embedded Bootloader uses the MC13192 CLKO. See Chapter 2 for more information.
The Embedded Bootloader must be ported (I/O mapped) to a specific PCB for proper functionality and is
currently ported to the following Freescale PCBs:
Axiom AXM-0308:
• PC Communication Interface: RS232/UART on COM1 (SCI1)/
RS232/UART on COM2 (SCI2)
• Safe Mode Boot Short pins 2-3 on COM1 (SCI1)/
COM2 (SCI2)
• Version Number “AX-0308 Ver 5.01”
DIG528-2 EVK
• PC Communication Interface: RS232/UART on COM1 (SCI1)/
USB (SCI2)
• Safe Mode Boot Short pins 2-3 on COM1-port (SCI1)
• Version Number “528&536 Ver 5.01”
DIG536-2 SARD
• PC Communication Interface: RS232/UART on COM1 (SCI1)
• Safe Mode Boot Short pins 2-3 on COM1-port (SCI1)
• Version Number “528&536 Ver 5.01”
RD01
• PC Communication Interface: RS232/UART/USB on COM1 (SCI1)/
RS232/UART/USB on COM2 (SCI2)
• Safe Mode Boot Short pins 2-3 on COM1 (SCI1)/
COM2 (SCI2)
• Version Number “ RD01 Ver 5.01”
NOTE
The generic RD01 target can be used with any PCB using the Freescale
Reference Design version 01 I/O layout. The PCB must support at least
one communication interface. If a USB is the only interface, use a
jumper to short SCI pins 2 and 3 to make Safe Mode Boot available.
Refer to Section 6.3 for details on how to port the Embedded Bootloader to a specific PCB.
o Disabled The 802.15.4/Application/NVM (except production data section) is erased
(default)
o Enabled The 802.15.4/Application/NVM is NOT erased
• Erase production data (get production data from firmware file)
o Disabled The production data section (with MAC address) in NVM are preserved. All
other NVM values are updated with the values from the S19 record file
(default)
o Enabled The production data (with MAC address) and all other values in NVM are
erased. All NVM values are updated with the values from the S19 record file
NOTE
Care must be taken when enabling this option. The user must save a
backup of vital production data (MAC address). The production data can
be manually added to the NVM structure in the NV_Data.c file.
• Do not reset after upload
o Disabled The system is automatically reset after upload (default)
o Enabled The system must be manually reset by user
• Skip firmware checksum verification
o Disabled A checksum verification of the S19 file data record is performed
NOTE
The Embedded Bootloader will report the address of the first data
mismatch found in the current S19 data record. System must be reset if
an error is reported. Check the optional settings and try again.
o Enabled No checksum verification is performed. Flash programming errors cannot be
detected.
2)
The UART/USB communication channel is also protected with a protocol checksum.
This chapter describes the Embedded Bootloader functionality. A detailed description of the functions
briefly mentioned in this chapter can be found in Chapter 7.
2.1 Upload Firmware
The Embedded Bootloader can be used in different system configurations depending on the PCB and the
application. The application should have a user interface feature that makes it possible for the application
to call the Enable_Download_Firmware() function:
The application can optionally call the Hard_Reset() function to perform a reset, or the board can be reset
manually. The board will now start up in Embedded Bootloader mode.
Start the PC-Tool. See Chapter 3 for more information.
2.1.1 Use Case One
In this case, users send a specific command via the UART to enable firmware upload
(1)
MC908HCS08GB60
B Application Test Tool
o
o NVM
t
l 802.15.4 MAC
o
a
d 802.15.4 PHY
e RS232
r Device Driver UART
1)
Or MC908HCS08GT60
2)
Or USB
/MC13192 PC
(2)
UART or USB
Figure 1 Application Supporting RS232 UART or USB Inter face
In this use case, users push a button on the board to enable firmware upload.
MC908HCS08GB60
B Application
o
o NVM
t
l 802.15.4 MAC
o
a User Interface
d 802.15.4 PHY Push Buttons
e I/O
r Device Driver GPIO S101 S102 S103 S104
(1)
/MC13192
1)
Or MC908HCS08GT60
Figure 2 Application Supporting an I/O Interface
2.1.3 Safe Mode Boot
The Safe Mode Boot Mode is a special startup mode where the Embedded Bootloader boots using safe
system settings thereby resetting the system to a known (default) state.
The Safe Mode Boot can be used to disable the detection of an invalid/malfunctioning application due to
items such as code errors, corrupt NVM data, or internal flash programming errors among others. All the
NVM memory (except production data and MAC address) is completely erased.
The Safe Mode Boot can also be used to upload firmware without first calling the
Enable_Download_Firmware() function. This could be useful if the use cases (as shown in Section 2.1,
Upload Firmware) are not applicable.
Users must perform the following steps to conduct a Safe Mode Boot.
1. Power off the board
2. Disconnect RS232 UART cable (if the RS232 UART interface is used)
3. Short UART TX and RX (pin 2-3) (This works even though the 802.15.4/Zigbee application does not
use the UART interface.)
The MC908HCS08GB60/GT60 starts in 4 MHz self clocked mode. The init code changes this to 8 MHz
after a few instructions from reset.
If NVM data is found, the system clock (MC908HCS08GB60/GT60 ICG module and MC13192 CLKO)
and other options are setup as specified by the uploaded application. See the Freescale 802.15.4 MAC/PHY Software Reference Manual, 802154MPSRM/D, for more details.
If no NVM data can be found, the following (safe mode boot) values are used:
• MC13192 CLKO = 62.5 KHz
• MC908HCS08GB60/GT60 bus clock = 16 MHz
2.4 UART Baud Rate
If NVM data is found, the UART baud rate is setup as specified by the uploaded application. Several
values can be used. See the MC908HCS08GB60/GT60 MCU Data Sheet, MC9S08GB60/D for more
information.
The baud rate depends on the NVM values specified by the application. See the Freescale 802.15.4 MAC/PHY Software Reference Manual, 802154MPSRM/D, for more details.
If no NVM data is found, the following (safe mode boot) values are used:
The Zigbee flash tool is a part of the general Zigbee Test Tool. This chapter provides a brief description
of how to use the Zigbee Test Tool to upload new firmware. For more details about installation and other
features, see the documentation for the Zigbee Test Tool and the Zigbee.hlp file in Test Tool installation
directory .\help.
The flash programming part of the Test Tool can be used with two different user interfaces.
1. The GUI-version in ‘Test Tool.exe’
2. The command line version in ‘Bootloader.exe’ in the ‘S19’ folder.
This description covers Embedded Bootloader version 5.00 of the Zigbee Test Tool.
Uploadable applications in Motorola S19 file format must be copied to the
[installation directory]\Freescale\Test Tool\S19 directory in advance.
Copy any new applications in S19 format to this folder.
NOTE
The actual window layout may differ from the figures shown in this
document. Refer to the Freescale Zigbee/802.15.4 web page for new or
updated applications.
After clicking on the Tools menu option, click the Communication Settings option to choose the baud rate
specified for the current embedded application.
Notice that applications require that you push one or more buttons or some other functions to enable
upload of new firmware. See the Zigbee/802.15.4 Evaluation Kit Quick Start Guide, AN2772/D, for a
description of what to do for a specific application.
If no application is downloaded, use the default settings specified for the Embedded Bootloader. See
In the ‘Flash Section’ window, click on the application file to upload and then click on the “Upload”
button. The upload progress bar begins to indicate upload progress.
Upload Button
Upload
Progress Field
Application
Files
Status/Error
Information Field
The Status/Error Information Field shows the Status/Error Information received from the Embedded
Bootloader.