Description
In a custom core, I have tried changing the platform.txt definitions for avrdude. No change I make in platform.txt to the tools.* directives (including deleting them entirely) has any effect on behavior.
Similarly, in boards.txt, no matter what I put after
boardname.upload.tool=
it still stubbornly goes for avrdude in the default location with the default conf file
However, if I omit the line entirely, it refuses to work, even through whatever I pass it is being ignored.
I've been having a hell of a time with this, and I'd really like to be able to distribute a core with it's own avrdude.conf file, so I can support new chips that are not in the avrdude.conf that comes with arduino. It sounds like this should be possible, but it just doesn't seem to work. Am I doing something wrong?
boards.txt (relevant excerpt)
menu.chip=Chip
menu.clock=Clock
menu.bod=B.O.D.
attinyx41.name=ATtinyx41
attinyx41.upload.tool=totallynot
attinyx41.bootloader.tool=totallynot
attinyx41.bootloader.unlock_bits=0xFF
attinyx41.bootloader.lock_bits=0xFF
attinyx41.build.core=tiny
attinyx41.menu.chip.841=ATtiny841
attinyx41.menu.chip.841.build.mcu=attiny841
attinyx41.menu.chip.841.upload.maximum_size=8192
attinyx41.menu.chip.841.upload.maximum_data_size=512
attinyx41.menu.chip.441=ATtiny441
attinyx41.menu.chip.441.build.mcu=attiny441
attinyx41.menu.chip.441.upload.maximum_size=4096
attinyx41.menu.chip.441.upload.maximum_data_size=256
attinyx41.menu.chip.241=ATtiny241
attinyx41.menu.chip.241.build.mcu=attiny241
attinyx41.menu.chip.241.upload.maximum_size=2048
attinyx41.menu.chip.241.upload.maximum_data_size=256
attinyx41.menu.clock.16external=16 MHz (external)
attinyx41.menu.clock.16external.bootloader.low_fuses=0xEE
attinyx41.menu.clock.16external.build.f_cpu=16000000L
attinyx41.menu.clock.16external.bootloader.file=empty/empty_all.hex
attinyx41.menu.clock.12external=12 MHz (external)
attinyx41.menu.clock.12external.bootloader.low_fuses=0xEE
attinyx41.menu.clock.12external.build.f_cpu=12000000L
attinyx41.menu.clock.12external.bootloader.file=empty/empty_all.hex
attinyx41.menu.clock.8internal=8 MHz (internal)
attinyx41.menu.clock.8internal.bootloader.low_fuses=0xE2
attinyx41.menu.clock.8internal.build.f_cpu=8000000L
attinyx41.menu.clock.8internal.bootloader.file=empty/empty_all.hex
attinyx41.menu.clock.8external=8 MHz (external)
attinyx41.menu.clock.8external.bootloader.low_fuses=0xEE
attinyx41.menu.clock.8external.build.f_cpu=8000000L
attinyx41.menu.clock.8external.bootloader.file=empty/empty_all.hex
attinyx41.menu.clock.1internal=1 MHz (internal)
attinyx41.menu.clock.1internal.bootloader.low_fuses=0x62
attinyx41.menu.clock.1internal.build.f_cpu=1000000L
attinyx41.menu.clock.1internal.bootloader.file=empty/empty_all.hex
attinyx41.menu.clock.20external=20 MHz (external - overclocked)
attinyx41.menu.clock.20external.bootloader.low_fuses=0xEE
attinyx41.menu.clock.20external.build.f_cpu=20000000L
attinyx41.menu.clock.20external.bootloader.file=empty/empty_all.hex
attinyx41.menu.bod.disable=B.O.D. Disabled
attinyx41.menu.bod.disable.bootloader.extended_fuses=0xFF
attinyx41.menu.bod.disable.bootloader.high_fuses=0xD7
attinyx41.menu.bod.1v8=B.O.D. Enabled (1.8v)
attinyx41.menu.bod.1v8.bootloader.extended_fuses=0xED
attinyx41.menu.bod.1v8.bootloader.high_fuses=0xD7
attinyx41.menu.bod.2v7=B.O.D. Enabled (2.7v)
attinyx41.menu.bod.2v7.bootloader.extended_fuses=0xED
attinyx41.menu.bod.2v7.bootloader.high_fuses=0xD5
attinyx41.menu.bod.4v3=B.O.D. Enabled (4.3v)
attinyx41.menu.bod.4v3.bootloader.extended_fuses=0xED
attinyx41.menu.bod.4v3.bootloader.high_fuses=0xD4
Platform.txt (have also tried just calling it avrdude)
# Arduino AVR Core and platform.
# ------------------------------
# For more info:
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
name=ATtiny Modern
version=1.6.0
# AVR compile variables
# ---------------------
# Default "compiler.path" is correct, change only if you want to overidde the initial value
compiler.path={runtime.ide.path}/hardware/tools/avr/bin/
compiler.c.cmd=avr-gcc
compiler.c.flags=-c -g -Os -w -ffunction-sections -fdata-sections -MMD
# -w flag added to avoid printing a wrong warning http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59396
# This is fixed in gcc 4.8.3 and will be removed as soon as we update the toolchain
compiler.c.elf.flags=-w -Os -Wl,--gc-sections
compiler.c.elf.cmd=avr-gcc
compiler.S.flags=-c -g -x assembler-with-cpp
compiler.cpp.cmd=avr-g++
compiler.cpp.flags=-c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD
compiler.ar.cmd=avr-ar
compiler.ar.flags=rcs
compiler.objcopy.cmd=avr-objcopy
compiler.objcopy.eep.flags=-O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0
compiler.elf2hex.flags=-O ihex -R .eeprom
compiler.elf2hex.cmd=avr-objcopy
compiler.ldflags=
compiler.size.cmd=avr-size
# This can be overriden in boards.txt
build.extra_flags=
# These can be overridden in platform.local.txt
compiler.c.extra_flags=
compiler.c.elf.extra_flags=
compiler.S.extra_flags=
compiler.cpp.extra_flags=
compiler.ar.extra_flags=
compiler.objcopy.eep.extra_flags=
compiler.elf2hex.extra_flags=
# AVR compile patterns
# --------------------
## Compile c files
recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.c.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
## Compile c++ files
recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
## Compile S files
recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.S.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.S.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
## Create archives
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}"
## Combine gc-sections, archives, and objects
recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} -mmcu={build.mcu} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" {object_files} "{build.path}/{archive_file}" "-L{build.path}" -lm
## Create eeprom
recipe.objcopy.eep.pattern="{compiler.path}{compiler.objcopy.cmd}" {compiler.objcopy.eep.flags} {compiler.objcopy.eep.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.eep"
## Create hex
recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex"
## Compute size
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
recipe.size.regex=^(?:\.text|\.data|\.bootloader)\s+([0-9]+).*
recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).*
recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).*
# AVR Uploader/Programmers tools
# ------------------------------
tools.totallynot.cmd.path={runtime.ide.path}/hardware/tools/avr/bin/avrdude
tools.totallynot.config.path={runtime.hardware.path}/avrdude.conf
tools.totallynot.upload.params.verbose=-v
tools.totallynot.upload.params.quiet=-q -q
tools.totallynot.upload.pattern="{cmd.path}" "-C{config.path}" {upload.verbose} -p{build.mcu} -c{upload.protocol} -P{serial.port} -b{upload.speed} -D "-Uflash:w:{build.path}/{build.project_name}.hex:i"
tools.totallynot.program.params.verbose=-v
tools.totallynot.program.params.quiet=-q -q
tools.totallynot.program.pattern="{cmd.path}" "-C{config.path}" {program.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{build.path}/{build.project_name}.hex:i"
tools.totallynot.erase.params.verbose=-v
tools.totallynot.erase.params.quiet=-q -q
tools.totallynot.erase.pattern="{cmd.path}" "-C{config.path}" {erase.verbose} -p{build.mcu} -c{protocol} {program.extra_params} -e -Ulock:w:{bootloader.unlock_bits}:m -Uefuse:w:{bootloader.extended_fuses}:m -Uhfuse:w:{bootloader.high_fuses}:m -Ulfuse:w:{bootloader.low_fuses}:m
tools.totallynot.bootloader.params.verbose=-v
tools.totallynot.bootloader.params.quiet=-q -q
tools.totallynot.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verbose} -p{build.mcu} -c{protocol} {program.extra_params} "-Uflash:w:{runtime.platform.path}/bootloaders/{bootloader.file}:i" -Ulock:w:{bootloader.lock_bits}:m
# USB Default Flags
# Default blank usb manufacturer will be filled it at compile time
# - from numeric vendor ID, set to Unknown otherwise
build.usb_manufacturer=
build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} '-DUSB_MANUFACTURER={build.usb_manufacturer}' '-DUSB_PRODUCT={build.usb_product}'
Yet I still get
Sketch uses 382 bytes (9%) of program storage space. Maximum is 4,096 bytes.
Global variables use 9 bytes (3%) of dynamic memory, leaving 247 bytes for local variables. Maximum is 256 bytes.
C:\arduino-1.6.3\hardware\tools\avr/bin/avrdude -CC:\arduino-1.6.3\hardware\tools\avr/etc/avrdude.conf -v -pattiny441 -cusbasp -Pusb -Uflash:w:C:\Users\a2\AppData\Local\Temp\build5639649148410942104.tmp/sketch_jul04a.cpp.hex:i
avrdude: Version 6.0.1, compiled on Mar 30 2015 at 14:56:06
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "C:\arduino-1.6.3\hardware\tools\avr/etc/avrdude.conf"
avrdude: AVR Part "attiny441" not found.
(note that attiny441 is defined in the avrdude.conf I'm pointing it at - but that's not the one it's using!)
Thanks