Freescale Semiconductor 802.15.4/Zigbee Reference Manual

802.15.4/zigbee embedded bootloader
Table of Contents

Advertisement

Quick Links

802.15.4/Zigbee
Embedded Bootloader
Reference Manual
802154EBRM/D
Rev. 0.0, 09/2004

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 802.15.4/Zigbee and is the answer not in the manual?

Questions and answers

Summary of Contents for Freescale Semiconductor 802.15.4/Zigbee

  • Page 1 802.15.4/Zigbee Embedded Bootloader Reference Manual 802154EBRM/D Rev. 0.0, 09/2004...
  • Page 2 1-800-521-6274 or 480-768-2130 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 Japan: without limitation consequential or incidental damages.
  • Page 3: Table Of Contents

    Using the View Menu Option .......................3-3 3.1.3 Selecting the Firmware File to Upload ..................3-4 3.1.4 Using the Help Menu........................3-6 3.1.5 Changing the NVM Data in Flash or File ..................3-6 Command Line Version (CMD) ....................3-8 Freescale Semiconductor Embedded Bootloader Reference Manual, Rev. 0.0...
  • Page 4 Chapter 6 Port Integration Reference Guide ............... 6-1 Embedded Bootloader Build Environment ...................6-1 6.1.1 HCS08 Compiler...........................6-1 6.1.2 HCS08 Linker ..........................6-1 6.1.3 HCS08 LibMaker..........................6-1 Product Deliverables........................6-2 6.2.1 Embedded_Bootloader.mcp......................6-2 6.2.2 HCS08_Flash_Lib.Lib........................6-2 6.2.3 Embedded_Bootloader_Functionality_Lib.Lib ................6-2 6.2.4 Source Files...........................6-2 Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 5 7.1.3 Update_NV_RAM ........................7-3 7.1.4 NV_Flash_Setup...........................7-4 7.1.5 FL_ICG_Setup..........................7-4 7.1.6 UART_Port_Select ........................7-5 Chapter 8 Embedded Bootloader Memory Map ..............8-1 Appendix A Release Folder and File Structure..............A-1 A.1. Folder Structure ...........................A-1 A.2. File Structure..........................A-2 Freescale Semiconductor Embedded Bootloader Reference Manual, Rev. 0.0...
  • Page 6: About This Book

    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. Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 7: Conventions

    The Embedded Bootloader boots up using safe default system values. HIWAVE P&E HCS08 debugger GUI. CPROG P&E HCS08 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...
  • Page 8: References

    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...
  • Page 9: Chapter 1 Embedded Bootloader Description

    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...
  • Page 10: Ported Targets

    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. Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 11: Features

    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...
  • Page 12: Optional Firmware Upload Settings

    Check the optional settings and try again. o Enabled No checksum verification is performed. Flash programming errors cannot be detected. The UART/USB communication channel is also protected with a protocol checksum. Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 13: Chapter 2 Using The Embedded Bootloader

    In this case, users send a specific command via the UART to enable firmware upload MC908HCS08GB60 /MC13192 Application Test Tool 802.15.4 MAC 802.15.4 PHY RS232 Device Driver UART UART or USB Or MC908HCS08GT60 Or USB Figure 1 Application Supporting RS232 UART or USB Interface Freescale Semiconductor Embedded Bootloader Reference Manual, Rev. 0.0...
  • Page 14: Use Case Two

    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. 5. Wait until LED1 goes on (< 1 second) 6. Power off the board Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 15: Updating Non-Volatile Memory (Nvm)

    Update_NV_RAM(&(NV_RAM_ptr->MAC_Address)[0], &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...
  • Page 16: System Bus Frequency

    MAC/PHY Software Reference Manual, 802154MPSRM/D, for more details. If no NVM data is found, the following (safe mode boot) values are used: UART baud rate 19200 kbps, 8 data, 1 start, 1 stop, none parity. Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 17: Chapter 3 Test Tool - Zigbee Flash Tool

    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 Freescale Zigbee/802.15.4 web page for new or updated applications. Freescale Semiconductor Embedded Bootloader Reference Manual, Rev. 0.0...
  • Page 18: Graphical User Interface (Gui) Version

    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”. Baud Selection Tools Menu Buttons Add Buttons Close Button Figure 3 Tools Menu Selection Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 19: Using The View Menu Option

    If no application is uploaded, you must use the default settings specified for the Embedded Bootloader. Chapter 2 for more information. NOTE If the USB interface is used, the USB option appears as a new COM port. Figure 4 View Menu Option Freescale Semiconductor Embedded Bootloader Reference Manual, Rev. 0.0...
  • Page 20: Selecting The Firmware File To Upload

    The upload progress bar begins to indicate upload progress. Upload Application Upload Button Progress Field Files Status/Error Information Field Figure 5 Firmware Upload The Status/Error Information Field shows the Status/Error Information received from the Embedded Bootloader. Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 21 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...
  • Page 22: Using The Help Menu

    There is no sanity check on the user entered values, though there is a check on length. See the MC908HCS08GB60/GT60 MCU Data Sheet, MC9S08GB60/D about how to specify valid register values for the HCS08. Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 23 Figure 8 System Configuration Window Freescale Semiconductor Embedded Bootloader Reference Manual, Rev. 0.0...
  • Page 24: Command Line Version (Cmd)

    The command line version of the Embedded Bootloader flash programming tool must be called with parameters: Execute ‘Bootloader.exe’ without parameters to show a parameter list: Figure 9 Command Line Version (Parameter List) Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 25: Normal Use Example (Default)

    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 Reference Manual, Rev. 0.0...
  • Page 26 3-10 Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 27: Chapter 4 Embedded Bootloader Programming

    Figure Figure 12 Set Target Window 3. In the “Processor” drop down menu, select HCS08. From the “Target Interface” drop down menu, select P&E Target Interface, the click on the “OK” button. Freescale Semiconductor Embedded Bootloader Reference Manual, Rev. 0.0...
  • Page 28 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. Figure 13 Connection Assistant Window Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 29 Select “Motorola S-Record (*.s19)” using the “Files of type:” drop down menu. Navigate to the folder where a copy of the Embedded Bootloader is located. Select the “Embedded Bootloader.s19” file and click the “Open” button. Figure 14 Load Executable Window Freescale Semiconductor Embedded Bootloader Reference Manual, Rev. 0.0...
  • Page 30 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 upload an application. Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 31: Upgrading The Embedded Bootloader

    “Set Target”. The “Set Target” window appears as shown in Figure Figure 16 Set Target Window 3. From the “Processor” drop down menu, select HCS08. From the “Target Interface” drop down menu, select P&E Target Interface, then click the “OK” button. Freescale Semiconductor Embedded Bootloader Reference Manual, Rev. 0.0...
  • Page 32 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. Figure 17 Connection Assistant Window Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 33 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 NVM0 use 0x155B and for NVM1 use 0x175B. Freescale Semiconductor Embedded Bootloader Reference Manual, Rev. 0.0...
  • Page 34 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. Figure 21 Load Executable File Window Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 35 NOTE The applications must have the production section in the NVM cleared. That is, the application image must contain 0xFF's in the production data section of the NVM. Freescale Semiconductor Embedded Bootloader Reference Manual, Rev. 0.0...
  • Page 36 4-10 Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 37: Chapter 5 Application Integration Reference Guide

    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...
  • Page 38: Application Linker File

    (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)) Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 39: System Clock Setup

    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...
  • Page 40: Crt0.C And Crt.h

    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 information. Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 41: Embedded_Bootloader.h And Embedded_Bootloader.c

    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 0xEFFE to 0xEFFF. The variables control the startup of the Embedded Bootloader. Freescale Semiconductor Embedded Bootloader Reference Manual, Rev. 0.0...
  • Page 42: Dummyisr.c

    BDM connector. An illegal instruction reset occurs if no 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. Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 43: Chapter 6 Port Integration Reference Guide

    The 802.15.4 and Zigbee applications that interface to the Embedded Bootloader must be linked with the "Ptc_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...
  • Page 44: Product Deliverables

    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. Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 45: Porting To A Specific Target

    Metrowerks for a successful build. The ansiis.lib library is part of the Metrowerks CodeWarrior installation and is located in the following path: [Install Folder]\Metrowerks\CodeWarrior CW08_V3.0\lib\HC08c\*.* 6.3.3 Compiler #defines No compiler #defines are necessary. Freescale Semiconductor Embedded Bootloader Reference Manual, Rev. 0.0...
  • Page 46: Source Files

    #define LED4OFF PTDD | = 0x10; #define LED4TOGGLE PTDD ^ = 0x10; The MC13192 attention and reset pin (bit) positions: #define ABEL_ATT_PIN (1<<2) #define ABEL_RESET_PIN (1<<4) HCS08 port setup macros: #define mSETUP_PORT_A //PTAPE = 0x3C;\ Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 47: Reset_Vector.c

    // PCB board number for release #define EMBEDDED_BOOTLOADER_TARGET "528&536" // 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...
  • Page 48: Hw_Init.h

    If the version numbers are not required, they can be removed by removing the reference to the version number which frees up more code memory for user code. Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 49: Zigbee Application Accessible Functions

    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...
  • Page 50 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)0xFF) Output: True - Ready for reset. False - Something went wrong in changing the state. Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 51 A pointer to new NVM data, which must be stored. Source_Length The length (number of bytes) of the new 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...
  • Page 52: Nv_Flash_Setup

    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 Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 53: Uart_Port_Select

    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...
  • Page 54 Embedded Bootloader Reference Manual, Rev 0.0 Freescale Semiconductor...
  • Page 55: Chapter 8 Embedded Bootloader Memory Map

    109F 11FF FLASH (section 1) 1200 13FF FLASH (section 1) 1400 15FF FLASH (section 1) 802.15.4/App. NV RAM block 0 (share) 1600 17FF FLASH (section 1) 802.15.4/App. NV RAM block 1 (share) Freescale Semiconductor Embedded Bootloader Reference Manual, Rev. 0.0...
  • Page 56 FLASH (section 2) 3E00 3FFF FLASH (section 2) 4000 41FF FLASH (section 2) 4200 43FF FLASH (section 2) 4400 45FF FLASH (section 2) 4600 47FF FLASH (section 2) 4800 49FF FLASH (section 2) Embedded Bootloader Reference Manual, Rev. 0.0 Freescale Semiconductor...
  • Page 57 FLASH (section 2) 7400 75FF FLASH (section 2) 7600 77FF FLASH (section 2) 7800 79FF FLASH (section 2) 7A00 7BFF FLASH (section 2) 7C00 7DFF FLASH (section 2) 7E00 7FFF FLASH (section 2) Freescale Semiconductor Embedded Bootloader Reference Manual, Rev. 0.0...
  • Page 58 FLASH (section 2) AA00 ABFF FLASH (section 2) AC00 ADFF FLASH (section 2) AE00 AFFF FLASH (section 2) B000 B1FF FLASH (section 2) B200 B3FF FLASH (section 2) B400 B5FF FLASH (section 2) Embedded Bootloader Reference Manual, Rev. 0.0 Freescale Semiconductor...
  • Page 59 FLASH (section 2) E000 E1FF FLASH (section 2) E200 E3FF FLASH (section 2) E400 E5FF FLASH (section 2) E600 E7FF FLASH (section 2) E800 E9FF FLASH (section 2) EA00 EBFF FLASH (section 2) Freescale Semiconductor Embedded Bootloader Reference Manual, Rev. 0.0...
  • Page 60 ISR vectors (31 vectors - 25 vectors - 25 implemented) implemented) FFFE FFFF Reset vector "address Reset vector "address in in Bootloader" Bootloader" 65535 Must be = FFFF for FFFF valid memory map. NM = No meaning Embedded Bootloader Reference Manual, Rev. 0.0 Freescale Semiconductor...
  • Page 61 (not including ISR vectors and Code 4016 reset vector) bytes available. Read and written by Embedded Bootloader (2 sectors are used, so it occupies 1024 bytes flash). NV-RAM 1024 Freescale Semiconductor Embedded Bootloader Reference Manual, Rev. 0.0...
  • Page 62 Embedded Bootloader Reference Manual, Rev. 0.0 Freescale Semiconductor...
  • Page 63: Appendix A Release Folder And File Structure

    RD01 is Freescale's reference build for all PCB's using the Freescale Reference Design version 01. Embedded_Bootloader_Functionality_Lib Embedded Bootloader functionality library (source code not released) Embedded Bootloader HCS08 flash library HCS08_Flash_Lib (source code not released) Linker file Source code sources Freescale Semiconductor Embedded Bootloader Reference Manual, Rev. 0.0...
  • Page 64: File Structure

    (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 (I/O mapping) Embedded Bootloader Reference Manual, Rev. 0.0 Freescale Semiconductor...
  • Page 65 Embedded_Bootloader.elf Elf format file Embedded_Bootloader.map Map file Embedded_Bootloader.s19 Freescale S19 file .\Embedded_Bootloader\Bin\Embedded_Bootloader_Functionality_Lib Embedded_Bootloader_Functionality_Lib.Lib Functionality library .\Embedded_Bootloader\Bin\HCS08_Flash_Lib HCS08_Flash_Lib.Lib HCS08 flash library .\Embedded_Bootloader\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...
  • Page 66 Embedded Bootloader Reference Manual, Rev. 0.0 Freescale Semiconductor...

Table of Contents