Closed fabuloussilicon closed 9 years ago
For reference, I also wanted to add that I'm using version 1.5.7.
It seems that what you're trying should be supported. For example, looking at the board definition for the Diecimilla, which supports two CPU types which also use different uploader speeds.
Compare https://github.com/arduino/Arduino/blob/ide-1.5.x/hardware/arduino/avr/boards.txt#L93 and https://github.com/arduino/Arduino/blob/ide-1.5.x/hardware/arduino/avr/boards.txt#L99 with https://github.com/arduino/Arduino/blob/ide-1.5.x/hardware/arduino/avr/boards.txt#L107 https://github.com/arduino/Arduino/blob/ide-1.5.x/hardware/arduino/avr/boards.txt#L113.
In platform.txt, these upload.speed
and build.mcu
variables are again used in the avrdude command: https://github.com/arduino/Arduino/blob/ide-1.5.x/hardware/arduino/avr/platform.txt#L85
Your boards.txt lines look ok to me. Perhaps the underscores or mixed casing is causing a problem (just guessing)?
I think you have a custom platform.txt too, perhaps the problem is in there?
Thanks for the fast response :-)
Indeed I've been using the Diecimilla entries as a reference, I'll try playing with the casing and underscores to see if that makes any difference. Here's my platform.txt file:
# Arduino AVR Core and platform.
# ------------------------------
# For more info:
# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification
name=Fabulous Silicon Cyber Cortex AV
version=1.5.6
# 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
compiler.c.elf.flags=-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 -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=
CC
# AVR compile patterns
# --------------------
C
## 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} {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} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
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} {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} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
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} {build.extra_flags} {includes} "{source_file}" -o "{object_file}"
## Create archives
recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.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} -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} "{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} "{build.path}/{build.project_name}.elf" "{sketchbook.path}/hardware/Fabulous Silicon/CyberCortexAV/Hex File Repository/{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.Arduino2CorePack.upload.params.verbose=-v -v -v -v
tools.Arduino2CorePack.upload.params.quiet=-q -q
tools.Arduino2CorePack.upload.params.verbose=-v
tools.Arduino2CorePack.cmd.path.windows= {runtime.hardware.path}/CyberCortexAV/tools/Windows/Arduino2CorePack
tools.Arduino2CorePack.cmd.path.linux= {runtime.hardware.path}/CyberCortexAV/tools/Linux/Arduino2CorePack
tools.Arduino2CorePack.cmd.path.macosx= {runtime.hardware.path}/CyberCortexAV/tools/Mac/Arduino2CorePack
tools.Arduino2CorePack.upload.pattern= "{cmd.path}" -{upload.protocol} " {sketchbook.path}/hardware/Fabulous Silicon/CyberCortexAV/Hex File Repository/{build.project_name}.hex"
tools.Arduino2CorePack.program.pattern= "{cmd.path}" -{upload.protocol} " {sketchbook.path}/hardware/Fabulous Silicon/CyberCortexAV/Hex File Repository/{build.project_name}.hex" -{build.pid}
#tools.Arduino2CorePack.erase.pattern= "{cmd.path}" {erase.verbose} -{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.Arduino2CorePack.bootloader.pattern= "{cmd.path}" {bootloader.verbose} -{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}'
And programmers.txt is:
CorePack.name=CorePack
CorePack.program.tool=Arduino2CorePack
CorePack.program.params.quiet=-q
CorePack.program.params.verbose=-v -v
Hmm, that also looks ok to me...
Programmers.txt shouldn't be relevant, unless you use the upload using programmer option?
If I don't, I get the following:
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingProgrammer(SerialUploader.java:212)
at cc.arduino.packages.uploaders.SerialUploader.uploadUsingPreferences(SerialUploader.java:60)
at processing.app.Sketch.upload(Sketch.java:1714)
at processing.app.Sketch.exportApplet(Sketch.java:1625)
at processing.app.Sketch.exportApplet(Sketch.java:1597)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2397)
at java.lang.Thread.run(Unknown Source)
Wow... you're a genius. It was the underscores.
Great!
Still, this means a bug - if the IDE doesn't allow underscores, it should say so (or at least not show the board). Showing the board and then not properly supporting menu options or whatever the problem really is isn't really what we'd want... So the next question is - what part of the code was causing this exactly...
Yep... Actually, from the verbose output, it looks like underscores are used for separaion... for example, one such line during the build reads:
C:\Program Files (x86)\Arduino/hardware/tools/avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -mmcu=atmega103 -DF_CPU=32000000L -DARDUINO=157 -DARDUINO_CYBERCORTEXAV_XTREMEGMULTI -DARDUINO_ARCH_CYBERCORTEXAV -IC:\Users\Bryan\Documents\Arduino\hardware\Fabulous Silicon\CyberCortexAV\cores\AVR8
The following now works as expected:
##############################################################
# Xtreme-G:Ad-Hoc Multi Processor Mode
##############################################################
# Xtreme-G Common Attributes:
XtremeGMulti.name=Cyber Cortex AV : Xtreme-G (Ad-Hoc Multi-Processor Mode)
XtremeGMulti.build.mcu=atmega103
XtremeGMulti.build.f_cpu=32000000L
XtremeGMulti.build.core=AVR8
XtremeGMulti.upload.tool=Arduino2CorePack
XtremeGMulti.upload.maximumsize=131072
XtremeGMulti.program.params.verbose=-v
#XtremeGMulti.menu.target=TargetProcessor
# Xtreme-G AVR8 #1:
XtremeGMulti.menu.target.AVR1=AVR #1
XtremeGMulti.menu.target.AVR1.upload.tool=Arduino2CorePack
XtremeGMulti.menu.target.AVR1.upload.maximumsize=131072
XtremeGMulti.menu.target.AVR1.upload.speed=1
# Xtreme-G AVR8 #2:
XtremeGMulti.menu.target.AVR2=AVR #2
XtremeGMulti.menu.target.AVR2.upload.tool=Arduino2CorePack
XtremeGMulti.menu.target.AVR2.upload.maximumsize=131072
XtremeGMulti.menu.target.AVR2.upload.speed=2
# Xtreme-G Upload Type:
XtremeGMulti.menu.uploadtype.WithCore=Upload Xtreme-G Core and Program Data
XtremeGMulti.menu.uploadtype.WithCore.upload.protocol=xgb
XtremeGMulti.menu.uploadtype.ProgramOnly=Upload Program Data Only
XtremeGMulti.menu.uploadtype.ProgramOnly.upload.protocol=xg
@fabuloussilicon
the issue should be solved by: https://github.com/arduino/Arduino/pull/2582
Solved with #2582, if this doesn't fix the problem feel free to reopen the issue.
Hello everyone,
I'm struggling to get certain upload parameters (e.g. upload.protocol) to propagate using custom menu selections in a boards.txt file.
The following line will work correctly when selecting the board: ProjectGroup.upload.protocol=pgm ...which will correctly set a flag of "-pgm" when calling the defined programming tool.
Conversely, the following will fail when attempting to specify the upload protocol from a menu option: XtremeG_Single.menu.UploadType.WithCore.upload.protocol=xgsb ... which incorrectly results in "-{upload.protocol}" in the command line instead of "-xgsb" as I would expect.
For broader context, my boards.txt file is as follows:
Is this a bug, or is there something I'm either not doing or understanding correctly?
Thanks, Bryan