Cannot build firmware for Arduino Uno

None of the other solutions worked for me to configure my Uno for the adxl345. I’m using Ubuntu, and klich3’s Buster fix just kept giving me errors when trying to sudo apt-get update. These steps are what I found worked for me, which I could not find anywhere else, so I will post them here in hopes that it helps someone save hours trying to get theirs to work. This is all done from a terminal window on the computer (or pi) with klipper:

cd ~/klipper
make menuconfig

-configure for the uno (atmega328p in my case), no changes to defaults for this chip. Exit and save

nano .config

-change anything you don’t need from y to n. For me this was:

CONFIG_WANT_GPIO_BITBANGING=n
CONFIG_WANT_DISPLAYS=n
CONFIG_WANT_SOFTWARE_I2C=n
CONFIG_HAVE_GPIO_ADC=n
CONFIG_HAVE_GPIO_I2C=n
CONFIG_HAVE_GPIO_HARD_PWM=n
CONFIG_INLINE_STEPPER_HACK=n

ctrl+s and ctrl+x to save and close

Some people have said that this is enough to get it to work for them, so try to compile again here:

make clean
make

This still gave me errors when trying to compile, so I had to do the next steps:

nano src/Makefile

Find the line that says:

sensors-src-$(CONFIG_HAVE_GPIO_SPI) := thermocouple.c sensor_adxl345.c \
    sensor_angle.c

and change it so that it only has sensor_adxl345.c, with the rest commented out.
You will want to change this back after, or other compilations will not have the other sensors (this may not be a problem depending on your printer)

sensors-src-$(CONFIG_HAVE_GPIO_SPI) := sensor_adxl345.c #thermocouple.c sensor_adxl345.c \
    #sensor_angle.c

after this, ctrl+s ctrl+x, and run

make clean
make

and it should compile with no memory/flash size related errors

edit for formatting

3 Likes