http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka10535.html

C166: START167 AND BOOT167

QUESTION

I do not quite understand the files START167.A66 and BOOT167.A66.

Is BOOT.A66 used for the monitor and START167.A66 used for the final application ?

ANSWER

The BOOT167.A66 file is part of the boot loader used by the monitor.

Actually, the monitor consists of three files: BOOT*.A66, CONF*.INC, and INST*.A66.

CONF contains definitions for the stuff that gets initialized in the startup code for the monitor.

This code is in BOOT.

The CONF file contains definitions that are identical to those found in START167.A66.

So, to get a monitor working, the startup should be the same in CONF and in START167.

The INST file is the initialization for the monitor.

This includes things like the serial port used for communication with dScope and so on.

The START167.A66 file is the startup code that is executed immediately after reset by the CPU.

There's nothing much to add here.

If you have a monitor configuration that works, but your stand-alone program doesn't work,

you should compare the CONF*.INC from the monitor to the START167.A66 file for the stand-alone program.

There's probably a difference that prevents your program from working.

START167.A66

The START167.A66 file contains the startup code for the C161, C163, C164, C165, and C167 microcontrollers.

The startup code is executed immediately upon reset of the target system and performs the following operations in order:

  • Initializes the SYSCON SFRs including BUSCON0.
  • Initializes the ADDRSELx/BUSCONx SFRs (if configured).
  • Reserves and initializes the hardware stack and stack overflow/underflow registers.
  • Sets DPP0-DPP3 and CP for memory and register bank accesses.
  • Reserves and initializes the user stack area and user stack pointer (R0).
  • Clears data memory.
  • Initializes explicitly initialized variables.
  • Transfers control to the main C function.

START167.A66 contains definitions that are used to configure the hardware of the C16x and to setup the C runtime system.

The functions of the individual EQU statements are described below.

Name Definition
_ALECTL0 ALE Lengthening Control Bit; see the C167 data sheet for description.
_BTYP0 or BYTP

Defines the external bus configuration the CPU uses.

The bus configuration is used only if BTYP_ENABLE is set to 1.

_BUSACT0 or BUSACT Bus Active Control Bit. Default: 1 to enable the external bus.
_BYTDIS

Byte High Enable pin control bit initialization value.

Default: 0 for enabled. (This is the reset value of the CPU).

To disable the BHE# output, set _BYTDIS to 1.

_CLREN

System Clock Output Enable bit initialization value.

Default: 0 to disable the CLKOUT output (this is also the reset value of the CPU.)

To enable the CLKOUT output set _CLKEN to 1.

_MCTC0 or _MCTC

Memory Cycle Time initialization value.

Default: 1 for one memory wait state (MCTC = 0EH).

Reset value of the CPU is 15 for 15 additional state times.

_MCTCn-_CSWENn

Defines the bus characteristics for the address range specified with ADDRESSn and RANGEn.

These values are used to set the BUSCON1-BUSCON4 registers.

_MTTC0 or MTTC

Memory Tri-State Time initialization value.

Default: 0 for 0.5 states; this is also the reset value of the CPU.

To select 0 states for the Tri-State time, set _MTTC to 1.

_RDY_AS

Synchronous / Asynchronous READY# input selection.

Default: 0 for synchronous READY# input.

_RDYEN0 or RDYEN

READY# Input Enable Control Bit.

Default: 0 to disable the READY# input.

_ROMEN

The Internal ROM Access Enable bit is read-only.

Do not change this value.

_ROMS1

On-Chip ROM Segment-Mapping Control Bit.

Default: 0 for on-chip ROM mapped to segment 0 (address range 0x0000-0xFFFF).

Seg _ROMS1 to 1 for segment 1 (address range 0x10000-0x1FFFF).

_RWDC0 or RWDC

Read/Write Signal Delay initialization value.

Default: 1 for no delay (this is the typical value in most systems).

Reset value of the CPU is 0 for 0.5 states delay time.

_SGTDIS

Segmentation Disable Control Bit initialization value.

The segmentation is disabled for the TINY memory model; in all other memory models it is enabled.

Do not change the definition of _SGTDIS.

_WRCFG

Write Configuration Control Bit.

Default: 0 for normal configuration of WR# and BHE# outputs.

_XRAMEN

XRAM Enable Control Bit.

Default: 0 to disable access to XRAM area.

External bus accesses are generated in the XRAM area.

ADDRESS1-ADDRESS4

Define the start address of the Chip Select 1-4 output (CS1#-CS4#).

This value is used to set the ADDRSEL1-ADDRSEL4 register.

BTYP_ENABLE

Allow software to modify BTYP and change the bus mode.

By default, this is disabled and the bus type is set by the hardware pins of the C16x/ST10.

To enable the external bus configuration, set BTYP_ENABLE = 1.

BUSCON1-BUSCON4

Initialization for BUSCON1/ADDRSEL1-BUSCON4/ADDRSEL4 registers.

Set BUSCON1 = 1 to initialize BUSCON1/ADDRSEL1.

CLR_MEMORY

Memory Zero Initialization of RAM areas.

Default: enable the memory zero initialization of RAM area.

To disable the memory zero initialization, set CLR_MEMORY = 1.

This reduces the startup code size.

DPPUSE

Allow re-assignment of DPP registers.

Default: 1 to support the L166 DPPUSE directive.

To disable the DPP re-assignment, set DPPUSE = 0.

This reduces the startup code size.

EXT_RAM

External RAM Write-Access Enable (P3.13 = WR-Pin) initialization value.

The default value enables the external RAM access.

To disable external RAM, remove the statement $SET (EXT_RAM).

INIT_VARS

Variable Initialization of explicitly initialized variables (variables are to be defined as static or declared at file level).

Default: initialize variables.

To disable the variable initialization, set INIT_VARS = 0. This reduces the startup code size.

RANGE1-RANGE4

Define the address range of the Chip Select 1-4 output (CS1#-CS4#).

This value is used to set the ADDRSEL1-ADDRSEL4 register.

SSTSZ

Set the system stack space, if you selected 7 for the STK_SIZE.

STK_SIZE

STK_SIZE: Maximum System Stack Size selection initialization value.

Default value is 0 for 256-word stack size.

Set STK_SIZE to the following values for other stack sizes:

0 for 256-word system stack
1 for 128-word system stack
2 for 64-word system stack
3 for 32-word system stack
4 for 512-word system stack (not for C166)
7 for user-defined system-stack size

If you select 7, the system-stack size is defined with the SSTSZ variable.

USTSZ

Set the user stack space.

The user stack is used for automatic variables.

WATCHDOG

Hardware Watchdog control.

Default: disable the hardware watchdog.

To enable the watchdog set WATCHDOG = 1.

C166: PURPOSE OF START167.A66

QUESTION

What is the purpose of the START167.A66 file? It seems to configure the memory arrangements of the device. If that is the case, when is it executed?

ANSWER

START167.A66 contains the startup code for the C167 derivative devices. It executes immediately upon reset of the device and optionally performs the following operations in order:

  • Initializes the SYSCON SFR registers (and BUSCON0 for the C167).
  • Initializes the ADDRSELx and BUSCONx SFR registers to configure memory access.
  • Reserves and initializes the hardware stack and the stack underflow and overflow registers.
  • Sets up DPP0 to DPP3 and CP for memory and registerbank access.
  • Reserves and initializes the user stack area and the user stack pointer (R0).
  • Clears data memory.
  • Initializes variables that were explicitly initialized.
  • Calls the main function.

If you are using the monitor, then the monitor contains it's own startup code that performs most of these operations. Once it has been completed, the startup code in your own application has no effect on the configuration of the device.

C166: START167.A66 FOR EVALUATION BOARDS

QUESTION

I have a Phytec KC167CR evaluation board and a simple IO port example to demonstrate the board. I use the default START167.A66 provided by the Keil C166 compiler. The program does not run on the KC167CR board. What could be wrong?

ANSWER

The purpose of the START167.A66 file is to configure specific hardware conditions of the C16X device specifically for the target hardware. In this case the target hardware is the Phytec KC167CR evaluation board. Therefore, you must have the specific Phytec provided START167.A66 file for the KC167CR.

The START167.A66 contains the startup code for the C167 derivative devices. It is executed immediately upon reset of the device and optionally performs the following operations in order:

  • Initializes the SYSCON SFR registers (and BUSCON0 for the C167)
  • Initializes the ADDRSELx and BUSCONx SFR registers to configure memory access
  • Reserves and initializes the hardware stack and the stack underflow and overflow registers
  • Sets up DPP0 to DPP3 and CP for memory and registerbank access
  • Reserves and initializes the user stack area and the user stack pointer (R0)
  • Clears data memory
  • Initializes variables that were explicitly initialized
  • Calls the main function

If you are using the monitor, then the monitor contains it's own startup code that performs most of these operations. Once it has been completed, the startup code in your own application has no effect on the configuration of the device.

The C:\Keil\C166\EXAMPLES\BOARDS directory has examples and the appropriate START167.A66 files for popular C16X evaluation boards.

START167 AND BOOT167的更多相关文章

  1. MON166 FAQ

    MON166: SOFTWARE RESET USING THE MONITOR QUESTION What happens when debugging using MON166 and my pr ...

随机推荐

  1. Android系统在超级终端下必会的命令大全(adb shell命令大全)

    . 显示系统中全部Android平台: android list targets . 显示系统中全部AVD(模拟器): android list avd . 创建AVD(模拟器): android c ...

  2. Web Developer可以做得更多

    美国雅虎前端工程师Hedger Wang.这位原雅虎奇摩的第一位Web Developer,非常慷慨的与我们分享了他丰富的经验.现身说法,比空洞的理论更有感染力,我们发现现在遇到的很多问题也都是他曾经 ...

  3. 百度地图Api之自定义标注:(获得标注的经纬度和中心经纬度即缩放度)

    百度地图Api之自定义标注:(获得标注的经纬度和中心经纬度即缩放度) <%@ Page Language="C#" AutoEventWireup="true&qu ...

  4. Javascript 日期时间格式正则

    因为Javascript的日期格式判断可能因浏览器的版本有所不同,所以用正则判断会比较好,这里备注一个正则用来判断日期时间的格式: ^(?=\d)(?:(?!(?:1582(?:\.|-|\/)10( ...

  5. JNI编程,C++调用Java

    本地代码中使用Java对象 通过使用合适的JNI函数,你可以创建Java对象,get.set 静态(static)和 实例(instance)的域,调用静态(static)和实例(instance)函 ...

  6. bzoj1391 最大权闭合子图(also最小割、网络流)

    一道裸的最小割的题,写一下只是练练手. 表示被卡M,RE不开心.一道裸题至于吗? 再次复习一下最大权闭合子图: 1.每一个点若为正权,与源点连一条容量为绝对值权值的边.否则连向汇点一条容量为绝对值权值 ...

  7. 开源框架DNN简介以及安装

    donetnuke 是一款免费的开源cms框架,目前也有收费版,不过免费版也可以适应大家大部分的需求.我前些阵子是老板让我在20天内,做好一个官网并且发布,并且指定使用dnn这个框架,考虑到又可以学习 ...

  8. Hadoop2学习记录(1) |HA完全分布式集群搭建

    准备 系统:CentOS 6或者RedHat 6(这里用的是64位操作) 软件:JDK 1.7.hadoop-2.3.0.native64位包(可以再csdn上下载,这里不提供了) 部署规划 192. ...

  9. 第三百五十二天 how can I 坚持

    如果要是今年找不到对象,明年去回济南, 怎么感觉那么不舍呢.生活总是有太多的无奈啊. 今天加了一天,倒是没感觉,只是感觉生活太空虚. 或许遗憾只是因为自己太懦弱.怎么说呢,还是那句话,经历的就会成长, ...

  10. Chef

    Chef是一个渐渐流行的部署大.小集群的自动化管理平台.Chef可以用来管理一个传统的静态集群,也可以和EC2或者其他的云计算提供商一起使用.Chef用cookbook作为最基本的配置单元,可以被泛化 ...