Arduino Nano programming in 2023, obsolescence be damned

I’m working on a little PCB for a robotics competition. It is used by the competition volunteers to time races between competing robots. Cool!

The design is based on an Arduino Nano to keep things easy…. in theory. In practice, I couldn’t get a modern (or even outdated) version of the Arduino IDE to program this thing. It’s a common theme in the forums. Anyway, as a service to my future self and any other future selves, here is how I got it working, despite Arduino’s lack of care or interest in supporting their products:

  1. Abandon using the USB interface. I tried this on 3 operating systems & 3 versions of the Arduino IDE, I could not get it to work. According to legend, sometimes it may start working after a lot of wasted time. In these rare cases, nobody seems to know how they did it.
  2. Use an ISP programmer. Hopefully yours is not the Olimex avr-isp-mk2. This is what I have, and it is effectively not supported by Arduino since version 1.5.x
  3. For Linux users with the Olimex programmer:
    1. Download the source for avrdude (get version 6.4 from http://download.savannah.gnu.org/releases/avrdude/)
    2. Extract the source archive, enter the directory
    3. Apply this patch https://www.olimex.com/Products/AVR/Programmers/AVR-ISP-MK2/resources/endpointdetect_pass1.patch
      1. cd to avrdude[…] folder
      2. patch -p0 < endpointdetect_pass1.patch
    4. ./configure && make all
  4. I recommend using the legacy 1.8.x IDE from https://wiki-content.arduino.cc/en/software. Download that, extract the archive. Newer versions of the IDE seem to hang indefinitely on a vague loading screen.
  5. Applies to Olimex programmer: Find the avrdude executable included in the arduino archive. Replace it with your new compiled one
    1. find . -name ‘avrdude’
    2. it should be at hardware/tools/avr/bin
    3. use the ln command to link your compiled avrdude into this location. This replaces their older incompatible version with your newly patched binary
      1. ln -sf /path/to/your/src/avrdude/avrdude ./hardware/tools/avr/bin/avrdude
  6. You can now run ./arduino from the Arduino legacy archive – this was enough to get it working on my end
  7. In the Arduino IDE, upload the sketch by selecting your programmer from ‘Tools > Programmer’, and upload the sketch by using ‘Sketch > Upload using programmer’

Other things you may have to do on Linux systems: install a udev rule for the Olimex programmer, and add yourself to the appropriate group (probably dialout). See Olimex link below.

If you are on Windows with the Olimex interface – compiling will be different to some degree, but ultimately you still replace the avrdude executable to fix the issue.

If you are also stuck with the Olimex interface (why am I still using this thing??), there’s much more info here: https://www.olimex.com/forum/index.php?topic=5358.0