Go Down

Topic: Command line issue (Read 1 time) previous topic - next topic

shayo

Hi,

I am trying to use the new command line tool to build my sketch "arduino-builder" but it keeps crashing.
I'm trying:
arduino-builder -hardware=..../Arduino/Java/hardware -tools=.../Arduino/Java/tools -fqbn="Arduino Nano" .../Blink.ino

Code: [Select]
panic: runtime error: index out of range

goroutine 1 [running]:
arduino.cc/builder.(*TargetBoardResolver).Run(0x2bd908, 0xc20803c510, 0x0, 0x0)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/target_board_resolver.go:47 +0xf44
arduino.cc/builder.(*ContainerSetupHardwareToolsLibsSketchAndProps).Run(0x2bd908, 0xc20803c510, 0x0, 0x0)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/container_setup.go:59 +0x6b8
arduino.cc/builder.runCommands(0xc20803c510, 0xc20802bb90, 0x1d, 0x1d, 0x19401, 0x0, 0x0)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/builder.go:187 +0x139
arduino.cc/builder.(*Builder).Run(0xc20802bd88, 0xc20803c510, 0x0, 0x0)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/builder.go:118 +0xef7
arduino.cc/builder.RunBuilder(0xc20803c510, 0x0, 0x0)
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/src/arduino.cc/builder/builder.go:218 +0x49
main.main()
/Users/jenkins/jenkins/workspace/arduino-builder-macosx/main.go:311 +0x1eb2



Can someone please post an example file for the "-build-options-file"?

Thanks

Shay

pert

It looks like your fqbn value is wrong.

From https://github.com/arduino/arduino-builder:
Quote
-fqbn: Mandatory. Fully Qualified Board Name, e.g.: arduino:avr:uno
So the nano would be arduino:avr:nano. arduino is the vendor folder name, avr is the architecture folder name and nano is the board ID used in boards.txt. See https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification for more information on these terms.

pert

Can someone please post an example file for the "-build-options-file"?
From https://github.com/arduino/arduino-builder
Quote
Every time you run this tool, it will create a build.options.json file in build path.
So I think the easiest way to get an example file is to get your standard arduino-builder command to run and then look at the generated build.options.json and that should provide a good example.

pert

You could also do a compile in the Arduino IDE and then check the build.options.json file in the build folder that is generated for that compile. For example here's one I just did:
Code: [Select]
{
  "builtInLibrariesFolders": "C:\\Program Files (x86)\\arduino-1.6.7\\libraries",
  "customBuildProperties": "build.warn_data_percentage=75",
  "fqbn": "arduino:avr:nano:cpu=atmega328",
  "hardwareFolders": "C:\\Program Files (x86)\\arduino-1.6.7\\hardware,C:\\Users\\per\\AppData\\Local\\Arduino15\\packages,E:\\Stuff\\misc\\electronics\\arduino\\hardware",
  "otherLibrariesFolders": "E:\\Stuff\\misc\\electronics\\arduino\\libraries",
  "runtime.ide.version": "10607",
  "sketchLocation": "C:\\Program Files (x86)\\arduino-1.6.7\\examples\\01.Basics\\Blink\\Blink.ino",
  "toolsFolders": "C:\\Program Files (x86)\\arduino-1.6.7\\tools-builder,C:\\Program Files (x86)\\arduino-1.6.7\\hardware\\tools\\avr,C:\\Users\\per\\AppData\\Local\\Arduino15\\packages"
}

Go Up