User Guides - Software Manual - Code Banking with Keil uVision

ZIC2410 Series
ZIC2410 User Guide
Code Banking with Keil µVision
0005-05-08-05-001
(Rev C)
ZIC2410 Code Banking w/ Keil µVision
Table of Contents
1 INTRODUCTION .................................................................................... 3 1.1 REFERENCED DOCUMENTS ....................................................................................... 3 2 ZIC2410 LIBRARY FILE FOR CODE BANKING .................................. 3 3 SET KEIL PROJECT ............................................................................. 4 4 REVISION HISTORY ............................................................................. 9 Rev C
Document No. 0005-05-08-05-001
Page 2 of 9
ZIC2410 Code Banking w/ Keil µVision
1 INTRODUCTION
The code memory of a ZIC2410 is divided physically into a Common area and three Bank areas
(Common, Bank-0, Bank-1, Bank-3). The sizes of Common, Bank-0 and Bank-1 are 32KB and
1KB for Bank-3.
When using Code Banking, 96KB is available because both the Common area (Address:
0x0000 ~ 0x7FFF) and the two overlay Bank areas (Address: 0x8000 ~ 0xFFFF) can be used.
(The upper 32KB is interchangeably used by Bank-0 and Bank-1.)
When compiled, two Hex files are created: HEX file (*.H00), which includes Common area +
Bank-0 area and HEX file (*.H01), which contains Common area + Bank-1 area.
The 1Kbyte Bank-3 is used for OTA functions and compiles into a third HEX file (*.H03).
CAUTION: If Bank-3 exceeds 1KByte, an error may occur
1.1
REFERENCED DOCUMENTS
Category
Data Sheet
User’s Guides
filename [.pdf] zic2410 zic11_getstrt_sm zic00_devpro_sm Document Name
ZIC2410 Datasheet
ZIC2410 Getting Started Guide
ZIC2410 User Guide Device-Programmer Software Manual
2 ZIC2410 LIBRARY FILE FOR CODE BANKING
In order to support Code Banking, the ZigBee™ stack Library file also should be divided. The
CEL ZigBee2006 stack provides five library files corresponding to the five layers. The user
should divide the five library files into Bank-0 and Bank-1 memory space according to the
application. The frequently used library routines should be saved in Bank-0 and the less
frequently used routines in Bank-1 memory space.
Table 1 shows the ZIC2410 library files located on the CD in a specific \CEL ZigBee
CD\ZIC2410 \Application Source Files\ZigBee2006…..\LIB\ directory for each application.
Table 1 – Library Files in ZIC2410 CEL ZigBee Stack
Description
Library file for MAIN routine. It includes StartUp.a51 and
ZigBee2006_LIB_MAIN_V140.LIB
L51_Bank.a51 file to support Code Banking.
ZigBee2006_LIB_APS_V140.LIB
Library file for APS layer.
ZigBee2006_LIB_NWK_V140.LIB
Library file for NWK layer.
ZigBee2006_LIB_MAC_V140.LIB
Library file for MAC layer.
ZigBee2006_LIB_SEC_V140.LIB
Library file for Security layer.
CAUTION: The libraries included on this CD cannot be used without Code Banking (Bank Off) because of code
size and are ONLY supported with Code Banking enabled (Bank On).
File
Rev C
Document No. 0005-05-08-05-001
Page 3 of 9
ZIC2410 Code Banking w/ Keil µVision
3 SET KEIL PROJECT
The following is the procedure to set up Keil Project xxxxxx.uv2. This document explains how
to set up Keil Project using the Light application files included on the CD. For other application
examples, the Keil project is set up in the same way.
1) Using Keil IDE µVision to open the Keil project file, ‘ZigBee2006_DK_LIGHT.uv2’ from the
directory \ZIC2410\Application Source Files\ZigBee2006_DK_LIGHTon the CEL CD provided,
the following window (Figure 1) is displayed.
Figure 1 –Screen, Opening Keil µVision project, ZigBee2006_DK_LIGHT
2)
Please click on ‘Options for Target’ icon as shown in Figure 2 below.
Figure 2 –Screen, Opening Keil µVision (Icon)
Rev C
Document No. 0005-05-08-05-001
Page 4 of 9
ZIC2410 Code Banking w/ Keil µVision
3) When ‘Options for Target ‘Target1’ ’ window is displayed as in Figure 3, click the ‘Device’
tab and select ‘8051’. Click ‘OK’.
Figure 3 – Screen, Keil µVision (Options for Target ‘Target 1’)
4)
Click the ‘Target’ tab to set up the device memory model and clock speed for CEL internal
8051 core controller as shown in Figure 4 below.
Figure 4 – Screen, Keil µVision (Setting Model and Clock Speed)
NOTE: Bank definition of the ZIC2410
Bank-0: Used to store user defined executable code (.H00)
Bank-1: Used to store user defined executable code (.H01)
Bank-2: Not used in the ZIC2410
Bank-3: Used for the OTA function (≤ 1KB).
For more detailed information, please refer to “Register Bank-0-3” area in the “General Purpose Registers”
section of the ZIC2410 Datasheet.
Rev C
Document No. 0005-05-08-05-001
Page 5 of 9
ZIC2410 Code Banking w/ Keil µVision
5) Click the ‘BL51 Locate’ tab and select ‘Use Memory Layout from Target Dialog’ as shown
in Figure 5 below. Click ‘OK’ button.
Figure 5 – Screen, Keil µVision (BL51 Locate Tab)
6) Place the library module and the application
module in three regions: Common, Bank-0 and
Bank-1. Please group the files to be assigned in
each area, both library files and source files as
shown in Figure 6. Check the following:
 The total size of library and source code included in
any region cannot exceed 32K or a compile error will
occur.

ISR routine should be in the COMMON area. as well
as the ZigBee2006_LIB_MAIN_V140.LIB and
ISR_USER.c files.

Bank Switching will result in larger code size and
slower execution speed so it is advised to switch
banks only when necessary. To avoid Bank
Switching, the library and source files for the
frequently used functions should be assigned to the
COMMON area and the Bank-0 area. Less
frequently used functions should be assigned to
Bank-1.
Figure 6 – Screen, Keil µVision (Categorizing File Groups)
Rev C
Document No. 0005-05-08-05-001
Page 6 of 9
ZIC2410 Code Banking w/ Keil µVision
7) Set the Bank for each group. As shown in Figure 7, please go to the folder which is classified
by same group and then right click on mouse. Please select ‘Options for Group ‘xxxx’ ’ on
the menu. Select the area to be assigned to each folder as shown in Figure 7.
Figure 7 – Screen, Keil µVision (Grouping files by Bank)
Rev C
Document No. 0005-05-08-05-001
Page 7 of 9
ZIC2410 Code Banking w/ Keil µVision
When you select ‘Options for Group ‘xxxx’ ’, Figure 8 is displayed. To assign to the Common
area, first select ‘Common’ from ‘Code Bank’ drop down, and click ‘OK’.
Figure 8 – Screen, Keil µVision (Displaying “Options for Group ‘xxxx’ ’)
When you select ‘Options for Group ‘xxxx’ ’, Figure 9 is displayed. To assign to the Bank-0
area, first select ‘Bank-0’ from ‘Code Bank’ drop down list, and click ‘OK’.
Figure 9 – Screen, Keil µVision (Specifying Bank-0)
Rev C
Document No. 0005-05-08-05-001
Page 8 of 9
ZIC2410 Code Banking w/ Keil µVision
When you select ‘Options for Group ‘xxxx’ ’, Figure 10 is displayed. To assign to the Bank-1
area, first select ‘Bank-1’ from ‘Code Bank’ drop down list and click ‘OK’.
Figure 10 – Screen, Keil µVision (Specifying Bank-1)
8) Compile the files. An Object file that includes each bank is created as shown in Figure 11 and
a hex file in HEX folder from the Object file is generated. The generated files are *.H00 (Bank0), *.H01 (Bank-1) and *.H03(Bank-3)
Figure 11 – Screen, Keil µVision (Object File after Compiling)
The files *.H00 (Bank-0), *.H01 (Bank-1) and *.H03 (Bank-3) created in Step 8) should be
downloaded to an evaluation board using the Device-Programmer software once the
appropriate hardware settings have been made to the evaluation board. For more detailed
information, refer to “ZIC2410 Getting Started Guide”, and to “ZIC2410 User Guide DeviceProgrammer Software Manual”.
4 REVISION HISTORY
Revision
A
Date
3Sep08
B
13Jan09
C
11Jun09
Rev C
Description
Released
Updated Table in Section 1.1; added filenames to all referenced documents;
edited for consistent labeling of “Bank-#” and “µVision”
Replaced evaluation board model #s with “evaluation board”.
Document No. 0005-05-08-05-001
Page 9 of 9