queezythegreat / arduino-cmake

Arduino CMake Build system
645 stars 216 forks source link

No -burn target when supplying PROGRAMMER #86

Closed jorihardman closed 10 years ago

jorihardman commented 10 years ago

I'm new to arduino-cmake and cmake in general, so I'm sure I'm missing something simple. I am unable to create a burn target for build. Here is my CMakeLists.txt:

set(CMAKE_TOOLCHAIN_FILE /Users/jori/Code/arduino-cmake/cmake/ArduinoToolchain.cmake)

cmake_minimum_required(VERSION 2.8)

project(Hub C CXX)

cmake_policy(SET CMP0015 NEW)

link_directories(lib)

generate_arduino_firmware(hub
  BOARD pro328
  PROGRAMMER avrispmkii
  SKETCH src/sketch.ino
)

The sketch compiles into a hex just fine, but there is no hub-burn target in the generated Makefile. As far as I can tell from the documentation, setting the PROGRAMMER option should automatically enable that target. Am I missing something?

jorihardman commented 10 years ago

Some additional info:

I am on MacOSX 10.7.5 I have avrdude and libusb I am able to successfully upload the compiled hex file using avrdude on its own

jorihardman commented 10 years ago

And of course I immediately solve my own problem 10 minutes after posting :)

An additional argument is needed: PORT

generate_arduino_firmware(hub
  SKETCH src/sketch.ino
  PROGRAMMER avrispmkii
  BOARD pro328
  PORT usb
)

You may want to update the Programmers section of the docs for this as it took a cmake noob like me a long time to figure out what I was missing.

galou commented 9 years ago

Actually, the PORT option is needed but its value is ignored, at least with the AVR ISP mkII programmer. For this programmer, PORT dummy also works.