Arduino cheat sheet: Difference between revisions

From misc notes
Jump to navigation Jump to search
Line 45: Line 45:
*avrdudo の hack
*avrdudo の hack
libusb がらみでエラーになる。
libusb がらみでエラーになる。
しかたなく、cygwin の libusb-1.0 のパッケージをいれる。しかし、dll しかないので、static リンクできず。
しかたなく、cygwin の libusb-1.0 のパッケージをいれる。しかし dll しかないので、static リンクできず。


avrdude.build.bash の libusb-win32 がらみの include, lib を変更して実行。エラーになったのちに、avrdude-build ディレクトリ配下の Makefile の -static を消して make
avrdude.build.bash の libusb-win32 がらみの include, lib を変更して実行。エラーになったのちに、avrdude-build ディレクトリ配下の Makefile の -static を消して make


できた avrdude は cygwin と win32 がいりまじってるので、avrdude の port 指定 (-P port) は -P '\\.\com5' で動く。
できた avrdude.exe は cygwin と win32 がいりまじってるので、avrdude の port 指定 (-P port) は -P '\\.\com5' で動く。


*arduino usb serial の windows OS での初期化。
*arduino usb serial の windows OS での初期化。

Revision as of 09:45, 26 August 2015

Arduino + cygwin + ino (ano) ハマりどころメモ

without Arduino IDE

Arduino from the Command Line
Arturo

ano は versions 1.6.1 は動くとのこと

  • cygwin 特有の問題
toolchain-avr を cygwin で compile
The AVR toolchain used by the Arduino IDE

1.6.1 用は release 3.4.5

git clone -b 3.4.5 https://github.com/arduino/toolchain-avr.git
  • toolchain-avr ハマりどころ

cygwin 32bit 版つかうこと (64bit 版は hack は困難。32bit 版でおとなしく作ること)

    git
    wget
    unzip
    zip
    gperf
    bison
    flex
    make
    patch
    *** automake
    autoconf
    gcc-g++
    *** texinfo (must be at version 4.13 since 5+ won't work)
    libncurses-devel
    python-setuptools

Readme.md にあるように texinfo の指定バージョン 4.13 は cygwin にないので、自分でコンパイル。 ついでに automake-1.11.1 texinfo-4.13 は cygwin のパッケージつかわないで自分でコンパイルする。

arch.win32.build.bash はつかわない。なので MinGW 環境は不要。

bash build.all.bash

10時間ほどコンパイルにかかる。

  • avrdudo の hack

libusb がらみでエラーになる。 しかたなく、cygwin の libusb-1.0 のパッケージをいれる。しかし dll しかないので、static リンクできず。

avrdude.build.bash の libusb-win32 がらみの include, lib を変更して実行。エラーになったのちに、avrdude-build ディレクトリ配下の Makefile の -static を消して make

できた avrdude.exe は cygwin と win32 がいりまじってるので、avrdude の port 指定 (-P port) は -P '\\.\com5' で動く。

  • arduino usb serial の windows OS での初期化。

arduino の usb を刺しただけでは OS から serial device (COM5) としてみえてなので、windows OS で認識させる。

シリアルポートの使い方@windows
#!/bin/sh
mode.com $1: BAUD=115200 PARITY=N DATA=8 STOP=1 to=off xon=off odsr=off octs=on dtr=off rts=on idsr=off

このスクリプト動かす。

  • 配置
Configuring Eclipse to point to the IDE location

をヒントに...


  • ano の環境

/etc/ano.ini or ~/.anorc

[build]
board-model = uno
cpu = 8MHzatmega328p
arduino-dist = /usr/share/arduino

[upload]
board-model = uno
cpu = 8MHzatmega328p
arduino-dist = /usr/share/arduino
serial-port = /dev/ttyS4

[serial]
serial-port = /dev/ttyS4

続行中メモ

avrdude コンパイル法さがす

  • more install
libusb-1.0.9.tar.bz2
setserial
# autoconf-2.59 is required
# automake-1.9.x is required
  • make
./bootstrap
./configure LDFLAGS="-static" --prefix=$PREFIX --datadir=$PREFIX --sysconfdir=$PREFIX/bin --enable-versioned-doc=no
./configure LDFLAGS="-static" --prefix=/home/foo/bar/toolchain-avr/objdir --enable-linuxgpio
??
export CPPFLAGS="-I/home/foo/bar/toolchain-avr/tmp/LibUSB-Win32/include" 
export CFLAGS="-I/home/foo/bar/toolchain-avr/tmp/LibUSB-Win32/include"
export LDFLAGS="-L/home/foo/bar/toolchain-avr/tmp/LibUSB-Win32/lib/gcc"

make avrdude.exe
strip avrdude.exe