Freescale Semiconductor 802.15.4 manual Application Support Files, System Clock Setup, DigiType.h

Page 39

{

// Do something to aviod that code is removed by linker

}

5.2.3 System Clock Setup

The Embedded Bootloader contains the ICG_Setup() function which is called if the Embedded Bootloader must start. The Embedded Bootloader sets up the system clock as specified in the NVM section (ICG) if available. If not a default value is used.

The 802.15.4/Zigbee application must include a system clock setup function. The 802.15.4/Zigbee application can access the clock setup FL_ICG_Setup() function in the Embedded Bootloader. This allows the application to save code space for implementing a system clock setup function. Any clock setting can be setup by specifying the proper ICG register values in the NVM data section.

The 802.15.4/Zigbee application should also have a “lost clock lock” ISR function which calls the FL_ICG_Setup() function. This function must be added to the ISR vector table.

The following is an example of an ISR function to handle lost lock of clock (CLKO).

__interrupt void FLL_Lost_Lock_ISR(void)

{

//Setup ICG module again to prevent that system hangs forever. ICGS1 = 0x01; // Clear FLL lost lock interrupt

#if defined BOOTLOADER_ENABLED

FL_ICG_Setup(); // Call ICG_Setup()in Embedded Bootloader #endif defined BOOTLOADER_ENABLED

}

5.3Application Support Files

The 802.15.4/Zigbee application must include some support source code to make an interface to the Embedded Bootloader application. The needed files are delivered to users who want to use the Embedded Bootloader in their system.

NOTE

Some of the files are global header files from the 802.15.4 MAC/PHY release.

Look for new or updated application support files at the Freescale

Zigbee/802.15.4 web page.

5.3.1 DigiType.h

This file contains some C-language type definitions used in the source files.

5.3.2 Gb60_io.h

This is an MC908HCS08GB60 MCU interface file. All peripherals embedded in the MCU are listed with their absolute addresses.

Freescale Semiconductor

Embedded Bootloader Reference Manual, Rev. 0.0

5-3

Image 39
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 Target Chapter Embedded Bootloader DescriptionAxiom AXM-0308 Ported TargetsFeatures Potential IssuesBenefits Optional Firmware Upload Settings Chapter Using the Embedded Bootloader Upload FirmwareUse Case One Use Case Two Safe Mode BootUpdating Non-volatile Memory NVM An Example of How to Change the MAC AddressUart Baud Rate System Bus FrequencyChapter Test Tool Zigbee Flash Tool Graphical User Interface GUI Version Using the Tools Menu OptionView Menu Option Using the View Menu OptionFirmware Upload Selecting the Firmware File to UploadAfter a Successful Firmware Upload Changing the NVM Data in Flash or File Using the Help MenuSystem Configuration Window Command Line Version Parameter List Command Line Version CMDFlash Erase Disabled Example Normal Use Example DefaultEmbedded Bootloader Reference Manual, Rev Programming To An Empty Erased Board Chapter Embedded Bootloader ProgrammingConnection 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 Application Support Files Embedded Bootloader ImageChapter Application Integration Reference Guide Product DeliverablesCompiler Defines Unreferenced SymbolsApplication Application Linker File2 Gb60io.h System Clock SetupApplication Support Files DigiType.h3 Crt0.c and Crt.h EmbeddedBootloader.h and EmbeddedBootloader.c NVData.c and NVData.hISRVectors.c DummyIsr.c 2 HCS08 Linker Embedded Bootloader Build EnvironmentChapter Port Integration Reference Guide 1 HCS08 CompilerSource Files EmbeddedBootloader.mcpEmbeddedBootloaderFunctionalityLib.Lib 2 HCS08FlashLib.LibCompiler #defines Porting to a Specific TargetCode and Data Segments Standard LibrariesTarget.h Source FilesEmbeddedBootloaderTarget.h ResetVector.cHWInit.h HWInit.cMain.c Chapter Embedded Bootloader Public Function Description 802.15.4/Zigbee Application Accessible FunctionsEnableDownloadFirmware Embedded Bootloader boot flag UpdateNVRAM HardResetFLICGSetup NVFlashSetupOutput None UARTPortSelectEmbedded Bootloader Reference Manual, Rev 128 Direct Port Registers Chapter Embedded Bootloader Memory Map1BFF 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 Folder Structure Appendix a Release Folder and File StructureFile Structure EmbeddedBootloaderFunctionalityLib.Lib Functionality library Embedded Bootloader Reference Manual, Rev