The latest Cosa update includes porting and configuration of the Arduino-Makefile GitHub - sudar/Arduino-Makefile: Makefile for Arduino sketches. It defines the workflows for compiling code, flashing it to Arduino and even communicating through Serial.. This allows simple build using "traditional" make files. To get started simply configure the build template with your Arduino installation path (Cosa/Cosa.mk at master · mikaelpatel/Cosa · GitHub) and write a three line makefile in the same directory as the sketch.
COSA_DIR = $(HOME)/Sketchbook/hardware/Cosa
BOARD_TAG = duemilanove
include $(COSA_DIR)/build/Cosa.mk
The COSA_DIR variable is the path of the Cosa installation. The BOARD_TAG is the type of board to build the sketch for. The possible board tags are:
BOARD_TAG DESCRIPTION
================================================================================
miniwireless Cosa Anarduino MiniWireless (ATmega328/BOOT_168)
duemilanove Cosa Arduino Duemilanove (ATmega328/BOOT_168)
leonardo Cosa Arduino Leonardo (ATmega32U4/Caterina)
mega Cosa Arduino Mega (ATmega2560/STK500v2)
nano Cosa Arduino Nano (ATmega328/BOOT_168)
pro-micro Cosa Arduino Pro Micro (ATmega32U4/Caterina)
pro-mini Cosa Arduino Pro Mini (ATmega328/BOOT_168)
pro-mini-8 Cosa Arduino Pro Mini (ATmega328/BOOT_168, 3.3V, 8 MHz)
uno Cosa Arduino Uno (ATmega328/Optiboot)
attiny84-8 Cosa Breadboard (ATtiny84, 8 MHz internal clock)
attiny85-8 Cosa Breadboard (ATtiny85, 8 MHz internal clock)
attiny861-8 Cosa Breadboard (ATtiny861, 8 MHz internal clock)
atmega328-8 Cosa Breadboard (ATmega328, 8 MHz internal clock)
mighty Cosa Breadboard (ATmega1284/BOOT_1284P)
mighty-opt Cosa Breadboard (ATmega1284/Optiboot)
lilypad Cosa LilyPad Arduino (ATmega328/BOOT_168, 8 MHz)
lilypad-usb Cosa LilyPad Arduino USB (ATmega32U4/Caterina, 8 MHz)
moteino Cosa LowPowerLab Moteino (ATmega328/DualOptiboot)
microduino-core Cosa Microduino-Core (ATmega328/Optiboot)
microduino-core32u4 Cosa Microduino-Core32u4 (ATmega32U4/Caterina)
microduino-core-plus Cosa Microduino-Core+ (ATmega644P/Optiboot)
pinoccio Cosa Pinoccio Scout (ATmega256RFR2/STK500v2)
teensy-2_0 Cosa Teensy 2.0 (ATmega32U4/halfkay)
teensypp-2_0 Cosa Teensy++ 2.0 (AT90USB1286/halfkay)
Build, upload and monitor the sketch with the following command.
make upload monitor
The Cosa Arduino-Makefile uses miniterm.py as serial monitor. The exit command is CTRL-ALT GR ]
Build for another board by either changing the BOARD_TAG in the Makefile or simply giving the command:
make "BOARD_TAG=uno"
More details in the Cosa/build directory and on the original Arduino-Makefile site. Please see the example makefiles in the CosaBlink and CosaBenchmarkPins directories.
Cheers!