LoginSignup
0
0

More than 5 years have passed since last update.

TrampolineのLチカサンプルを動かすまで

Last updated at Posted at 2019-02-04

背景

Arduino UnoでTrampolineを動かそうと思ったときに、ちょっとだけ苦労したのでメモ。
参考にさせていただいたのはこちらの記事です。

環境

  • ホスト:Windows10 64bit
  • ターゲット:Arduino Uno
  • Arduino 1.8.8(Windows Store 1.8.19.0)

準備

1. gitでTrampolineを取得

cmd
> git clone https://github.com/TrampolineRTOS/trampoline

machine/avr/arduinoが落ちないと思うので、別で落としてくる。
公式のやり方に沿うと、Trampolineを入れたパスで

cmd
> git submodule init
> git submodule update machines/avr/arduino

らしいのだけど、ぼくは読まずに

cmd
> git clone https://github.com/TrampolineRTOS/ArduinoCore-avr/tree/a6ba7fd9e06ba7e986c1c6caab62d017f727030d

で落としてtrampoline/machine/avrに置いちゃいました。

2. goilを取得

先の公式のページ下の方にgoil-windows.zipがあるのでダウンロードして解凍する。

3. パスの追加

解凍したgoil-windowsディレクトリおよび、
クロスコンパイルのため Arduinoのavr-gccがあるディレクトリをパスに追加。
後者は、Windows StoreでArduino IDEインストールしている場合は
C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.19.0_x86__xxxxxxxxxxxxx\hardware\tools\avr\bin
みたいな感じの場所。
コンフィグファイルはetc。
makeも必要なので、Cygwinでやるか、cmdでCygwinのmakeバイナリのある場所のパスも追加する。

cmd
> set PATH=%PATH%;C:\<hogehoge>\goil-windows;
> set PATH=%PATH%;C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.19.0_x86__xxxxxxxxxxxxx\hardware\tools\avr\bin;
> set PATH=%PATH%;C:\Program Files\WindowsApps\ArduinoLLC.ArduinoIDE_1.8.19.0_x86__xxxxxxxxxxxxx\hardware\tools\avr\etc;
> set PATH=%PATH%;C:\<hogehoge>\cygwin64\bin;

見やすいように分けて書いてるけど、もちろん一行にまとめてセットしてもOK。

ビルド

1. blinkのrunGoil.batmake.pyを実行
cmd
> cd <hogehoge>\trampoline\examples\avr\arduinoUno\blink
> runGoil.bat
> python make.py

2. avrdudeでtrampuinoBlink.hexをArduinoに書き込み

すでにパスが通ってるのでavrdudeが実行できるはず。

cmd
> avrdude -c arduino -P COM5 -p m328p -b 115200 -u -e -U flash:w:"trampuinoBlink.hex":a

COMの番号はArduinoを接続しているポートを設定のこと。
わからなかったらArduino IDEを参照。

3. Lチカしたら成功

周期的に、Arduino UnoのLEDが点滅していたらOK。

更新履歴

[2019.02.10]
- make -> python make.pyに修正
- avrdudeコンフィグパスの追加が抜けていたため追加

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0