Hi all, I'm looking at adding support for a few AVR-based boards to the new 1.6.x series IDE but am running into trouble getting the IDE to pick up a custom avrdude.conf and am curious if anyone has advice or ideas to resolve the issue. For some background I'm using Arduino 1.6.2 linux 64 bit and have added a hierarchy of new custom boards following the info from
here and
here (great resources, thanks for providing them!).
Inside my IDE's hardware folder I have a file structure setup that looks like this:
./adafruit/avr/boards.txt = my custom boards configuration
./adafruit/avr/platform.txt = my custom platform configuration
./adafruit/avr/variants/... = a few custom variants that some of the boards use
./adafruit/avr/tools/avrdude.conf = a custom avrdude.conf (more on that below)
The boards I've defined show up as expected in the Arduino IDE board list, but the problem comes when trying to upload to them. My boards.txt defines a few ATtiny85-based boards (Adafruit Gemma, Trinket, etc.) that look like for example:
gemma.bootloader.low_fuses=0xF1
gemma.bootloader.high_fuses=0xD5
gemma.bootloader.extended_fuses=0xFE
gemma.bootloader.tool=avrdude
gemma.build.mcu=attiny85
gemma.build.f_cpu=8000000L
gemma.build.core=arduino:arduino
gemma.build.variant=tiny8
gemma.build.board=AVR_GEMMA
gemma.upload.tool=avrdude
gemma.upload.maximum_size=5310
To program this board avrdude's configuration needs to be updated slightly for the ATtiny85 to bump up some of the delays, like the chip erase delay increased from 4500 uS to 400 mS. In the old 1.0.x IDE this was done by providing a completely new avrdude.conf that overwrote the file in the hardware/tools path. However in the new 1.6.x IDE it looks like the right way to override the avrdude.conf is to do so with some configuration in my platform.txt (but let me know if that's wrong please). Assuming I'm on the right path, I wrote a platform.txt that overrides the tools.avrdude.config.path value and looks like:
name=Adafruit Boards
version=1.0.0
tools.avrdude.config.path={runtime.ide.path}/hardware/adafruit/avr/tools/avrdude.conf
That adafruit/avr/tools/avrdude.conf path points to my custom avrdude.conf file, which is just a copy I made of the current avrdude 6.0 config that the normal Arduino cores use but with a few tweaks to bump up the necessary ATtiny85 delays.
The problem I'm running into is that the IDE doesn't seem to be using my custom avrdude.conf configuration on upload. When I turn on verbose upload info I can see avrdude is using the default chip erase delay of 4500 uS instead of my custom 400 mS value and the upload fails. I can also see the path to the configuration file being used (it's in a hidden folder under my home, .arduino15/packages/arduino/tools/avrdude/6.0.1-arduino2/etc/avrdude.conf) and when I look inside the file it looks like it's just the stock avrdude.conf without any of my changes.
If I manually edit the hidden config file above and put in my custom delays I can upload the boards just fine, so it definitely looks like the problem is my custom avrdude.conf not being used for some reason. However for some reason even though my platform.txt overrides the avrdude config path I don't see the custom config being used.
I'm curious has anyone run into this issue before and have a workaround? Am I doing something totally wrong with trying to override the avrdude.conf in the 1.6.x series IDE? Let me know if anyone has advice, thanks!
-Tony