overview(3)
๐ overview โ Toolchain Overview ๐
okay bestie, welcome to overview(3), straight outta the avr-libc manual ๐ this is the big-picture tour of the whole AVR toolchain, no code required, just vibes and โจknowledgeโจ
๐ธ NAME ๐ธ
overview โ Toolchain Overview
๐ฆ Introduction ๐ฆ
Welcome to the open source software development toolset for the Atmel AVR! ๐
Real talk: there is not a single tool that provides everything needed to develop software for the AVR. It takes many tools working together. Collectively, that group of tools is called a toolset, or commonly a toolchain โ because the tools are literally chained together to produce the final executable application for the AVR microcontroller. ๐
The following sections give you an overview of all of these tools. Maybe you're used to cross-compilers that hand you everything with a GUI front-end, and you have zero idea what goes on 'underneath the hood'. Maybe you're coming from a desktop or server computer background and embedded systems are not your usual thing. Or maybe you're just now learning about the most common software development toolchain available on Unix and Linux systems. Hopefully this overview helps put everything in perspective. ๐ซถ
๐ FSF and 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's 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 a 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 of them 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
- 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's known as a native compiler. If a compiler has different systems for host and target, it's known as a cross-compiler. (And if all three โ build, host, and target systems โ are different, it's 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's built to generate code for the AVR microcontroller target, then it's 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 ๐
The name GNU Binutils stands for 'Binary Utilities'. It contains the GNU assembler (gas), and the GNU linker (ld), but also contains many other utilities that work with binary files that are created as part of the software development toolchain. ๐งฐ
Again, when these tools are built for the AVR target, the actual program names are prefixed with 'avr-'. For example, the assembler program name, for a native assembler, is 'as' (even though in documentation the GNU assembler is commonly referred to as 'gas'). But when built for an AVR target, it becomes 'avr-as'. Below is a list of the programs that are included in Binutils: ๐
avr-asโ The Assembler.avr-ldโ The Linker.avr-arโ Create, modify, and extract from libraries (archives).avr-ranlibโ Generate index to library (archive) contents.avr-objcopyโ Copy and translate object files to different formats.avr-objdumpโ Display information from object files including disassembly.avr-sizeโ List section sizes and total size.avr-nmโ List symbols from object files.avr-stringsโ List printable strings from files.avr-stripโ Discard symbols from files.avr-readelfโ Display the contents of ELF format files.avr-addr2lineโ Convert addresses to file and line.avr-c++filtโ Filter to demangle encoded C++ symbols.
๐ avr-libc ๐
GCC and Binutils provide a lot of the tools to develop software, but there is one critical component that they do not provide: a Standard C Library. ๐ฑ
There are different open source projects that provide a Standard C Library depending upon your system โ whether for a native compiler (GNU Libc), for some other embedded system (newlib), or for some versions of Linux (uCLibc). The open source AVR toolchain has its own Standard C Library project: avr-libc. ๐
AVR-Libc provides many of the same functions found in a regular Standard C Library, and many additional library functions that are specific to an 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 also contains the most documentation about the whole AVR toolchain. ๐
๐ง 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. ๐
See the GNU Make User Manual for more information.
๐ 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 is an AVR simulator used as a back-end with AVR GDB. ๐ฎ
๐ Utilities ๐
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, 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 package 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. ๐
โจ Open Source โจ
Okay bestie, gather round, because this is the part where I get emo in the best way. ๐ฅน
Every single one of these tools โ from the raw original source code across that whole multitude of projects, all the way to the various distros you're probably using right now โ is put together by many, many volunteers. Like, real humans. Giving away their time. For free. No cap.
And here's the tea: all of these projects could ALWAYS use more help from other people who are willing to volunteer some of their time. ๐ซถ
The genuinely slay part? There are many different ways to help, for people with varying skill levels, abilities, and available time. So no "oh but I'm not good enough" โ literally not the vibe. There's a lane for you. ๐ฆ
Ways to be a main character ๐
- 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 so many people who are new to the open source AVR tools, and honestly it's giving community. ๐ธ - 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. So write it up nicely, bestie โ that report is a gift. ๐
- You can also help to fix bugs in various software projects, or to add desirable new features. ๐
No pressure though, fr fr โ do what you can, when you can. Every single bit counts.
Volunteers are always welcome! :-) ๐โจ
And that's a wrap on overview(3), bestie! This one's Version 2.1.0, dated Sat Jan 29 2022 โ so if you're reading it, shout out to everyone who wrote it, and heyโฆ maybe that's you next time. ๐ Go be iconic. ๐
๐ฆ where this page comes from
- fedora 43: avr-libc 2.2.1-3.fc43 ยท BSD-3-Clause
- fedora 44: avr-libc 2.2.1-5.fc44 ยท BSD-3-Clause
- opensuse-leap 16.0: avr-libc 2.1.0-bp160.1.33 ยท BSD-3-Clause
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms