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:
- 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.
- 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
- For Linux users with the Olimex programmer:
- Download the source for avrdude (get version 6.4 from http://download.savannah.gnu.org/releases/avrdude/)
- Extract the source archive, enter the directory
- Apply this patch https://www.olimex.com/Products/AVR/Programmers/AVR-ISP-MK2/resources/endpointdetect_pass1.patch
- cd to avrdude[…] folder
- patch -p0 < endpointdetect_pass1.patch
- ./configure && make all
- 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.
- Applies to Olimex programmer: Find the avrdude executable included in the arduino archive. Replace it with your new compiled one
- find . -name ‘avrdude’
- it should be at hardware/tools/avr/bin
- use the ln command to link your compiled avrdude into this location. This replaces their older incompatible version with your newly patched binary
- ln -sf /path/to/your/src/avrdude/avrdude ./hardware/tools/avr/bin/avrdude
- You can now run ./arduino from the Arduino legacy archive – this was enough to get it working on my end
- 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