Freescale Semiconductor 802.15.4 manual Application Linker File, Compiler Defines

Page 38

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

Image 38
Contents 802.15.4/Zigbee Embedded Bootloader How to Reach Us USA/Europe/Locations Not Listed Contents Embedded Bootloader Programming Embedded Bootloader Public Function Description Audience Conventions References Chapter Embedded Bootloader Description TargetPorted Targets Axiom AXM-0308Benefits FeaturesPotential Issues Optional Firmware Upload Settings Use Case One Chapter Using the Embedded BootloaderUpload Firmware Safe Mode Boot Use Case TwoAn Example of How to Change the MAC Address Updating Non-volatile Memory NVMSystem Bus Frequency Uart Baud RateChapter Test Tool Zigbee Flash Tool Using the Tools Menu Option Graphical User Interface GUI VersionUsing the View Menu Option View Menu OptionSelecting the Firmware File to Upload Firmware UploadAfter a Successful Firmware Upload Using the Help Menu Changing the NVM Data in Flash or FileSystem Configuration Window Command Line Version CMD Command Line Version Parameter ListNormal Use Example Default Flash Erase Disabled ExampleEmbedded Bootloader Reference Manual, Rev Chapter Embedded Bootloader Programming Programming To An Empty Erased BoardConnection Assistant Window Load Executable Window Status Window Upgrading The Embedded Bootloader Connection Assistant Window Programmer Expert Window S19 File Window Status Window Embedded Bootloader Reference Manual, Rev Product Deliverables Embedded Bootloader ImageChapter Application Integration Reference Guide Application Support FilesApplication Linker File Unreferenced SymbolsApplication Compiler DefinesDigiType.h System Clock SetupApplication Support Files 2 Gb60io.h3 Crt0.c and Crt.h ISRVectors.c EmbeddedBootloader.h and EmbeddedBootloader.cNVData.c and NVData.h DummyIsr.c 1 HCS08 Compiler Embedded Bootloader Build EnvironmentChapter Port Integration Reference Guide 2 HCS08 Linker2 HCS08FlashLib.Lib EmbeddedBootloader.mcpEmbeddedBootloaderFunctionalityLib.Lib Source FilesStandard Libraries Porting to a Specific TargetCode and Data Segments Compiler #definesSource Files Target.hResetVector.c EmbeddedBootloaderTarget.hMain.c HWInit.hHWInit.c EnableDownloadFirmware Chapter Embedded Bootloader Public Function Description802.15.4/Zigbee Application Accessible Functions Embedded Bootloader boot flag HardReset UpdateNVRAMNVFlashSetup FLICGSetupUARTPortSelect Output NoneEmbedded Bootloader Reference Manual, Rev Chapter Embedded Bootloader Memory Map 128 Direct Port Registers1BFF 4BFF 4DFF 4FFF 8BFF 8DFF 8FFF Embedded Bootloader Reference Manual, Rev FFB0 Ffbf Cursive = fixed register and vectors in flash Embedded Bootloader Reference Manual, Rev Appendix a Release Folder and File Structure Folder StructureFile Structure EmbeddedBootloaderFunctionalityLib.Lib Functionality library Embedded Bootloader Reference Manual, Rev