1. Get the code
- Clone the repository (using git on the command line, or Sourcetree, etc.)
- Add to
.bash_profile
(Mac) or .bashrc
(Linux / Cygwin) 1 export KODUINO_DIR=<koduino_location>/stm32
2. Toolchain setup
If you have the Arduino IDE 1.6.1
- Add to
.bash_profile
(Mac) or .bashrc
(Linux / Cygwin) 1 export PATH=$PATH:/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin
...otherwise,
- Download gcc-arm-embedded 4.8 2014 q1 for your platform
- Add to
.bash_profile
(Mac) or .bashrc
(Linux / Cygwin) 1 export PATH=$PATH:<directory_you_extracted>/bin
In either case, test that it worked by running
1 arm-none-eabi-gcc --version
from a new terminal window.
3. Write your first program
Makefile template
In a new directory, create a file called Makefile
with the following contents.
5 # Put libraries you want to use here
8 include $(KODUINO_DIR)/project.mk
Sketch template
Create another file called Blink.cpp
with the following contents. (This is the Blink example from the Digital output section.)
#include <Arduino.h>
const int led = PC13;
void setup() {
}
void loop() {
}
4. Upload the code
Run make
in this directory. Hint: Sublime Text 3 with the "Make" build system is very convenient for this.