Home
Freescale Semiconductor 802.15.4 User's Manual
Contents
1. 12 Write NVM production data back by selecting the PEDebug menu Then select Programming Options and Start Expert Mode Programmer Select SS Specify S record and locate the PD NVM s19 file built in Step 10 Select the PM Program Module option and production data is written to flash 13 Remove power and disconnect the BDM cable from PCB Next power up the PCB The PCB is now ready to upload an application See Chapter 2 for more information about how to upload an application NOTE The applications must have the production section in the NVM cleared That is the application image must contain OxFF s in the production data section of the NVM Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 4 9 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor Chapter 5 Application Integration Reference Guide This chapter describes the deliverables required to build an 802 15 4 Zigbee Application with the Embedded Bootloader NOTE The Freescale Switch Demonstration application is available with complete source code The Switch Demonsration shows how to make an 802 15 4 application with the Embedded Bootloader Refer to the Switch Demonstration Application Note AN2773 for more details 5 1 Product Deliverables To be able to make an application with the Freescale Embedded Bootloader you need three major components e Embedded Bootloader Image e Application Support
2. 6 2 Product Deliverables ass SA AA AS AA AS 6 2 6 2 1 Embedded Bootloader Mep niccensis dnte n E EEE E E A 6 2 6 22 HCS08 Fl sh Lib Lib a li Y Y yd Tea AE S a 6 2 6 2 3 Embedded _Bootloader_Functionality_Lib Lib oonoonnnnincninccionanonnconnconnconnconnononoconoconoconrnconocnnnos 6 2 e A O 6 2 iv Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor 6 3 Porting toa Specific Target uyn i YY E MAY RW FOD A 6 3 6 3 Codeand Data Segmentsx ue WT dees tested hl NW Vasc eeu WC FF GWYNFYD YN iia 6 3 6 3 2 tamara Labra dt ados 6 3 6 33 Compiler defines ii iia 6 3 6 4 Source Ple AA Y GY RD DY FF 6 4 OA A hene edi GW RHEN a a WYF aT ddf TYST Y a GY 6 4 0 42 ReSet Vecton Cun A dd DW A Y FFF A 6 5 6 4 3 Embedded Bootloader Target oo cccccscccssecsecssecsecesecnseceseceecseseceseesseeseeeseeeeeseseaeeseeeaeenaees 6 5 GAA A AAA AS A tales awed ages 6 6 6 4 5 HW Mit A AS isos TA GL do US AF 6 6 6 46 MAS ainia 6 6 Chapter 7 Embedded Bootloader Public Function Description 7 1 7 1 802 15 4 Zigbee Application Accessible Functions oooooonncccnoccnonononononcconnconnonnoconoconoconnoconccnnnnnns 7 1 7 1 1 Enable Download Firmware 0 c cccccesccesscessceeseeeseeeseeessecsaecasecsaecsecnsecsseeeeeeseeeeeseseseeeseeeaeeaaees 7 1 12 Hard ROSE tess ce ssc esner a dica de 7 3 A Up NN A Cd E 7 3 PAA NV Flash SU a CWYD CS GDG WW FWA WD da WY DYF 7 4 Hi PEGG Sii I RYN RY RI F
3. 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 reguired to erase the Embedded Bootloader See the Handling MAC Address Erasure Application Note AN2825 D D At least one of these communication interfaces must be supported by the target PCB 1 1 Target The Embedded Bootloader runs on the Freescale MC908HCS0 GB60 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 Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 1 1 1 1 1 Ported Targets 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 e PC Communication Interface e Safe Mode Boot e Version Number DIG528 2 EVK e PC Communication Interface e Safe Mode Boot e Version Number DIG536 2 SARD e PC Communication Interface e Safe Mode Boot e Version Number e PC Communication Interface e Safe Mode Boot e Version Number RS232 UART on COM1 SCI1 RS232 UAR
4. 8 7 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor Appendix A Release Folder and File Structure This appendix describes the folder and file structure for this release A 1 Folder Structure 802 15 4_Headers Ll Ghar Bin Embedded_Bootloader F AX 0308RevC _ L DIG 528 2_DIG 536 2_RDO1 Global headers from the 802 15 4 MAC PHY Release When target is built the output files are stored here Freescale s reference build of the Embedded Bootloader for the Axiom AXM 0308 development board DIG 528 2 and DIG 536 2 are Freescale s reference build for the DIG 528 2 and DIG 536 2 EVB s RDO1 is Freescale s reference build for all PCB s using the Freescale Reference Design version 01 l Embedded_Bootloader_Functionality_Lib Embedded Bootloader functionality library HCS08_Flash_Lib source code not released Embedded Bootloader HCS08 flash library source code not released Linker file Source code Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 A 1 A 2 File Structure This section describes all of the files in the Embedded Bootloader release Embedded_Boot loader Embedded_Bootloader mcp Metrowerks Codewarrior project file flash hwc Hiwave system file flash hwl Hiwave system file flash ini Hiwave system file Embedded_Boot loader 802 15 4 Headers Ghdr AbelReg h AppAspInterface h Debug h DigiType h Def
5. BDFF 512 FLASH section 2 95 BE00 BFFF 512 FLASH section 2 96 C000 C1FF 512 FLASH section 2 97 C200 C3FF 512 FLASH section 2 98 C400 C5FF 512 FLASH section 2 99 C600 C7FF 512 FLASH section 2 100 C800 C9FF 512 FLASH section 2 101 CA00 CBFF 512 FLASH section 2 102 ccoo CDFF 512 FLASH section 2 103 CE00 CFEF 512 FLASH section 2 104 D000 DIFF 512 FLASH section 2 105 D200 D3FF 512 FLASH section 2 106 D400 D5FF 512 FLASH section 2 107 D600 D7FF 512 FLASH section 2 108 D800 D9FF 512 FLASH section 2 109 DAOO DBFF 512 FLASH section 2 110 DC00 DDFF 512 FLASH section 2 111 DEOO DFFF 512 FLASH section 2 112 E000 E1FF 512 FLASH section 2 113 E200 E3FF 512 FLASH section 2 114 E400 ESFF 512 FLASH section 2 115 E600 ETFF 512 FLASH section 2 116 E800 E9FF 512 FLASH section 2 117 EA00 EBFF 512 FLASH section 2 Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 8 5 118 EC00 EDFF 512 FLASH section 2 119 EE0O EFBF 448 FLASH section 2 119 EFCO EFFD 62 FLASH section 2 802 15 4 app ISR vectors 119 EFFE EFFF 2 FLASH section 2 Embedded Bootloader system flags placed by 802 15 4 application 120 F000 FOOF 16 FLASH section 2 120 F010 F013 4 FLASH section 2 120 F014 F050 61 FLASH section 2 120 F051 F1FF 431 FLASH section 2 121 F200 F3FF 512 FLASH section 2 122 F400 F5FF 512 FLASH section 2 123 F600 F7FF 512 FLASH section 2 12
6. Files e Application Linker File 5 1 1 Embedded Bootloader Image The Embedded Booloader executable image for a specific PCB must exist on the PCB in advance If not it must be downloaded to the PCB with a BDM debugger like the P amp E Multilink BDM debugger for HCS0S See Section 1 1 1 Ported Targets for more details NOTE Use caution when making an 802 15 4 Zigbee Application with the Embedded Bootloader Several versions different version numbers exist with different supported features Ensure that you do not use a feature that is not supported by the Embedded Bootloader version on the PCB and that a version of the Embedded Bootloader is preloaded on the PCB 5 1 2 Application Support Files A few application source files must be included in the 802 15 4 Zigbee application for proper interface to the Embedded Bootloader See Section 5 3 Application Support Files for more details Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 5 1 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 buil
7. Reference Manual Rev 0 0 3 9 3 10 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor Chapter 4 Embedded Bootloader Programming This chapter describes how to program the Embedded Bootloader with a P amp E Multilink for HCSO8 BDM debugger The Embedded Bootloader is normally downloaded to the PCB where production data is also written Users must employ different procedures depending on what needs to be programmed Users can program the Embedded Bootloader to an empty erased PCB or they can upgrade to a newer version of the Embedded Bootloader Follow the procedures in Section 4 1 Programming To An Empty Erased Board if the PCB is empty erased Users must make a copy of the production data section in the NVM see Section 5 3 5 NV_Data c and NV_ Data h if they need to upgrade the Embedded Bootloader This can be done either manually or automatically by a custom made script with the command line version of the CPROG tool The command line version is not described further Follow the procedures as shown in Section 4 2 on how to make a copy of the production data 4 1 Programming To An Empty Erased Board This section describes how to program the Embedded Bootloader to an empty erased board 1 Execute the HIWAVE EXE file from your chosen installation directory For example installation directory Metrowerks CodeWarrior CW08_V3 0 Prog 2 From the main window setup the target by selecting the Compon
8. 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 MC908HCS08GB600 MC13192 PC Application Test Tool 802 15 4 MAC 802 15 4 PHY Device Driver UART UART or USB D Or MC908HCSO8GT60 2 Or USB Figure 1 Application Supporting RS232 UART or USB Interface Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 2 1 2 1 2 Use Case Two In this use case users push a button on the board to enable firmware upload MC908HCS08GB60 MC13192 Application NVM 802 15 4 MAC 802 15 4 PHY D Or MC908HCS08GT60 User Interface Push Buttons S101 S102 S103 S104 Figure 2 Application Supporting an I O Interface VO 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 ap
9. in the following path Install Folder Metrowerks CodeWarrior CW08_V3 0 lib HCO8c 6 3 3 Compiler defines No compiler defines are necessary Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 6 3 6 4 Source Files This section describes the source files 6 4 1 Target h The user must define the PCB target specific defines in the Target h in the 802 15 4 Headers Ghdr file for a successful port NOTE Several other defines are made in the target description in target h The defines are used by the 802 15 4 MAC PHY build The listed defines are the ones which must also be defined for the Embedded Bootloader Example for the Freescale TARGET DIG528_2 and TARGET DIG536 2 MC13192 reset pin connection define HWAssertAbelReset PTCD amp 0x10 Reset define HWDeAssertAbelReset PTCD 0x10 Reset 1 ll o Optional for Safe Mode Boot indicator function LED pin connections define LED1ON PTDD amp OXxFE define LED1OFF PTDD 0x01 define LEDITOGGLE PTDD 0x01 define LED2ON PTDD amp OxFD define LED20FF PTDD 0x02 define LED2TOGGLE PTDD 0x02 define LED3ON PTDD OxF7 define LED30FF PTDD 0x08 define LED3TOGGLE PTDD 0x08 LED4ON PTDD define LED4OFF PTDD 0x10 define LED4TOGGLE PTDD 0x10 define OxEF The MC13192 attention and reset pin bit positions define ABEL ATT
10. 0 75FF 512 FLASH section 2 59 7600 TIFE 512 FLASH section 2 60 7800 79FF 512 FLASH section 2 61 7A00 7BFF 512 FLASH section 2 62 7C00 7DFF 512 FLASH section 2 63 7E00 TEPER 512 FLASH section 2 Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 8 3 64 8000 81FF 512 FLASH section 2 65 8200 83FF 512 FLASH section 2 66 8400 85FF 512 FLASH section 2 67 8600 87FF 512 FLASH section 2 68 8800 89FF 512 FLASH section 2 69 8A00 8BFF 512 FLASH section 2 70 8C00 8DFF 512 FLASH section 2 71 8E00 8FFF 512 FLASH section 2 72 9000 91FF 512 FLASH section 2 73 9200 93FF 512 FLASH section 2 74 9400 95FF 512 FLASH section 2 75 9600 97FF 512 FLASH section 2 76 9800 99FF 512 FLASH section 2 TN 9A00 9BFF 512 FLASH section 2 78 9C00 9DFF 512 FLASH section 2 79 9E00 9FFF 512 FLASH section 2 80 A000 A1FF 512 FLASH section 2 91 A200 A3FF 512 FLASH section 2 82 A400 A5FF 512 FLASH section 2 83 A600 ATFF 512 FLASH section 2 84 A800 A9FF 512 FLASH section 2 85 AA00 ABFF 512 FLASH section 2 86 AC00 ADFF 512 FLASH section 2 87 AE00 AFFF 512 FLASH section 2 88 B000 B1FF 512 FLASH section 2 89 B200 B3FF 512 FLASH section 2 90 B400 B5FF 512 FLASH section 2 8 4 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor 91 B600 B7FF 512 FLASH section 2 92 B800 B9FF 512 FLASH section 2 93 BAOO BBFF 512 FLASH section 2 94 BC00
11. 12 FLASH section 2 20 2800 29FF 512 FLASH section 2 21 2A00 2BFF 512 FLASH section 2 22 2C00 2DFF 512 FLASH section 2 23 2E00 2FEF 512 FLASH section 2 24 3000 31FF 512 FLASH section 2 25 3200 33FF 512 FLASH section 2 26 3400 35FF 512 FLASH section 2 27 3600 37FF 512 FLASH section 2 28 3800 39FF 512 FLASH section 2 29 3A00 3BFF 512 FLASH section 2 30 3C00 3DFF 512 FLASH section 2 31 3E00 3FFF 512 FLASH section 2 32 4000 41FF 512 FLASH section 2 33 4200 43FF 512 FLASH section 2 34 4400 45FF 512 FLASH section 2 39 4600 47FF 512 FLASH section 2 36 4800 49FF 512 FLASH section 2 8 2 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor 37 4A00 4BFF 512 FLASH section 2 38 4C00 4DFF 512 FLASH section 2 39 4E00 4FFF 512 FLASH section 2 40 5000 51FF 512 FLASH section 2 41 5200 53FF 512 FLASH section 2 42 5400 55FF 512 FLASH section 2 43 5600 SIFF 512 FLASH section 2 44 5800 59FF 512 FLASH section 2 45 5A00 5BFF 512 FLASH section 2 46 5C00 5DFF 512 FLASH section 2 47 5E00 5FFF 512 FLASH section 2 48 6000 61FF 512 FLASH section 2 49 6200 63FF 512 FLASH section 2 50 6400 65FF 91 2 FLASH section 2 51 6600 67FF 512 FLASH section 2 52 6800 69FF 512 FLASH section 2 53 6A00 6BFF 512 FLASH section 2 54 6C00 6DFF 512 FLASH section 2 55 6E00 FFF 512 FLASH section 2 56 7000 71FF 512 FLASH section 2 57 7200 73FF 512 FLASH section 2 58 740
12. 12 HCS08 Multilink PE310144 E HCS08 Processor Autodetect v Figure 17 Connection Assistant Window 4 6 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor 5 Make a copy of the NVM sector both NVMO and NVM1 with the production data Select the PEDebug menu select Programming Options and then choose Start Expert Mode Programmer The Programmer Expert window appears as shown in Figure 18 EE PROGO82 Programmer Version 1 01 O xl File Device Program Verify Upload Windows Help mg Z EB ES 5 ee ole a azy cl Joxi C a Blank check module Module C Program Files Metrowerks CodeWarrior CY08_Y 3 0 prog Blank check range NOT ACTIVE 19 File none Erase byte range NOT ACTIVE Base 1080 Y Erase word range NOT ACTIVE Erase module Program bytes Y Program words NOT ACTIVE Program module module S8P Uerify module Uerify range Upload module Upload range Specify S record Show module Return to Debugger Reset chip Secure Deyice Un Secured Yes Verify CRC Checksum Program Trim Value Initializing Recommended Trim 89 Bus Freq 15533KHz Initialized Programming file for the 68HCS908GB60 processor FLASH block Version 1 03 Copyright 2002 by P amp E Microcomputer Systems Inc www pemicro com Done Ready Figure 18 Programmer Expert Window 6 In the Programmer Expert window click on UR Upload Range The Start Address wi
13. 4 F800 FOFF 512 FLASH section 2 125 FA00 FBFF 512 FLASH section 2 126 FCOO FDFF 512 FLASH section 2 127 FEO0 FF1D 286 FLASH section 2 127 FF1E FFAF 146 FLASH section 2 127 FFCO FFFD 62 ISR vectors 31 vectors 25 implemented 127 FFFE FFFF 2 Reset vector address in Bootloader 65535 Must be FFFF for FFFF valid memory map NM No meaning 8 6 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor May be used by Embedded Bootloader 802 15 4 App can reuse this space overwrite Used by Embedded Bootloader Data code which must be located on the specified address and must will exists when the application is running May be used by 802 15 4 App Used by 802 15 4 App Data code which must be located on the specified address If either the Embedded Bootloader and or the 802 15 4 App must not use a particular resource the color from the General HCS08 Map and Usage is kept Cursive fixed register and vectors in flash Bold MUST be located on this particular address DO NOT CHANGE Flash sector 120 127 is block protected and cannot be erased by SW Embedded Bootloader Application RAM 4096 bytes available bytes available not including ISR vectors and Code 4016 reset vector bytes available Read and written by Embedded Bootloader 2 sectors are used NV RAM 1024 so it occupies 1024 bytes flash Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0
14. 802 15 4 Zigbee Embedded Bootloader Reference Manual 802154EBRM D Rev 0 0 09 2004 Laurschwu dy Metoruta 2 freescale semiconductor How to Reach Us USA Europe Locations Not Listed Freescale Semiconductor Literature Distribution Center P O Box 5405 Denver Colorado 80217 1 800 521 6274 or 480 768 2130 Japan Freescale Semiconductor Japan Ltd Technical Information Center 3 20 1 Minami Azabu Minato ku Tokyo 106 8573 Japan 81 3 3440 3569 Asia Pacific Freescale Semiconductor Hong Kong Ltd 2 Dai King Street Tai Po Industrial Estate Tai Po N T Hong Kong 852 26668334 Home Page www freescale com 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 hereunder to design or fabricate any integrated circuits or integrated circuits based on the information in this document Freescale Semiconductor reserves the right to make changes without further notice to any products 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 liability arising out of the application or use of any product or circuit and specifically disclaims any and all liability including without limitation conseguential or incidental damages Typical parameters th
15. GET _DIG528 2 and TARGET_DIG536_2 if defined TARGET_DIG528_2 defined TARGET_DIG536_2 PCB board number for release define EMBEDDED _BOOTLOADER_TARGET 5288536 Setup port as output where signal must be set cleared to indicate safe mode boot define SAFE_MODE_PORT_SETUP PTDDD 0x01 Port D bit 0 Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 6 5 define SET_OUTPUT LEDION Defined in Target h fendif defined TARGET DIG528_2 defined TARGET DIG536_2 6 4 4 HW_Init h This file contains prototypes of all the init functions and defines 6 4 5 HW Init c This file contains some hardware init functions which depend on the PCB layout void HWResetAbel void Reset of MC13192 RF chip do not change void Safe_Boot_Mode_Indicator void Users can change this function so 1t matches the functions available for a particular PCB The function can also be left empty Default is a GPIO pin set low to light an LED void HW_Init The init main function NOTE User can add more functions if required for a particular PCB Do not change the calling sequence 6 4 6 main c This file contains the Embedded Bootloader main function and the Embedded version number void main void It calls the hardware init function and then the Embedded Bootloader state machine The state machine never returns NOTE Dumnmy references are made to the version number s
16. N REN ct RS RR A NY RY NW NS NAF 74 TM HL EIC AA DC UR A DAD CR SR MG A 7 5 Chapter 8 Embedded Bootloader Memory Map coommmmoncccccnccnonnnncnancnononnnnnnanccnnnnnnnnnnnnnannnes 8 1 Appendix A Release Folder and File Structure ccccccsssseeeeeeeeeeeseeeeeeeeeeeeeneeeeneeeeesnneees A 1 A Folder SIC do A 1 A2 Pile A A A A 2 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 reguirements for expensive debug development tools The only reguirement 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 Embedd
17. PIN 1 lt lt 2 define ABEL RESET PIN 1 lt lt 4 HCS08 port setup macros define mSETUP_PORT_A PTAPE 0x3C 6 4 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor PTADD 0x00 A11 Port A input define mSETUP_PORT_B PTBD 0x00 M PTBPE 0x00 PTBDD 0x00 define mSETUP_PORT_C PTCDD ABEL RESET PIN ABEL ATT PIN Optional for Safe Mode Boot indicator function LEDs as output fdefine mSETUP_PORT_D PTDPE 0x00 PTDDD 0x01 0x02 0x08 0x10 6 4 2 Reset_Vector c The system reset vector NOTE The application does not have a reset vector If a reset occurs in an application the Embedded Bootloader s reset vector is called 6 4 3 Embedded_Bootloader_Target h Users must define the following defines in the Embedded_Boot loader_Target h to achieve a successful port Version number of the build Version number update Big change interface main code structure new feature Y xx increment Y Smaller change function code structure bug fix x Yx increment Y Small change bug fix x xY increment Y define EMBEDDED_BOOTLOADER_VERSION 5 01 Number used with all PCB Targets NOTE Use caution if the version number is changed You should only change the PCB board number define EMBEDDED_BOOTLOADER_TARGET to indicate a special PCB version Example for the TAR
18. T on COM2 SCI2 Short pins 2 3 on COM1 SCI y COM SCI2 AX 0308 Ver 5 01 RS232 UART on COMI SCI1 USB SCI2 Short pins 2 3 on COM1 port SCI1 528 amp 536 Ver 5 01 RS232 UART on COM1 SCI1 Short pins 2 3 on COM1 port SCI1 528 amp 536 Ver 5 01 RS232 UART USB on COMI SCI y RS232 UART USB on COM SCI2 Short pins 2 3 on COM1 SCI1 COM SCI2 RDOI Ver 5 01 NOTE The generic RDO1 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 1 2 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor 1 2 Features The following features are supported 1 3 1 4 Upload firmware 802 15 4 Zigbee application in Motorola S19 record format through UART USB The S1 data record length must be set to 32 bytes Auto Detection of the PC communication interface see Section 1 1 1 Ported Targets Initialize memory including stack of uploaded firmware Initialize the system clock Self clocked mode and MC13192 clock setup Power save mode supported Run time update change of the NVM NOTE See the Freescale 802 15 4 MAC PHY Software Reference Manual 802154MPSRM D for a detailed desc
19. _w Embedded Bootloader ach file for proper functionality 6 1 3 HCS08 LibMaker The delivered libraries were made with the following libmaker Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 6 1 Source file hw_hc08 libmaker dll version 5 0 8 0 Setting None 6 2 Product Deliverables The Freescale Embedded Bootloaader consists of four major components Refer to Appendix A fora complete list of released files 6 2 1 Embedded_Bootloader mcp This is the Metrowerks Codewarrior mcp project file This file is used to build the release of the Embedded Bootloader NOTE It is required that you have Metrowerks Codewarrior installed on your PC to build the Embedded Bootloader 6 2 2 HCS08_Flash_Lib Lib The library contains functions to write to the internal flash of the HCS08 MCU The library also contains functions to handle NVM run time updates The flash library version number is found by searching for the ASCII text string HCS08 Flash Lib in the HCS08_Flash Lib Lib The version number is only available from flash library version 5 00 NOTE The HCSO_Flash_Lib Lib can also be included directly in an application for run time update of NVM Refer to the HCSO8 Flash Application Note AN2770 D for more information 6 2 3 Embedded_ Bootloader_Functionality_Lib Lib The library contains the internal functionality of the Embedded Bootloader For example the state machine which handles the firmwa
20. are Reference Manual 802154MPSRM D 2 Zigbee hlp see Test Tool installation directory Ahelp 3 Freescale MC908HCS08GB60 GT60 MCU Data Sheet MC9S08GB60 D 4 Freescale Application Note Handling MAC Address Erasure AN2825 D 5 Freescale Application Note Zigbee 802 15 4 Evaluation Kit Quick Start Guide AN2772 D 6 Freescale Embedded Bootloader User s Guide MC13192FLUG D 7 Freescale Switch Demo Application AN2773 D Revision History 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 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
21. 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 NOTE This file can also be used with the MC908HCS08GT60 MCU 5 3 3 Crt0 c and Crt h These files contain the basic initialization code basic system clock memory and stack setup The normal basic init file s like the start08 c from Metrowerks is not needed when the Embedded Bootloader is embedded In an 802 15 4 Zigbee application with Embedded Bootloader these files only contain the _ startupdata structure The Embedded Bootloader handles all the basic initialization memory and stack setup of the application That is the application s main function will be the first item called entry point NOTE Do not include basic initialization memory and stack setup when building an application with the Embedded Bootloader Place any necessary initialization function calls in the main function Whatever the initialization function or only the _ startupdata structure is included is controlled by compiler defines See Section 5 2 1 Compiler Defines Application for more i
22. 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 e 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 e Skip firmware checksum verification o Disabled A checksum verification of the S19 file data record is performed default 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 1 4 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor Chapter 2 Using the Embedded Bootloader 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
23. at 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 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 of others Freescale Semiconductor products are not designed intended or authorized for use as components in systems intended for surgical implant into the body or other applications intended to support or sustain life or for any other application in which the failure of the Freescale Semiconductor product could create a situation where personal injury or death may occur Should Buyer purchase or use Freescale Semiconductor products for any such unintended or unauthorized application Buyer shall indemnify and hold Freescale Semiconductor and its officers employees subsidiaries affiliates and distributors harmless against all claims costs damages and expenses and reasonable attorney fees arising out of directly or indirectly any claim of personal injury or death associated with such unintended or unauthorized use even if such claim alleges that Freescale Semiconductor was negligent regarding the design or manufacture of the part Learn More For more information about Freescale products please visit www freescale com Freescale and the Freescale logo a
24. bar begins to indicate upload progress Upload Application Upload Button Progress Field Files Fii Test Tool Embedded Bootloader Ernbedded Bootloader ZigBee CO 12 19200 Status Error Information Field Figure 5 Firmware Upload The Status Error Information Field shows the Status Error Information received from the Embedded Bootloader 3 4 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor After a successful upload of the firmware the window appears as shown in Figure 6 NOTE A system reset is performed default after upload as shown in Figure 6 Automatic Reset Enabled El Test Tool Embedded Bootloader Embedded Bootloader ZigBee COM2 19200 lt emo_w_ FreeLoader_104 Demo_w_FreeLoader_104_11 EVK_PTC Demo_w_FreeLoader_104_16_78_19200 EVK_PTQ_Demo_w_FreeLoader_anden_clock Demo_w_FreeLoader_chk_fejl_0 11BF Demo_w_FreeLoader_chk_fejl_0x380B Figure 6 After a Successful Firmware Upload NOTE If the uploaded application uses another baud rate it is required to change baud rate values in order to be able to communicate with the board Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 3 5 3 1 4 Using the Help Menu Click on the Embedded Bootloader About box to see the Embedded Bootloader sub version number About Embedded Bootloader boa Embedded Bootloader Version 5 00 Copyright C 2004 FS EB 5284536 Ve
25. d 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 gt Freescale_Copyright 0 0x00 NV_RAMO 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 Do something to aviod that code is removed by linker 5 2 3 System Clock Setup The Embedded Bootloader contains th
26. e Embedded Bootloader flash programming tool must be called with parameters Execute Bootloader exe without parameters to show a parameter list WINDOWS system32 cmd exe C Program Files Freescale Test Tool si gt Boot loader Embedded Bootloader version 5 600 Copyright lt C gt 2004 Downloads a 19 Application file down into a ZigBee Device Bootloader drive ll pathlfilename C lcomport11 BL lbaudrate ZE 7A 70 S drive path filename Specifies drive directory and or file to download C Use specified comport default COM1 gt comport COM1 COM2 COM256 B Use specified baudrate default 19200 gt baudrate 75 118 134 150 306 600 1206 1808 2400 4800 7200 9600 14400 19200 384080 57600 115200 128000 or 230400 ZE Skip flash erase This is the default Use E to erase flash before download 0 Erase production data get production data from firmware file gt This is the default Use 0 to NOT erase NU RAM data when updating firmware A Do not reset after upload This is the default automatic reset boot after firmware download Use A to do 8 Skip firmware checksum verification This is the default Use S to Calculate and compare checksum when updating firmware C Program Files Freescale Test Tool s1 gt _ Figure 9 Command Line Version Parameter List 3 8 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor 3 2 1 No
27. e 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 3 Application 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
28. e the NVM data from an application code 1 The Embedded Bootloader must be present on the board NOTE All EVBs are shipped with the Embedded Bootloader pre programmed in flash The Embedded Bootloader can only be erased programmed with a BDM debugger 2 Call the Update NV_ RAM function This function can change any NVM data 2 2 1 An Example of How to Change the MAC Address The following code shows an example of how to change the MAC address Update_NV_RAM amp NV_RAM_ptr gt MAC_Address 0 amp pPacket DATA INDEX 8 NOTE pPacket contains the new MAC address Any NVM data can in code be read as a normal construct For example use the NV_RAM ptr to get access to individual data Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 2 3 2 3 System Bus Frequency 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 75 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 e MC13192 CLKO 62 5 KHz e 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 applica
29. ed 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 reguired to build an 802 15 4 Zigbee Application with the Embedded Bootloader Chapter 6 Port Integration Reference Guide This chapter describes the deliverables reguired and how to integrate them to make an executable Embedded Bootloader for a specific PCB Chapter 7 Embedded Bootloader Public 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 e Courier monospaced type indicates commands command parameters code examples expressions data ty
30. ent menu then click on Set Target The Set Target window appears as shown in Figure 12 Set Target ES Processor JHCso8 y DK Target Interface P amp E Target Interface This Target Interface supports following hardware P amp E CYCLONE Interface P amp E MLILTILINK Cable PRE POWEROS Interface P amp E class to class VII target hardware types zj Help Figure 12 Set Target Window 3 In the Processor drop down menu select HCS08 From the Target Interface drop down menu select P amp E Target Interface the click on the OK button Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 4 1 The Connection Assistant window appears where you can select the debugger interface connection As shown in Figure 13 a USB connection was chosen and the HCS08 was selected as the CPU type Click the OK button ME Connection Assistant USB1 P amp E HCS12 HCS08 Multilink PE310144 E HCS08 Processor Autodetect v Figure 13 Connection Assistant Window 4 2 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor 4 Click on Load Application under the File menu to open the Load Executable File window Specify application file to program in the Load Executable File window as shown in Figure 14 Select Motorola S Record s19 using the Files of type drop down menu Navigate to t
31. escale Zigbee 802 15 4 web page for new or updated applications Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 3 1 3 1 Graphical User Interface GUI Version To use the GUI version of the Test Tool execute the following file installation directory Freescale Test Tool Test Tool exe 3 1 1 Using the Tools Menu Option 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 Chapter 2 for more information Use the Add buttons Click Close Tools Menu Baud Selection 7 Buttons Add Buttons Close Button ii Test Tool File View Tools Window Help Type ZigBee COM2 19200 10000 ZigBee Device ZigBee COME 19200 10001 ZigBee Device Figure 3 Tools Menu Selection 3 2 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor 3 1 2 Using the View Menu Option After clicking the View menu option select port COMx and click OK Choose the baud rate specified for the current embedded application See the Zigbee 802 15 4 Evaluation Ki
32. he folder where a copy of the Embedded Bootloader is located Select the Embedded Bootloader s19 file and click the Open button Load Executable File x Look in DIG 528 2_DIG 536 2 emcee Embedded_Bootloader s19 Filename Embedded _Bootloader s19 Files of type Motorola S Record s y Cancel Load Options Load Code Symbols Load Symbols only Load Code only Code Verification Options None O First bytes only Allbytes Read back only Figure 14 Load Executable Window Z Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 4 3 The Embedded Bootloader is now programmed to the PCB as shown in the Status Window in Figure 15 E CPROGO8Z Programmer Version 1 01 Status Window hiper pemicro com Copyright 1999 2002 P amp E Microcomputer Systems INC CMD gt RE Initializing Target has been RESET and is active CMD gt CM C Program Files Metrowerks CodeWarrior CW08_ V3 0 prog P amp E 9S08GB60 S8P Initializing Recommended Trim 89 Bus Freg 15533KHz Initialized Programming file for the 68HCS908GB60 processor FLASH block Version 1 03 Copyright 2002 by P E Microcomputer Systems Inc Running programming script Figure 15 Status Window www pemicro com 5 Remove power and disconnect the BDM cable from the PCB Next power up the PCB The PCB is now ready to upload an application See Chapter 2 for details about how to u
33. hem to make an executable Embedded Bootloader for a specific PCB NOTE For user convenience several readme txt files containing more information are located in various subfolders 6 1 Embedded Bootloader Build Environment This chapter describes the Embedded Bootloader build environment The Embedded Bootloader application is built under the Metrowerks IDE Code Warrior Development Studio for Freescale HCOS 3 0 build 030506 6 1 1 HCS08 Compiler All Embedded Bootloader source files are compiled with the following compiler and with the Generate Code for HCS08 Code Generation option enabled Source file hw_hc08_compiler dll version 5 0 8 0 Setting Cs08 CswMaxLF0 CswMinLFO CswMinSLB9999 Lasm n lst Lasmc h Ot Ou Onf OnB alr OnCstVar OnPMNC Or TEluE WmsgNu racdet 6 1 2 HCS08 Linker All Embedded Bootloader object files are linked with the following linker to build an executable file Source file hw_hc08 linker dll version 5 0 8 0 Setting B EnvSRECORD s19 EnvTEXTPATH Zigbee_Data Zigbee_Debug WStdoutOn The Embedded Bootlaoder MUST be linked with the following linker file Embedded_Boot loader prm Embedded_Boot loader_HCS08 ach Specific allocated code and variables must not be reallocated but users can add new code and data segments NOTE The 802 15 4 and Zigbee applications that interface to the Embedded Bootloader must be linked with the Ptc
34. ication The Embedded Bootloader can use the information in NV memory but it has default values safe mode boot to cover scenarios where no NV memory is available that is the Embedded Bootloader would be locked to use the default values 5 3 6 ISR_Vectors c The Embedded Bootloader redirects the ISR vector table to 0x0EFCO i e the 802 15 4 Zigbee application ISR vector table must be locate at OxOEFCO to 0xEFFD see linker file The file also contains a reset vector The reset vector is not used defined out when using the Embedded Bootloader The system reset vector is in the Embedded Bootloader address space 0xFFFE The Embedded Bootloader has two system variables located where the redirected reset vector is locate at OxEFFE to 0xEFFF The variables control the startup of the Embedded Bootloader Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 5 5 5 3 7 Dummylsr c This file contains a dummy ISR function which makes a break if a BDM debugger is attached to the BDM connector An illegal instruction reset occurs ifno BDM debugger is attached The function is added to all unused ISR vectors in the ISR_Vector c file NOTE Users can change this function to any desired functionality 5 6 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor Chapter 6 Port Integration Reference Guide This chapter describes the Embedded Bootloader source code release deliverables and how to integrate t
35. ined C data types Embedded Bootloader h New interface file to Embedded Bootloader after version 5 00 FreeLoader inf h Embedded Bootloader interface file Freeloader before version 5 00 FunctionalityDefines h Gb60 io h Register mapping for HCS08 hwdrv_hcs08 h MacPhy h NV_Data h NVM data structure NwkMacInterface h Phy_Spi h PhyMacMsg h PublicConst h Target h PCB target definition VO mapping A 2 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor AEmbedded_BootloaderABinXAEmbedded_BootloaderAAX 0308Revc Embedded Bootloader elf Elf format file Embedded Bootloader map Map file Embedded Bootloader s19 Freescale S19 file Embedded_Boot loader Bin Embedded_Boot loader DIG 528 2_DIG 536 2 Embedded Bootloader elf Elf format file Embedded Bootloader map Map file Embedded Bootloader s19 Freescale S19 file Embedded_Boot loader Bin Embedded_Bootloader_Functionality_Lib Embedded Bootloader Functionality_Lib Lib Functionality library Embedded_Boot loader Bin HCS08_Flash_Lib HCS08 Flash Lib Lib HCS08 flash library Embedded_Boot loader prm Embedded Bootloader HCS08 ach HCS08 GT60 GB60 linker file Embedded_Bootloader sources Embedded Bootloader Target h HW Init c HW Init h Reset_Vector c main c Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 A 3 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor
36. ls The value is inverted To enable the bit mask option the setting must be set to 0 To disable the bit mask option the setting must be set to 1 Use firmware_state control if Embedded Bootloader or the application must be started To enable download the setting must be DO_ UPDATE FIRMWARE Embedded Bootloader boot flag define EXECUTE_APPLICATION uint8_t 0x55 define DO UPDATE FIRMWARE uint8_t 0x00 define FLASH EMPTY uint8_t OxFF Output True Ready for reset False Something went wrong in changing the state 7 2 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor 7 1 2 Hard_Reset Prototype void Hard_Reset void Description The application can call this function to make a system reset The reset is done by executing an illegal instruction Input None Output None 7 1 3 Update_NV_RAM Prototype bool_t Update_NV_RAM NV_RAM_Struct_t const NV_RAM Distination ptr uint8_t Source_ptr uint16_t Source_Length Description The application can call this function to update any NVM parameter with new values specified in the input parameters There is no validation of input parameters NOTE NVM can in code be read as a normal construct Input NV_RAM Distination_ptr A pointer to current NV RAM data ex The MAC address which must be changed Source_ptr A pointer to new NVM data which must be stored Source_Length The length number of bytes of the ne
37. munication interface can be any of the two SCI ports SCI1 or SCI2 When called with the proper parameters the Embedded Bootloader knows the active communication interface Input data_reg address the address of the active SCI port data register SCI1 0x1F or SCI2 0x27 status reg address the address of the active SCI port status 1 register SCI1 0x1C or SCI2 0x24 Output None Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 7 5 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor Chapter 8 Embedded Bootloader Memory Map Table 1 512 Bytes in a physical flash sector Zigbee MC9S08GB60 GT60 802 15 4 Embedded Bootloader Memory Map Sector Number Address in hex start Address in hex end sector erase address Freescale Semiconductor Size in bytes Embedded Bootloader Reference Manual Rev 0 0 General HCS08 Map and Usage Embedded Bootloader Map Direct Port Registers Direct Addressing RAM Fast memory Sleep variable gSegPowerSaveMode Embedded Bootloader stack Unint RAM for init structure 8 1 High Page Registers COP Flash etc 12 182C 19FF 468 FLASH section 2 13 1A00 1BFF 512 FLASH section 2 14 1C00 1DFF 512 FLASH section 2 15 1E00 1FFF 512 FLASH section 2 16 2000 21FF 512 FLASH section 2 1 2200 23FF 512 FLASH section 2 18 2400 25FF 512 FLASH section 2 19 2600 27FF 5
38. ndow appears as shown in Figure 19 Here you specify the start address for the NVM section Click the OK button For NVMO use 0x152F and for NVM1 use 0x172F Start Address jisai Cancel Figure 19 Start Address Window 7 In the End Address window which looks very similar to the Start Address window specify the end address for the NVM section and then click the OK button For NVMO use 0x155B and for NVMI use 0x175B Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 4 7 8 As shown in Figure 20 use the S19 window to specify which S19 file to store active NVM data to and then click the OK button For NVMO use PD_ NVMO0 s19 and for NVM1 use PD NVMl s19 519 File CtmpsPD_NVMO s19 Cancel Figure 20 S19 File Window 9 Close Programmer Expert window 10 Use the PC tool Production Data Converter exe to convert the production data in NVM to default NVM sector NVMO Copy the Production Data Converter exe tool to the folder that contains the PD_NVMO0 s19 and PD NVM1 s19 files Execute the Production Data Converter exe The output is an PD NVM s19 file containing the production data from the active NVM sector NOTE The Production _Data_Converter exe tool can be found in the EVK release EVK 3 0B in folder source Zigbee EVK EVK_Common CPROG Tool Scripts 11 Click on Load Application under the File menu to open
39. nformation 5 4 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor 5 3 4 Embedded Bootloader h and Embedded_Bootloader c These are the interface files for the 802 14 4 Zigbee application They contain function pointers to functions accessible in the Embedded Bootloader These files also contain absolute addresses which should not be changed Ensure that the two Embedded Bootloader control flags which control whether the 802 15 4 Zigbee application starts or not are included in the 802 15 4 Zigbee application build See Section 5 2 2 for more details pragma CONST_SEG APP_BOOTLOADER_FLAGS Default setting for how BootLoader downloads firmware const uint8_t boot_loader_control ALL BIT ENABLED const uint8_t boot_loader_flag EXECUTE_APPLICATION pragma CONST_SEG DEFAULT The 802 15 4 Zigbee application must also call the void BootLoader Interface Init void function to set up pointers to the Embedded Bootloader accessible function The function must be called once during system initialization NOTE In earlier versions these files were titled FreeLoader inf c and FreeLoader inf h Do not user the FreeLoader inf c and FreeLoader inf h files with the Embedded Bootloader 5 3 5 NV_ Data c and NV_Data h The NVM is not a part of the Embedded Bootloader However it is advised to make the NVM a part of the 802 15 4 Zigbee appl
40. occoocnnonononononoconnonnncnnnnnnn nono RHYN RY Hn YY Hn Dn no 4 1 4 2 Upgrading The Embedded Bootloader ooonocinocinocanococonoconoconoconoconnnnnncnnnonan oran nono NR NND ND NF nn 4 5 Chapter 5 Application Integration Reference Guide 999 42 eennnnnnnnnnn 5 1 5 1 Product Deliverables oia cad 5 1 5 1 1 Embedded Bootloader Imagen a e i E i e eE EE EEA EEE E E EETA 5 1 5 1 2 Application support Fleitas 5 1 313 Application Linker File uii na A EA O T a EA 5 2 5 2 Application 5 2 5 2 Compiler Dele a in io Di 5 2 52 2 Unreferenced Symbol uta a dt da Y FY YNG YW YL A 5 2 5 2 3 System Clock Setup ee ladito is GYD ees dada EEE Y Y FFA 5 3 53 Application Support Eil amp S cecucen veers ssnadeastes AAA dedicas 5 3 5 3 1 DI TON dd NG Y Fd NU AR 5 3 3 3 2 OU Mi a CF EL GU GNU RC FYNU lies 5 3 5 33 CrO cand Crte a cn dy aras 5 4 5 3 4 Embedded Bootloader h and Embedded Bootloader c ooooonooccnocncoonoocononnoonnconnonnncon YY RR A nu 5 5 5 3 5 NV Dat c and NV Data succionar EY FFY TA FA WYF DWF WWF ie dad 5 5 93 0 A O o AN RNA 5 5 5 3 1 Dammmylsni Ces ee AU WG es seen hb sta yy EFA a e GC WD ib 5 6 Chapter 6 Port Integration Reference Guide ooocconnnnnnnncccccncconnnnnnncnencnnnnnnnnannncnrnrennnnnnnannnes 6 1 6 1 Embedded Bootloader Build Environment uu aii A A 6 1 6 1 HESOS Compiler uen ad ti dn DYA 6 1 Ch YO O TE Te a a AS OG oa ica 6 1 6 434 THOSOS Lib Mak teatral tig lali 6 1
41. onoconoconoconoconocannnnanonanoon NHY Y Hn HR Hn no 2 3 2 3 System Bus HTEQUCNCY sees ce a o a nta oodd US 2 4 2 4 UART Baud Rate rarene e Y OS 2 4 Chapter 3 Test Tool Zigbee Flash TOOl nnnnssnunnsnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 3 1 3 1 Graphical User Interface GUI Versionn ccccesccesscessceseceeeeceseceseceeeeeeeeeeeeeeseeeeeeseseseseeeaeeceeenaees 3 2 3 1 1 Using the Tools Menu Option ccecccecccesssesssecsseessecssecssecnsecesecsseeeeeeeeeeeeeeceeeeaeecsaeseeeeeeesaeenaees 3 2 321 2 Using the View Menu Options enn Y a DG YW EF da ede veo as 3 3 3 1 3 Selecting the Firmware File to Upload coonocnnccnocococaconnnonnnconoconnconnonononnnonnn nono nono YNYR NND Fn FYNN 3 4 3 14 Using the Help MENU izciesccecccstect tik eves WEI A als aia aaa ctv YY YF dw Ma 3 6 3 1 5 Changing the NVM Data in Flash or File ooooonocnnncnicccnoncconnconnconnononoconoconoconocnnonanonanrnnnrrnnnrannnannnos 3 6 3 2 Command Line Version CMD sesia a E a ee a aAA Seep o ES Ra r EE ee ESE 3 8 Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 iii 3 2 1 Normal Use Example Default ooooonnninoninnnnnnononnconncnonnnoncnoncconnono nono YNA YNAD YN cnn E NND NND EFE 3 9 322 Flash Erase Disabled Example ia YI FT FF FFAGL yd 3 9 Chapter 4 Embedded Bootloader ProgrammMinQ connnnnnccccnncnnnnancncnnnononannnnnaccnnnnnnnnnnnnaannnes 4 1 4 1 Programming To An Empty Erased Board oooooocnc
42. pes and directives e Italic type indicates replaceable command parameters e 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 amp 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 amp E HCS08 debugger GUI CPROG P amp E HCS0S 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 References 1 Freescale 802 15 4 MAC PHY Softw
43. plication 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 4 Power up again All LEDs are off Wait until LED1 goes on lt 1 second 6 Power off the board 2 2 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor 7 Remove short from UART TX and RX and connect UART cable again if the RS232 UART interface is used 8 Power up again 9 Embedded Bootloader is ready to receive new firmware all LEDs on 10 Start the PC Tool See Chapter 3 for more information NOTE The Safe Mode Boot description is only valid for the Freescale ported versions of the Embedded Bootloader Refer to the 802 15 4 Embedded Bootloader Reference Manual 802154EBRM D for more details about a specific port of the Embedded Bootloader 2 2 Updating Non volatile Memory NVM The following steps show how to updat
44. pload an application 4 4 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor 4 2 Upgrading The Embedded Bootloader This section describes how to upgrade the Embedded Bootloader to a newer version with the P amp E Multilink BDM debugger 1 Execute the HIWAVE EXE file from your chosen installation directory For example installation directory Metrowerks CodeWarrior CW08_V3 0 Prog 2 From the main window setup the target by selecting Setup Target the select the Component menu and click on Set Target The Set Target window appears as shown in Figure 16 Set Target x Processor HCSO8 y OK Target Interface P amp E Target Interface y This Target Interface supports following hardware P amp E CYCLONE Interface P amp E MULTILINK Cable PRE POWEROS Interface PRE class to class VII target hardware types te Figure 16 Set Target Window 3 From the Processor drop down menu select HCS08 From the Target Interface drop down menu select P amp E Target Interface then click the OK button Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 4 5 4 The Connection Assistant window appears where you can select the debugger interface connection As shown in Figure 17 a USB connection was chosen and the HCS08 was selected as the CPU type Click the OK button EN Connection Assistant USB1 P amp E HCS
45. ptr_t Update_NV_RAM extern ICG_Setup_ptr_t FL_ICG_Setup extern UART_Port_Select_ptr_t UART_Port_Select 7 1 1 Enable_Download_Firmware Prototype bool_t Enable _Download_Firmware uint8_t interface_state uint8_t firmware_state Description The application must call this function to make the system ready for a new firmware download The application must provide a way for the user to interact with the system to call this function Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 7 1 NOTE All bits are enabled by default Bits can only be disabled erased in flash never enabled The bits are enabled again by the new firmware Input interface_stat The user selectable options The below values should be OR ed together Embedded Bootloader control flags fdefine NO_BIT_ENABLED uint8_t 0x00 Option Skip flash erase define ERASE_FLASH uint8_t 0x01 Option Do not reset after upload define BOOT_AFTER_DOWNLOAD uint8_t 0x02 Option Erase production data define KEEP_NV_RAM uint8_t 0x04 Option Skip firmware checksum verification fdefine PERFORM FLASH VERIFICATION uint8_t 0x08 NOTE The Embedded Bootloader control flags correspond to the optional firmware upload settings which can be disabled enabled in the Zigbee Flash Tool See Section 1 4 1 Embedded Bootloader Description for detai
46. r 5 01 Build Sep 22 2004 09 38 40 Figure 7 Embedded Bootloader Tool Version NOTE The last line is reported from the Embedded Bootloader on the PCB This version number is only sent to the PC from power up not on reset 3 1 5 Changing the NVM Data in Flash or File If users click on an application in the list it displays the NVM values in the selected application file If the uploaded application supports NVM dump it is possible to read the NVM from the board The NVM data can be changed in two different ways 1 Ifthe uploaded application does not support NVM data editing it is possible to edit the NVM data in the application file before it is uploaded to the board and save it back in the application file for later upload 2 Ifthe uploaded application does support NVM data editing it is possible to edit the NVM data after the board has been uploaded with the application For example the file contains default values The Freescale EVK PTC application supports this feature NOTE No production specific information is available in this example window Use caution when editing the clock related configuration values The values must match each other There is no sanity check on the user entered values though there is a check on length See the MC908HCSO8GB60 GT60 MCU Data Sheet MC9S08GB60 D about how to specify valid register values for the HCSO8 3 6 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor F
47. re download the UART drivers checksum verification functions and others The Embedded Bootloader functionality library version number is found by searching for the ASCII text string EB Func Lib in the Embedded Bootloader Functionality_Lib Lib file 6 2 4 Source Files This section provides a brief description of the source files Refer to Appendix A for more details The source files described are those which define the PCB interface For example the I O mapping that connects the MCU and RF chip Embedded Bootloader Target h Specific Embedded Bootloader defines For example the Embedded Bootloader version number 6 2 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor HW_ Init c Hardware init functions HW _ Init h Init function prototypes and defines Reset_Vector c System reset vector main c Embedded Bootloader main function 6 3 Porting to a Specific Target This section provides guidelines on how to port the Embedded Bootloader to a specific PCB target 6 3 1 Code and Data Segments The Embedded Bootloader must be linked with the linker file as specified in Section 6 1 2 Several code and data segments are listed and must not be changed Refer to the map file as described in Chapter 8 for more details 6 3 2 Standard Libraries The Embedded Bootloader must include the ansiis 1ib from Metrowerks for a successful build The library is part of the Metrowerks Code Warrior installation and is located
48. re trademarks of Freescale Semiconductor Inc All other product or service names are the property of their respective owners Freescale Semiconductor Inc 2004 All rights reserved Contents About This BOOK RO ie oie eee ee ee ee FF ee DF a vi yit hia E ERASE O E vi OrganizatiOnt id GWY Y Gy nU vi Conventions eser Gu Y ud O Y Rs vii Definitions Acronyms and Abbreviations cccccccccsscesscessecessceeecseceeeseeeseceseeeseecseeceseecseecssecaueenaeenseeeaeen vil RO OC ts A Edi a ER viii Revision Hist0ryn ui TE Dnd viii Chapter 1 Embedded Bootloader Description cccscssseeeeeeeeneeeeeeeeeeeeneeeeeeeeeeeeeneeeenenees 1 1 1 1 AA Y A A dec hated ta daa eed A tds 1 1 Ill Ported TAS se edn eg AS AE Cok A SA EA AAA AR AA EE A 1 2 1 2 Features A A OS 1 3 1 3 BOS A A donan FODD FF 1 3 1 4 Potential Su ii a WG NT ae 1 3 1 4 1 Optional Firmware Upload Settings oooooinoninncnoocononanonnnonnonn nono nono nono YNI nooo nono noconoco nono YN DD ND ND NND 1 4 Chapter 2 Using the Embedded Bootloader oooooomnnnnncccconnnncanaccccncncnnnnnnannancnnnnnnnnnnnnaannnes 2 1 2 1 Upload Firmware ives dd A A E ALA dee AO Y EA 2 1 o AA E i OF I 2 1 2 2 SSC Case EW sui a Aenean ease ee E da YN 2 2 2 1 3 Safe Mode Botti A a TY FU O 2 2 2 2 Updating Non volatile Memory NVM c ccccccccceesseesseeseeeseecseeeeseeeseeeseecssecsaeceseceaeenseeneaeseseeeaeens 2 3 2 2 1 An Example of How to Change the MAC Address oooooocccocon
49. reescale Semiconductor Flash_File_1 xi System Configuration Information Copyright Firmware Label MAC Version PHY Version Target Version Bootloader Version NVM RAM Version MCU Manufacture MCU Version 00001 0x00 0x02 Clock Related Configuration Values System Bus Frequency 0x1 0 Abel Clock Out Setting 0 3645 Abel HF Calibration 0 8274 IDC Module ICGC1 ICGC2 Self Clocked Filter Value ICGFLTU 0x02 ICGFLTL 0x40 lt UART Baud Rate SCI1BDH SCIIBDL Joxo0 ox34 4 Load from NV RAM Save to NV RAM c Copyright 2004 Freescale Inc All rights reserved DB Label MOGOLLON TAPEATS D18 Ver 1 01 MAC FFDDP Ver 1 01 Build Jun 28 2004 19 33 49 PHY OO Ver 1 01 Build Jun 28 2004 19 33 06 PTC Demo Ver 0 99 Build Jul 01 2004 11 21 18 i Cancel Application Specific Section gt gt MAC Address amp Functional Values MAC Address O FFFFFFFFFFFFFFFF Antenna Select fox00 Sleep Mode Enable Joxo0 Production Specific Information O FFFFFFFFFFFFFFFFFFFF Hw Name Revision Serial Number Production Site OXFFFF Contry Code JOxFF Production Week Code JOxFF a JOxFF Load from File Save to File Production Year Code Figure 8 System Configuration Window Embedded Bootloader Reference Manual Rev 0 0 3 7 3 2 Command Line Version CMD The command line version ofth
50. ription on NVM layout and values Benefits Users do not have to buy expensive third party debug development tools to get started Users can update the 802 15 4 Zigbee application firmware without having to build in additional code for interfacing to the Embedded Bootloader See Section 2 1 3 Safe Mode Boot Application firmware can be updated after production by users However this requires that the final product has a communication interface UART USB Users can update the 802 15 4 Zigbee application firmware even when it is malfunctioning See Section 2 1 3 Safe Mode Boot The 802 15 4 Zigbee application firmware does not have to include initializing or flash programming code and can thereby minimize code size Can update any NVM data specified by the 802 15 4 Zigbee application Potential Issues Uses 4 KB of flash 6 7 on a MC908HCS08GB60 GT60 and 93 bytes of RAM 2 3 on a MC908HCS08GB60 GT60 Extended power boot up time 17ms because the Embedded Bootloader must detect the presence of an application Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 1 3 1 4 1 Optional Firmware Upload Settings e Skip flash erase 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 e Frase production data get production data from firmware file o Disabled The production data section with MAC address in NVM
51. rmal Use Example Default Normal use example default Bootloader EVK_PTC_Demo s19 C COM2 B 19200 E A O S ca Select CA WINDOWS system32 cmd exe C Program Files Freescale Test Tool si gt Bootloader EUK_PTC_Demo s19 C COM2 B mm 19266 E an 7 0 7 Downloading EUK_PTC_ Demo s19 on COM2 19200 Upload progress 100z FreeLoader started successfully Flash erased C Program Files Freescale Test Tool si gt _ Figure 10 Command Line Version Using Several Options NOTE It is not possible to edit NVM data with the CMD version 3 2 2 Flash Erase Disabled Example Flash erase disabled example Bootloader EVK_ PTC Demo s19 C COM2 B 19200 E A O S ESCAWINDOWS systemaz emdene a C Program Files Freescale Test Tool si gt Boot loader EVK_PTC_Demo si C COM2 B mm 19200 ZE f 7 0 7 S Downloading EVK_PTC_Demo si9 on COM2 19200 Upload progress 99 FreeLoader started successfully Flash was not erased Firmware download failed mismatch found on address BxEFFE 19 Data Transfer failed Press any key to continue C Program FilesNFreescaleNIest ToolNs19 gt Figure 11 Command Line Version Flash Erase Disable Option NOTE The flash is not erased and a flash programming error is detected at address 0xEFFE This is the address of the Embedded Bootloader control flags which was not erased The error message is expected Freescale Semiconductor Embedded Bootloader
52. t Quick Start Guide AN2772 D for a description of what to do for a specific application If no application is uploaded you must use the default settings specified for the Embedded Bootloader See Chapter 2 for more information NOTE If the USB interface is used the USB option appears as a new COM port a EVK_PTC_Demo_w_FreeLoader_104 EVK_PTC_Demo w_FreeLoader_1 04_115200 EVK_PTC_Demo_w_FreeLoader_104_14_24 19200 EVK_PTC_Demo_w_FreeLoader_104_16_78_19200 EVK_PTC_Demo_w_FreeLoader_anden_clock EWK_PTC_Demo_w_FreeLoader_chk_fejl_0x11BF EWK_PTC_Demo_w_FreeLoader_chk_fejl_0x380B EWK_PTC_Demo_w_FreelLoader_chk_fejl_NWM EVK_PTC_Demo_w_FreeLoader_with_prod_data EVK_Switch_Demo_w_Fre EVK_Switch_Demo_w_FreeLoader_104 EVK_Switch_Demo_w_FreeLoader_104_max_power PTC_Demo PTC Demo Select Device SARD_Accelerometer_V2 SARD_Accelerometer_W2 SMAC_Accelerometer_V2_test_update_version ZigBee COM2 19200 ZigBee Device Switch_Demo ZigBee COME 19200 1 ZigBee Device Switch_Demo ZigBee COMS 19200 ZigBee Device ZigBee COME 115200 ZigBee Device ZigBee COME 115200 A ZigBee Device ZigBee COM2 115200 ZigBee Device Figure 4 View Menu Option Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 3 3 3 1 3 Selecting the Firmware File to Upload In the Flash Section window click on the application file to upload and then click on the Upload button The upload progress
53. the Load Executable File window Specify the application file to program using the Load Executable window as shown in Figure 21 Select the Motorola S Record s19 under Files of type then navigate to the folder where a copy of the Embedded Bootloader is located Select the Embedded Bootloader s19 file and click the Open button Load Executable File kl xi Look in DIG 528 2_DIG 536 2 e c EZ Embedded_Bootloader s19 File name Embedded_8 ootloader s19 Files of type Motorola S Record s y Cancel Load Options Load Code Symbols Load Symbols only Load Code only Code Verification Options None First bytes only Allbytes Read back only Z Figure 21 Load Executable File Window 4 8 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor The Embedded Bootloader is now programmed to the PCB as shown in Figure 22 E CPROGO8Z Programmer Version 1 01 Status Window hilte y www pemicro com Initializing Target has been RESET and is active CMD gt CM C Program Files Metrowerks CodeWarrior CWO8 V3 0 prog P amp E 9SO8GB60 S8P Initializing Recommended Trim 89 Bus Freg 15533KHz Initialized Programming file for the 68HCS908GB60 processor FLASH block Version 1 03 Copyright 2002 by P E Microcomputer Systems Inc www pemicro com Running programming script Figure 22 Status Window
54. tion Several values can be used See the MC90SHCSOSGB60 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 e UART baud rate 19200 kbps 8 data 1 start 1 stop none parity 2 4 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor Chapter 3 Test Tool Zigbee Flash Tool 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 GUL 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 Fre
55. trings for the Embedded Bootloader Functionality Lib and HCS08 Flash Lib to place the numbers in the executable image If the version numbers are not reguired they can be removed by removing the reference to the version number which frees up more code memory for user code 6 6 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor Chapter 7 Embedded Bootloader Public Function Description This section describes the public functions which the 802 15 4 Zigbee application can call in the Embedded Bootloader 7 1 802 15 4 Zigbee Application Accessible Functions The following functions located in the Embedded Bootloader are made accessible for 802 15 4 Zigbee applications For example an 802 15 4 Zigbee application is not required to have programming routines to store NVM data in flash A function pointer for each function of the below listed functions is defined in Embedded Bootloader c Enable Download Firmware Hard_ Reset NV_Flash_Setup Update_NV_RAM FL_ICG_Setup UART_Port_Select The Embedded Bootloader h file contains function pointer prototypes and must be included in source files calling these functions The function pointers are setup to point to functions with the same name in the Embedded Bootloader extern Enable_Download Firmware_ptr_t Enable _Download_Firmware extern Hard_Reset_ptr_t Hard_Reset extern NV_Flash_Setup_ptr_t NV_Flash_Setup extern Update_NV_RAM
56. w NVM data to store Output True NVM data stored False Something went wrong should never happen Freescale Semiconductor Embedded Bootloader Reference Manual Rev 0 0 7 3 7 1 4 NV_Flash_Setup Prototype void NV_Flash_Setup void Description This function should never be called under normal conditions However it should be called if any of the other Embedded Bootloader functions malfunctions The function sets up the flash functions again i e copies the flash routines to RAM for execution and initialize the HCS08 flash module Input None Output None 7 1 5 FL_ICG_Setup Prototype void FL_ICG_Setup void Description This function can be called by the application The function could be automatically called if the external system clock is unstable removed from ISR function and on power down up doze This requires that the FL_ICG_Setup is called from an ISR function NOTE Application programmers can make their own system clock setup function or call this function and just modify the ICG and MC13192 register values in the NVM section Input None Output None 7 4 Embedded Bootloader Reference Manual Rev 0 0 Freescale Semiconductor 7 1 6 UART_Port_Select Prototype void FL_ICG_Setup uint8_t data_reg_address uint8_t status_reg_address Description This function can be called when the application has detected the active communication interface if used by the application The com
Download Pdf Manuals
Related Search
Related Contents
Invacare DVR ICR630 User's Manual Backdata Propagation User Manual Le comité technique paritaire Spatial Convolution Grid Filters (T34) Please read manual carefully before starting DeLOCK Adapter IDE Slim CD-Rom > IDE 40pin Manual de usuario de la herramienta compass para administradores Pyramid Car Audio 906VL User's Manual Copyright © All rights reserved.
Failed to retrieve file