AVR Libc Home Page AVRs AVR Libc Development Pages
Main Page User Manual Library Reference FAQ Alphabetical Index Example Projects

ツールチェーン概要

はじめに

ようこそ、Atmel AVRのためのオープンソースソフトウェア開発ツールセットへ!

AVRに必要な全ての開発ソフトウェアを用意するのは、1つのツールだけではありません。複数のツールが一緒に動作しています。トータルで、AVRマイコンのための最終的に実行するアプリケーションを1つにまとめたツールのことを、ツールセットやツールチェーンと呼ばれます。

以下のセクションでは、これらのツール全ての概要を提供します。GUIフロントエンドで全てを提供してくれるクロスコンパイラを使っていて、「フードに隠れている」動作しているのが何か知らないかもしれません。あなたは、デスクトップやサーバの知識はあるが、組込システムになれていないかもしれません。または、あなたが、UnixやLinuxシステム上で利用できる最も一般的なソフトウェア開発ツールチェーンについて学んでいるかもしれません。 うまくいくと、以下の概要では、視点を全体に置くことで参考になるでしょう。

FSF と GNU

According to its website, "the Free Software Foundation (FSF), established in 1985, is dedicated to promoting computer users' rights to use, study, copy, modify, and redistribute computer programs. The FSF promotes the development and use of free software, particularly the GNU operating system, used widely in its GNU/Linux variant." The FSF remains the primary sponsor of the GNU project.

The GNU Project was launched in 1984 to develop a complete Unix-like operating system which is free software: the GNU system. GNU is a recursive acronym for ≫GNU's Not Unix≪; it is pronounced guh-noo, approximately like canoe.

One of the main projects of the GNU system is the GNU Compiler Collection, or GCC, and its sister project, GNU Binutils. These two open source projects provide a foundation for a software development toolchain. Note that these projects were designed to originally run on Unix-like systems.

GCC

GCC stands for GNU Compiler Collection. GCC is highly flexible compiler system. It has different compiler front-ends for different languages. It has many back-ends that generate assembly code for many different processors and host operating systems. All share a common "middle-end", containing the generic parts of the compiler, including a lot of optimizations.

In GCC, a host system is the system (processor/OS) that the compiler runs on. A target system is the system that the compiler compiles code for. And, a build system is the system that the compiler is built (from source code) on. If a compiler has the same system for host and for target, it is known as a native compiler. If a compiler has different systems for host and target, it is known as a cross-compiler. (And if all three, build, host, and target systems are different, it is known as a Canadian cross compiler, but we won't discuss that here.) When GCC is built to execute on a host system such as FreeBSD, Linux, or Windows, and it is built to generate code for the AVR microcontroller target, then it is a cross compiler, and this version of GCC is commonly known as "AVR GCC". In documentation, or discussion, AVR GCC is used when referring to GCC targeting specifically the AVR, or something that is AVR specific about GCC. The term "GCC" is usually used to refer to something generic about GCC, or about GCC as a whole.

GCC is different from most other compilers. GCC focuses on translating a high-level language to the target assembly only. AVR GCC has three available compilers for the AVR: C language, C++, and Ada. The compiler itself does not assemble or link the final code.

GCC is also known as a "driver" program, in that it knows about, and drives other programs seamlessly to create the final output. The assembler, and the linker are part of another open source project called GNU Binutils. GCC knows how to drive the GNU assembler (gas) to assemble the output of the compiler. GCC knows how to drive the GNU linker (ld) to link all of the object modules into a final executable.

The two projects, GCC and Binutils, are very much interrelated and many of the same volunteers work on both open source projects.

When GCC is built for the AVR target, the actual program names are prefixed with "avr-". So the actual executable name for AVR GCC is: avr-gcc. The name "avr-gcc" is used in documentation and discussion when referring to the program itself and not just the whole AVR GCC system.

See the GCC Web Site and GCC User Manual for more information about GCC.

GNU Binutils

GNU Binutils は、「バイナリのユーティリティ」を表します。これには、GNUアセンブラ(gas)にGNUリンカー(ld)が含まれ、ソフトウェア開発ツールチェーンの一部として作成されるバイナリファイルで動作する他のユーティリティも含まれます。

また、AVRをターゲットとして構築されたツールでは、実際のプログラム名に"avr-"と接頭辞が付けられています。たとえば、アセンブラプログラム名で、(ドキュメントにおいてGNUアセンブラが一般的に"gas"と呼ばれるとしても)ネイティブアセンブラは"as"です。しかし、AVRをターゲットに構築されると、"avr-as"となります。下記は、Binutilsに含まれるプログラムのリストです。

avr-as
アセンブラ
avr-ld
リンカー
avr-ar
ライブラリ(アーカイブ)からの作成・変更・抽出
avr-ranlib
ライブラリ(アーカイブ)コンテンツのインデックス生成
avr-objcopy
オブジェクトファイルから他のフォーマットへのコピーと変換
avr-objdump
オブジェクトファイルから逆アセンブラを含む情報の表示
avr-size
セレクションサイズと総サイズを列挙
avr-nm
オブジェクトファイルからシンボルを列挙
avr-strings
ファイルから印字可能な文字列の列挙
avr-strip
ファイルからシンボルを破棄
avr-readelf
ELFフォーマットファイルのコンテンツを表示
avr-addr2line
アドレスからファイルと行に変換
avr-c++filt
コード化されたC++シンボルのデマングルためのフィルタ

avr-libc

GCCとBinutilsはソフトウェアを開発するための多くのツールを提供しています。しかし、彼らが提供しない1つの重要な構成要素があり、それは標準Cライブラリです。

ネイティブ・コンパイラ(GNU Libc)のために、若干の他の埋め込まれたシステム(newlib)のために、または、Linux(uCLibc)の若干のバージョンのためにあるかどうかにかかわらず、あなたのシステム時間によって標準Cライブラリを提供する異なるオープンソースのプロジェクトがあります。 オープンソースのAVRツールチェーンは、自身の標準Cライブラリプロジェクト avr-libc があります。

AVR-Libcは、標準の標準Cライブラリで見つかる多くの同じ関数と、AVR特有の多くの追加的なライブラリ関数を提供する。Some of the Standard C Library functions that are commonly used on a PC environment have limitations or additional issues that a user needs to be aware of when used on an embedded system.

AVR-Libcは、全部のAVR ツールチェーンについて多くのドキュメントを含みます。

Building Software

Even though GCC, Binutils, and avr-libc are the core projects that are used to build software for the AVR, there is another piece of software that ties it all together: Make. GNU Make is a program that makes things, and mainly software. Make interprets and executes a Makefile that is written for a project. A Makefile contains dependency rules, showing which output files are dependent upon which input files, and instructions on how to build output files from input files.

Some distributions of the toolchains, and other AVR tools such as MFile, contain a Makefile template written for the AVR toolchain and AVR applications that you can copy and modify for your application.

詳細は、GNU Make User Manualを見てください。

AVRDUDE

After creating your software, you'll want to program your device. You can do this by using the program AVRDUDE which can interface with various hardware devices to program your processor.

AVRDUDE is a very flexible package. All the information about AVR processors and various hardware programmers is stored in a text database. This database can be modified by any user to add new hardware or to add an AVR processor if it is not already listed.

GDB / Insight / DDD

The GNU Debugger (GDB) is a command-line debugger that can be used with the rest of the AVR toolchain. Insight is GDB plus a GUI written in Tcl/Tk. Both GDB and Insight are configured for the AVR and the main executables are prefixed with the target name: avr-gdb, and avr-insight. There is also a "text mode" GUI for GDB: avr-gdbtui. DDD (Data Display Debugger) is another popular GUI front end to GDB, available on Unix and Linux systems.

AVaRICE

AVaRICE is a back-end program to AVR GDB and interfaces to the Atmel JTAG In-Circuit Emulator (ICE), to provide emulation capabilities.

SimulAVR

SimulAVRは、AVR GDBをバックエンドとしてたAVRシミュレーターです。残念なことに、このプロジェクトは現在メンテナンスされていませんが、少なからず役立つかもしれません。

ユーティリティ

There are also other optional utilities available that may be useful to add to your toolset.

SRecord is a collection of powerful tools for manipulating EPROM load files. It reads and writes numerous EPROM file formats, and can perform many different manipulations.

MFile is a simple Makefile generator is meant as an aid to quickly customize a Makefile to use for your AVR application.

Toolchain Distributions (Distros)

All of the various open source projects that comprise the entire toolchain are normally distributed as source code. It is left up to the user to build the tool application from its source code. This can be a very daunting task to any potential user of these tools.

Luckily there are people who help out in this area. Volunteers take the time to build the application from source code on particular host platforms and sometimes packaging the tools for convenient installation by the end user. These packages contain the binary executables of the tools, pre-made and ready to use. These packages are known as "distributions" of the AVR toolchain, or by a more shortened name, "distros".

AVR toolchain distros are available on FreeBSD, Windows, Mac OS X, and certain flavors of Linux.

オープンソース

All of these tools, from the original source code in the multitude of projects, to the various distros, are put together by many, many volunteers. All of these projects could always use more help from other people who are willing to volunteer some of their time. There are many different ways to help, for people with varying skill levels, abilities, and available time.

You can help to answer questions in mailing lists such as the avr-gcc-list, or on forums at the AVR Freaks website. This helps many people new to the open source AVR tools.

If you think you found a bug in any of the tools, it is always a big help to submit a good bug report to the proper project. A good bug report always helps other volunteers to analyze the problem and to get it fixed for future versions of the software.

You can also help to fix bugs in various software projects, or to add desirable new features.

ボランティアは、いつもウェルカムです! :-)


Automatically generated by Doxygen 1.7.2 on Wed Feb 16 2011.

翻訳更新:2011年10月8日 by cega