Home

Awesome

AVR-GCC

This is where I'll be uploading builds of AVR-GCC for Windows 32 bit, 64 bit and Linux 64 bit, which will also include Binutils, AVR-LibC, AVRDUDE, Make and GDB. I'll be trying to keep the builds up to date with the latest tool releases when I can.

The avr-gcc-build.sh script was originally a gist, which I've now turned into a repository so releases can be uploaded to GitHub rather than having them hosted on my website.

Upgrading the Arduino IDE

Upgrading the Arduino IDE is pretty easy, though there could be some incompatibilities with certain libraries. Only tested with Arduino 1.8.13.

  1. Download and extract the latest release
  2. Navigate to your Arduino IDE folder
  3. Go to hardware/tools
  4. Move the avr folder somewhere else, like to your desktop (renaming the folder won't work, Arduino has some auto-detect thing which sometimes gets confused)
  5. Move the extracted folder from earlier to the tools folder and rename it to avr
  6. Copy bin/avrdude.exe and builtin_tools_versions.txt files and etc folder from the old avr folder to the new one
  7. Done! Open up the Arduino IDE, load up the Blink example, upload it to your Arduino and make sure the LED is blinking!

Docker

The script can be ran by itself or within a Docker container.

Build Image

docker build -t avrgccbuild .

Run Container

docker run --rm -it -v "$(pwd)"/output:/output avrgccbuild

On Windows replace $(pwd) with %cd%:

docker run --rm -it -v "%cd%"/output:/output avrgccbuild

You will find the built toolchains in the output directory of your current working directory.

Environment Variables

VariableDefaultDescription
JOBCOUNTNumber of CPU cores your system hasMore jobs require more RAM, so if you get errors like collect2: fatal error: ld terminated with signal 9 [Killed] then you may need to reduce the job count
BASEDocker: /avr-gcc-build/build/<br>Standalone: [cwd]/build/Output directory (must have trailing slash)
VER_GCC14.1.0GCC version
VER_BINUTILS2.42Binutils version
VER_GDB14.2GDB version
FOR_LINUX1Build for Linux. A Linux AVR-GCC toolchain is required to build a Windows toolchain. If the Linux toolchain has already been built then you can set this to 0. This is a bit broken at the moment and should stay as 1
FOR_WINX860Build for 32 bit Windows
FOR_WINX641Build for 64 bit Windows
BUILD_BINUTILS1Build Binutils for selected OSs
BUILD_GCC1Build GCC for selected OSs (requires AVR-Binutils)
BUILD_GDB1Build GDB for selected OSs
BUILD_LIBC1Build AVR-LibC (requires AVR-GCC)

Change environment variables by passing the -e option when running the Docker container:

docker run --rm -it -v "$(pwd)"/output:/output -e VER_GCC="10.1.0" -e BUILD_GDB=0 avrgccbuild

FAQs

avr-size does not show percent used / is missing the -C or --mcu option

Use avr-objdump -Pmem-usage <yourfirmware>.elf instead. See https://github.com/ZakKemble/avr-gcc-build/issues/3