overview(3avr)
π overview(3avr) π
okay bestie, welcome to overview β the Toolchain Overview. This is the orientation episode. Sit down, grab a snack, we're meeting the whole friend group π
β¨ Introduction β¨
Welcome to the open source software development toolset for the Microchip (formerly Atmel) AVR! π«Ά
There is not a single tool that provides everything needed to develop software for the AVR. It takes many tools working together. Collectively, the 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. it's giving relay race, it's giving group project that actually works π
The following sections provide an overview of all of these tools. Maybe you're used to cross-compilers that provide everything with a GUI front-end, and you have no 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 Vibe. Or maybe you're just now learning about the most common software development toolchain available on Unix and Linux systems. Hopefully the following overview will be helpful in putting 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. iconic behavior honestly π
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 πΆ (yes really. say it out loud. guh-noo.)
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 share a common "middle-end", containing the generic parts of the compiler, including a lot of optimizations. middle-end is the main character and nobody talks about it π
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. Let's break that down, because this is the part everyone fumbles:
- 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. iykyk π«
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. it does one job and it does it gorgeously β¨
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. chauffeur energy fr fr π
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 β the whole squad, no gatekeeping π«Ά
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. and like... hello?? how are we supposed to printf π
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. β οΈ read the docs bestie, they're not warning you for fun
AVR-LibC also contains the most documentation about the whole AVR toolchain. the lore archive πΈ
π§ 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. this is where the software leaves your laptop and touches real silicon, no cap π₯
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. go ahead, edit the database, you have the power π
π 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 AVR JTAG In-Circuit Emulator (ICE), to provide emulation capabilities.
β SimulAVR β
SimulAVR is an AVR simulator used as a back-end with AVR GDB. pretend chip, real vibes β¨
π 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. π building from source with zero hand-holding is a whole personality test
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". shoutout to the volunteers, actual angels π«Άπ
AVR toolchain distros are available on FreeBSD, Windows, Mac OS X, and certain flavors of Linux.
π Open Source π
so likeβ¦ every single one of these tools? all of them β from the original source code across that whole multitude of projects, all the way through the various distros β got put together by many, many volunteers. π like, actual humans, giving actual hours, for the love of it.
and bestie, every one 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. so yes, that includes you, and no, you don't have to be a 10x kernel wizard to show up. π
β¨ ways to be that girl (for open source) β¨
- Answer questions π¬ β hop into mailing lists such as the
avr-gcc-list, or onto the forums over at the AVR Freaks website. this one helps so many people who are new to the open source AVR tools, and honestly it's giving generous. - File a good bug report π β if you think you found a bug in any of the tools, submitting a good bug report to the proper project is always a big help. a good bug report always helps other volunteers analyze the problem and get it fixed for future versions of the software. π
- Actually fix the bugs π§ β you can also help fix bugs in various software projects, or add desirable new features. main character energy, truly. π
- Show up, periodt. β Volunteers are always welcome! :-) π
no cap, this whole ecosystem runs on people deciding to care. lowkey iconic. ππΈ
so that's the vibe, bestie β go break something, fix something, and ask the questions nobody else asked yet. π¦
this lil' page came to you from AVR-LibC, version 2.2.1, and it's the overview(3avr) page. mwah. πβ¨π
π¦ where this page comes from
- ubuntu resolute: avr-libc 1:2.2.1-1build1 Β· BSD-3-Clause
- ubuntu stonking: avr-libc 1:2.2.1-1build1 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms