ARM——开发工具—编译器

说起ARM开发,不得不说的就是编译器了。大家都熟悉的gcc,这个平台也有。

反正说起嵌入式开发,大家必然要提的就是toolchain,也叫工具链。还有叫交叉(CROSS)工具链。其实都差不多。为什么有这么多版本的编译器?

主要是市场决定的吧。不同的开发板会提供基于gnu标准修改的一些gcc、as、ld,一般elf文件还都是一样的。大部分原因是不同外设等硬件导致的。

看看主流的ARM编译器有哪些?

1.armcc是ARM官方编译器,DS-5包含该工具。收费。

2.asm-linux-gnueabihf是GNU提供的编译器,ubuntu可以直接sudo apt-get install gcc-arm-linux-gnueabihf下载。DS-5提供该编译器。

3.asm-linux-gnueabi是GNU提供的编译器,ubuntu可以直接sudo apt-get install gcc-arm-linux-gnueabi binutils-arm-linux-gnueabi。

4.asm-none-gnueabi是CodeSourcery提供的编译器。网上的Lite版本免费用,不过需要注册。很多开源项目采用这个编译器。


这里就简单介绍一下,asm-none-gnueabi的安装吧。前两个都是GUI安装,没什么难度。现在的工具其实都比较简单了。

1.下载arm-2010q1-202-arm-none-linux-gnueabi.bin,这个不用教了吧。

2.安装./arm-2010q1-202-arm-none-linux-gnueabi.bin。如果不能运行,使用chmod 755 .。设置一下可以执行。如果提示不能安装,看清楚,选个Y或者N就能安装了。

3:设置环境变量

$gedit     ~/.bashrc

在.bashrc文件的末尾最后添加一行,来增加一个环境变量

export PATH="/opt/arm-2009q1/bin:$PATH"

4:使得刚才的设置生效
$ source /.bashrc

5查看linux的环境变量
$echo $PATH
$printenv

6 测试安装结果 输入

$arm-none-linux-gnueabi-gcc

提示NO input file ,

这就大功告成了。找个代码编译一下吧。这个时候输入arm-然后tab,应该会看到相关的工具。注意,编译不同的东西,工具链可能需要更换。


下面简单介绍一下,每个编译工具的使用。

1.这个是DS-5的工具。IDE界面。看看Makefile就明白了。

# TrustZone Example Makefile
#
# Copyright (C) ARM Limited, 2011. All rights reserved.
#
# This makefile is intended for use with GNU make
# This example is intended to be built with the ARM Compiler armcc

TARGET=TrustZone-versatile.axf

CC=armcc
AS=armasm
LD=armlink
AR=armar
FE=
  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
FASMARM v1.42 This package is an ARM assembler add-on for FASM. FASMARM currently supports the full range of instructions for 32-bit and 64-bit ARM processors and coprocessors up to and including v8. Contents: 1. ARM assembly compatibility 2. UAL and pre-UAL syntaxes 3. IT block handling 4. Alternate encodings 5. Output formats 6. Control directives 7. Data definitions 8. Defining registers lists inside macros 9. Half-precision number formatting 10. Variants supported 11. Further information 12. Version history _______________________________________________________________________________ 1. ARM assembly compatibility There are a few restrictions how the ARM instruction set is implemented. The changes are minor and mostly have a minor impact. For the most part the basic instruction outline is the same. Where possible the original style is used but there are some differences: Not everything matches the ARM ADS assembly style, where possible the original style is used but there are some differences 1) label names cannot begin with a digit 2) CPSIE and CPSID formats are changed, use "iflags_aif" form instead of "aif" (eg. "CPSIE iflags_i" instead of "CPSID i") 3) SRS with writeback must have a separating space after the mode number and before "!" (eg. "SRSDB 16 !" instead of "SRSDB 16!") 4) macro, rept, irp, format, if, virtual etc. are all significant changes from the ARM ADS, so you will need to re-write those sections of existing code Original ARM Syntax | fasmarm Syntax ----------------------+---------------------- cpsie a | cpsie iflags_a | srsdb #29! | srsdb #29 ! ;or, | srsdb 29 ! _______________________________________________________________________________ 2. UAL and pre-UAL syntaxes fasmarm supports the original pre-UAL syntax and the newer UAL syntax. These two syntaxes only affect THUMB encodings. UAL stands for: Universal Assembly Language. pre-UAL syntax is selected wi
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值