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 is pretty easy, though there could be some incompatibilities with certain libraries. Only tested with Arduino 1.8.13.
- Download and extract the latest release
- Navigate to your Arduino IDE folder
- Go to
hardware/tools
- 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) - Move the extracted folder from earlier to the
tools
folder and rename it toavr
- Copy
bin/avrdude.exe
andbuiltin_tools_versions.txt
files andetc
folder from the oldavr
folder to the new one - Done! Open up the Arduino IDE, load up the Blink example, upload it to your Arduino and make sure the LED is blinking!
The script can be ran by itself or within a Docker container.
docker build -t avrgccbuild .
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.
The build script automatically merges the avr-libc
directory with each of the toolchain folders, so you can delete it when it's all done.
Variable | Default | Description |
---|---|---|
JOBCOUNT |
Number of CPU cores your system has | More 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 |
BASE |
Docker: /avr-gcc-build/build/ Standalone: [cwd]/build/ |
Output directory (must have trailing slash) |
VER_GCC |
12.1.0 |
GCC version |
VER_BINUTILS |
2.38 |
Binutils version |
VER_GDB |
12.1 |
GDB version |
FOR_LINUX |
1 |
Build 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_WINX86 |
1 |
Build for 32 bit Windows |
FOR_WINX64 |
1 |
Build for 64 bit Windows |
BUILD_BINUTILS |
1 |
Build Binutils for selected OSs |
BUILD_GCC |
1 |
Build GCC for selected OSs (requires AVR-Binutils) |
BUILD_GDB |
1 |
Build GDB for selected OSs |
BUILD_LIBC |
1 |
Build 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
Use avr-objdump -Pmem-usage <yourfirmware>.elf
instead. See ZakKemble#3