Using-Arm-C-In-Embedded-Systems-Source-Code
所属分类:处理器开发
开发工具:C/C++
文件大小:7KB
下载次数:2
上传日期:2009-10-24 08:26:10
上 传 者:
moa
说明: Source Code for Using-Arm-C-In Embedded-Systems book
文件列表:
DAI0074A\andymitc (0, 2003-07-25)
DAI0074A\andymitc\AppNote (0, 2003-07-25)
DAI0074A\andymitc\AppNote\Examples (0, 2003-07-25)
DAI0074A\andymitc\AppNote\Examples\build.bat (382, 1999-03-24)
DAI0074A\andymitc\AppNote\Examples\cpp_start.cpp (1140, 1999-03-16)
DAI0074A\andymitc\AppNote\Examples\example.apj (4922, 1999-03-19)
DAI0074A\andymitc\AppNote\Examples\example.cpp (741, 1999-03-19)
DAI0074A\andymitc\AppNote\Examples\init.s (5858, 1999-01-12)
DAI0074A (0, 2003-07-25)
Using ARM C++ in Embedded Systems: Example Code
===============================================
This is the example code for Application note 74 "Using ARM C++ in Embedded
Systems".
The example code consits of three files and can be run, without
modification, on either the Armulator or the ARM Development Board (with an
ICE unit).
This example uses the init.s startup code from the SDT 2.50 "Writing Code
for ROM" chapter. Target specific addresses have been set appropriately for
the ARM Development Board (PID7T) or Armulator. For other targets you will
need to make appropriate changes.
The file cpp_start.cpp is the code from the application note that handles
C++ specific initialisation. Again if not using the Armulator or the ARM
Development Board you will need change the addresses specified for the
heap's location.
The third source file is example.cpp, this contains simple code that
demonstrates a number of C++ features, e.g. the new operator and top level
constructors being called.
The image from this project can either be run in the Armulator or converted
to a binary file (using the fromELF utility) and programmed into the flash
and run on the ARM development board.
This code should produce the following output:
Hello, World 0
x.n is 1, y.n is 2
Note
====
This code makes use of semi-hosted SWIs to print information, these could
be provided either by the Armulator or by an Embedded-ICE/Multi-ICE unit.
If these operations are not available you will need to modify this example
code to:
1) Print results using a different method.
2) Change the action taken when the C code returns to the assembler,
currently this ends execution with another SWI.
Building under Windows
======================
If using APM you can use the supplied project. In this case you will need
to copy the appropriate copy of the C++ library (i.e. armcpplib_cn.32l)
into the "embedded" sub-directory.
Building from the command line
==============================
If using the command line tools use the following commands in the directory
containing the example code. You will need to make the appropriate changes
to the paths specified if using UNIX or a non-default install directory.
These commands are also contained in the batch file build.bat.
armasm -PD "ROM_AT_ADDRESS_ZERO SETL {TRUE}" -o init.o init.s
armcpp -o cpp_start.o -c cpp_start.cpp
armcpp -o example.o -c example.cpp
armlink -ro-base 0x0 -rw-base 0x2000000 -first init.o(init) -o output.axf
init.o example.o cpp_start.o c:\arm250\lib\embedded\armlib_cn.32l
c:\arm250\lib\armcpplib_cn.32l
If you also wish to generate a plain binary file for programming into rom:
fromelf -nozeropad output.axf -bin output.bin
近期下载者:
相关文件:
收藏者: