You are on page 1of 6

Freescale Semiconductor Document Number: AN2825

Rev. 0.0, 10/2004


Application Note

Handling MAC Address Erasure


Recommendations for Restoration

1 Introduction Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . 1
This application note provides recommendations of how 2 NVM Data Sections . . . . . . . . . . . . . . . . . . . . . 2
to avoid erasure of the MAC address and how to restore 3 Recommended Solutions . . . . . . . . . . . . . . . 3
the MAC address should it be erased when a user builds
and uploads an application with a Background Debug
Module (BDM).
All devices that comply with the IEEE 802.15.4 standard
must have a unique MAC address to individually
identify the device. The MAC address located in the Non
Volatile Memory (NVM) is an integral part of an
application with an IEEE 802.15.4 MAC/PHY layer.
The NVM data section is delivered in source files to
allow customers to add their own application specific
values. The NVM data must be included in the
application because the PHY layer uses values from the
NVM section. Any application that is built on top of the
802.15.4 MAC/PHY can add its own data to the NVM
data structure. The NVM data structure has a maximum
size of 512 bytes on the MC908HCS08GB60/GT60
MCU platform. Of this, 163 bytes of NVM are reserved
for applications. The NVM section is located at the
physical address space 0x1400-0x17FF (1024 bytes).

© Freescale Semiconductor, Inc., 2005. All rights reserved.


2 NVM Data Sections
The NVM data is divided into six sections:
1. System Configuration Information — Contains the version number and build dates for different
parts of the application. (Keeps track of the different versions.)
2. Clock Related Configuration Values — Holds crucial HCS08 setup values for the MC13102
CLKO output, ICG module register values, self clock mode filter values, and UART baud rate
values.
3. MAC Address and Functional Values — Contains a unique 8 byte MAC address, antenna select,
and sleep mode enable values.
4. Production Specific Information — Keeps hardware name, serial number, and production
information.
5. Application Specific Section — This section can store application specific NVM data.
6. Flash System Flag — Holds a flash module system flag.
The MAC address that is contained in the MAC Address and Functional Values Section, is combined with
the Production Specific Information Section which are both written into the NVM data section when the
13192-EVB and 13192-SARD evaluation boards are built.
The 13192-EVB and 13192-SARD boards are produced with the Freescale Embedded Bootloader which
is pre-programmed to allow users to evaluate different demonstration applications. However, some of the
demonstration applications are delivered as source files in a Metrowerks Codewarrior MCP-project. The
MCP projects use the P&E CPROG tools to upload a new application built under the Integrated
Development Environment (IDE).
When users build and upload an application with a Background Debug Module (BDM), such as the P&E
BDM Multilink Debugger for HCS08, the flash is completely erased, and with it, the NVM and Embedded
Bootloader sections. This means that the Production Specific Section and the MAC Address and
Functional Values Section are erased.
NOTE
The MAC address from production is located on the back side of the board.

Handling MAC Address Erasure Application Note, Rev. 0.0


2 Freescale Semiconductor
3 Recommended Solutions
This section describes some things to avoid and some recommended solutions for handling MAC address
erasure. While other solutions are described, it is recommended to use one of the following:
• Solution one — Demonstration Target 3: Where upload of new firmware and full debug features
are required (BDM solution).
• Solution one — Demonstration Target 4: Where only upload of new firmware is required
(Embedded Bootloader solution).

3.1 Solution One


The Freescale demonstration application, EVK_Switch_Demo.MCP, contains four targets that can demonstrate
several ways to build applications. All four targets are briefly described in this section. Notice that
Demonstration Targets 3 and 4 show how to build an application without erasure of the MAC address and
the production data. Demonstration Target 3 uses the BDM and Target 4 uses the Embedded Bootloader
to upload the application. This is covered in more detail in Section 3.1.3, “Demonstration Target 3
(EVK_Switch_Demo w_Embedded_Bootloader) and Section 3.1.4, “Demonstration Target 4
(EVK_Switch_Demo_w_Embedded_Bootloader_PC_Tool).

3.1.1 Demonstration Target 1 (EVK_Switch_Demo)


Demonstration Target 1 builds the application without NVM update and Embedded Bootloader support.
That is, NVM data cannot be updated at run-time and will not work with the Embedded Bootloader. The
application is uploaded using the BDM with the default Metrowerks Codewarrior CPROG (Hiwave) flash
setup and the MAC address and production data are erased.

3.1.2 Demonstration Target 2 (EVK_Switch_Demo_w_HCS08_Flash_Lib)


Demonstration Target 2 builds the application with NVM update support, but does not support the
Embedded Bootloader. For example, the NVM data can be updated at run-time, but will not work with the
Embedded Bootloader. The application is uploaded using the BDM with the default Metrowerks
Codewarrior CPROG (Hiwave) flash setup and the MAC address and production data are erased.

3.1.3 Demonstration Target 3 (EVK_Switch_Demo


w_Embedded_Bootloader)
Demonstration Target 3 builds the application with NVM update and Embedded Bootloader support. For
example, NVM data can be updated at run-time and the application can be uploaded with the Embedded
Bootloader. The application is uploaded using the BDM with a custom CPROG flash setup using scripts.
The MAC address and production data are NOT erased. The output file, EVK_Switch_Demo
w_Embedded_Bootloader.s19, can also be uploaded with the PC tool ‘Test Tool’.

Handling MAC Address Erasure Application Note, Rev. 0.0


Freescale Semiconductor 3
NOTE
Users are required to purchase a copy of the P&E CPROG command line
version of the HCS08 flash programming tool. This version can, with the
available script files, upload the Embedded Bootloader and the application
at the same time.

3.1.4 Demonstration Target 4


(EVK_Switch_Demo_w_Embedded_Bootloader_PC_Tool)
Demonstration Target 4 builds the application with NVM update and Embedded Bootloader support. For
example, the NVM data can be updated at run-time and the application can be uploaded with the
Embedded Bootloader. The application is uploaded with the Bootloader.exe program and the MAC
address and production data are NOT erased.
NOTE
It is required that users install the Freescale PC tool Test Tool’. This target
uploads the application with the command line version of the
Bootloader.exe tool. See the Embedded Bootloader Reference Manual,
802514EBRM for more information.

3.2 Solution 2
The MAC address can be written directly into the application. However, this requires that an application
is built for each unique MAC address. This solution is only recommended for small development and test
setups.
The MAC address is written into the C source code file NV_Data.c located in folder .\src\code\sys.
New application data members must first be added to the NV_Data.h file located in folder
.\EVK_Common\802.15.4_Headers\Ghdr. This file contains the NVM layout.

NOTE
The application can be uploaded with the default BDM settings in
Metrowerks Codewarrior IDE, even though the production data is erased.

3.3 Solution 3
The MAC address can be written through an application that supports a communication interface
(UART/USB). The application image is built with an empty MAC address (0xFFFFFFFFFFFFFFFF) and
a PC tool writes the MAC address. However, this solution requires that the PC tool contain a list of unique
MAC addresses. The EVK_PTC_Demo_w_Embedded_Bootloader application provides an example of
Solution 3.
NOTE
The application can be uploaded with the default BDM settings in
Metrowerks Codewarrior IDE, even though the production data is erased.

Handling MAC Address Erasure Application Note, Rev. 0.0


4 Freescale Semiconductor
NOTES

Handling MAC Address Erasure Application Note, Rev. 0.0


Freescale Semiconductor 5
How to Reach Us: Information in this document is provided solely to enable system and software implementers to use
Freescale Semiconductor products. There are no express or implied copyright licenses granted
Home Page: hereunder to design or fabricate any integrated circuits or integrated circuits based on the information
www.freescale.com
in this document.
E-mail: Freescale Semiconductor reserves the right to make changes without further notice to any products
support@freescale.com herein. Freescale Semiconductor makes no warranty, representation or guarantee regarding the
suitability of its products for any particular purpose, nor does Freescale Semiconductor assume any
USA/Europe or Locations Not Listed:
Freescale Semiconductor liability arising out of the application or use of any product or circuit, and specifically disclaims any
Technical Information Center, CH370 and all liability, including without limitation consequential or incidental damages. “Typical” parameters
1300 N. Alma School Road that may be provided in Freescale Semiconductor data sheets and/or specifications can and do vary
Chandler, Arizona 85224
+1-800-521-6274 or +1-480-768-2130 in different applications and actual performance may vary over time. All operating parameters,
support@freescale.com including “Typicals”, 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
Europe, Middle East, and Africa: of others. Freescale Semiconductor products are not designed, intended, or authorized for use as
Freescale Halbleiter Deutschland GmbH
Technical Information Center components in systems intended for surgical implant into the body, or other applications intended to
Schatzbogen 7 support or sustain life, or for any other application in which the failure of the Freescale Semiconductor
81829 Muenchen, Germany product could create a situation where personal injury or death may occur. Should Buyer purchase
+44 1296 380 456 (English)
+46 8 52200080 (English) or use Freescale Semiconductor products for any such unintended or unauthorized application,
+49 89 92103 559 (German) Buyer shall indemnify and hold Freescale Semiconductor and its officers, employees, subsidiaries,
+33 1 69 35 48 48 (French) affiliates, and distributors harmless against all claims, costs, damages, and expenses, and
support@freescale.com reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death
Japan: associated with such unintended or unauthorized use, even if such claim alleges that Freescale
Freescale Semiconductor Japan Ltd. Semiconductor was negligent regarding the design or manufacture of the part.
Headquarters
ARCO Tower 15F
1-8-1, Shimo-Meguro, Meguro-ku, Freescale™ and the Freescale logo are trademarks of Freescale Semiconductor, Inc. All other
Tokyo 153-0064, Japan
0120 191014 or +81 3 5437 9125 product or service names are the property of their respective owners.
support.japan@freescale.com © Freescale Semiconductor, Inc. 2005. All rights reserved.
Asia/Pacific:
Freescale Semiconductor Hong Kong Ltd.
Technical Information Center
2 Dai King Street
Tai Po Industrial Estate
Tai Po, N.T., Hong Kong
+800 2666 8080
support.asia@freescale.com

For Literature Requests Only:


Freescale Semiconductor Literature Distribution Center
P.O. Box 5405
Denver, Colorado 80217
1-800-521-6274 or 303-675-2140
Fax: 303-675-2150
LDCForFreescaleSemiconductor@hibbertgroup.com

Document Number: AN2825


Rev. 0.0
10/2004

You might also like