Skip to content

board.*.tool in boards.txt and tools directives in platforms.txt are ignored #3463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SpenceKonde opened this issue Jul 4, 2015 · 2 comments
Labels
arduino-builder The tool used to handle the Arduino sketch compilation process Type: Bug Type: Invalid Off topic for this repository, or a bug report determined to not actually represent a bug

Comments

@SpenceKonde
Copy link

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

@ffissore ffissore self-assigned this Jul 6, 2015
@ffissore ffissore added this to the Release 1.6.6 milestone Jul 6, 2015
@ffissore ffissore added the Component: Toolchain The tools used for compilation and uploading to Arduino boards label Jul 6, 2015
@ffissore ffissore modified the milestones: Release 1.6.6, 1.6.7 Nov 4, 2015
@ffissore
Copy link
Contributor

@SpenceKonde latest 1.6.6 bundles a new tool for compiling, named arduino-builder. Can you give 1.6.6 (or, better, the hourly) a try and report if it works?

@ffissore ffissore added the Waiting for feedback More information must be provided before we can proceed label Nov 20, 2015
@ffissore ffissore modified the milestone: Release 1.6.7 Dec 14, 2015
@sandeepmistry
Copy link
Contributor

I'm closing this due to lack of feedback. Please re-open with requested info if you are still interested.

@cmaglie cmaglie removed the Waiting for feedback More information must be provided before we can proceed label Oct 18, 2016
@per1234 per1234 added arduino-builder The tool used to handle the Arduino sketch compilation process Type: Bug Type: Invalid Off topic for this repository, or a bug report determined to not actually represent a bug and removed Component: Toolchain The tools used for compilation and uploading to Arduino boards labels Dec 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arduino-builder The tool used to handle the Arduino sketch compilation process Type: Bug Type: Invalid Off topic for this repository, or a bug report determined to not actually represent a bug
Projects
None yet
Development

No branches or pull requests

5 participants