5.1.3 Application Linker File

The 802.15.4/Zigbee application code must be linked with the following linker file in order to work with the Embedded Bootloader interface. The linker file specifies fixed data and code segments. See linker file for more details. Make sure to use the linker file matching the Embedded Bootloader on the PCB:

Ptc_w_Embedded_Bootloader.ach

NOTE

This file can be used with the MC908HCS08GB60/GT60 MCU.

5.2 Application

This section describes build environment topics and source files necessary to build a working 802.15.4/Zigbee application with the Embedded Bootloader.

5.2.1 Compiler Defines

The following compiler #define must be specified to enable Embedded Bootloader functionality in an 802.15.4/Zigbee application:

#define BOOTLOADER_ENABLED

5.2.2 Unreferenced Symbols

The Embedded Bootloader interface variables, NVM, and strings with version numbers, are not referenced directly from the 802.15.4/Zigbee application code. Because of this, it is required to add dummy references to these (and other) unreferenced symbols to prevent the linker file from removing the symbols during optimization. The dummy references can be placed in any reference function, but Freescale recommends adding them to the main() function.

The following code is an example from a SMAC application main() function:

#ifdef BOOTLOADER_ENABLED

 

if(

(Freescale_Copyright[0] == 0x00)

 

 

(Firmware_Database_Label[0] == 0x00)

 

 

(SMAC_Version[0] == 0x00)

 

 

(SPHY_Version[0] == 0x00)

 

 

(NV_RAM_ptr->Freescale_Copyright[0] == 0x00)

 

 

(NV_RAM0.MAC_Address[0] == 0x00)

 

 

(NV_RAM1.MAC_Address[0] == 0x00)

 

 

(boot_loader_control == ((uint8_t)0x00))

 

 

(boot_loader_flag == ((uint8_t)0x00))

 

)

 

 

 

 

 

5-2

Embedded Bootloader Reference Manual, Rev 0.0

Freescale Semiconductor

Page 38
Image 38
Freescale Semiconductor 802.15.4 manual Application Linker File, Compiler Defines, Unreferenced Symbols