Changes between Initial Version and Version 1 of DevEnvMac


Ignore:
Timestamp:
Dec 20, 2014, 3:55:19 PM (9 years ago)
Author:
ertl-yutaka
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DevEnvMac

    v1 v1  
     1= OS Xでの環境構築方法 =
     2== 前提となる環境 ==
     3予め以下のソフトウェアがインストールされているものとします。
     4
     5 * Mac OS X 10.8
     6 * Xcode(App Storeからインストール)
     7 * macport
     8
     9== cfgのインストール ==
     10 * boostライブラリのインストール
     11
     12
     13
     14{{{
     15$ port install boost
     16}}}
     17 * cfgのconfigure & make
     18
     19
     20
     21{{{
     22$ ./configure --with-headers=/opt/local/include --with-libraries=/opt/local/lib --without-xml
     23$ make depend; make
     24}}}
     25== mkimageのインストール ==
     26 * u-bootのソースを取得し,toolsディレクトリ内でビルド(動作確認したバージョンは,u-boot-1.1.6)
     27   * 参考:http://mwlab.net/2011/07/kurobox-make-mkimage.html
     28   * makeではうまくいかないので、下記のmakeログだけを真似て実行する
     29
     30
     31
     32{{{
     33$ cd u-boot-1.1.6/tools
     34$ ln -s ../common/environment.c environment.c
     35$ ln -s ../lib_generic/crc32.c crc32.c
     36$ gcc -g -Wall -pedantic -idirafter ../include -DTEXT_BASE= -DUSE_HOSTCC -O -c mkimage.c
     37$ gcc -g -Wall -pedantic -idirafter ../include -DTEXT_BASE= -DUSE_HOSTCC -O -c crc32.c
     38$ gcc -Wall -pedantic -idirafter ../include -DTEXT_BASE= -DUSE_HOSTCC -O  -o mkimage mkimage.o crc32.o
     39$ strip mkimage 
     40}}}
     41 * makeしたmkimageをパスの通ったディレクトリに置く
     42
     43
     44
     45{{{
     46cp mkimage /usr/local/bin/
     47}}}
     48== GNUツールチェーンのインストール ==
     49 * 下記はビルドに成功した一例であり,このとおりに実行してビルドできることを保証するものでなく,下記以外の方法でもビルドできる可能性があります.  
     50 * ライブラリ(gmp,mpfr,mpc,iconv)を port でインストール
     51 * mentor graphicsのウェブサイトからarm-none-eabiのツールチェーンのソースコードをダウンロードし,解凍する
     52   * 「codesourcery arm gcc」などでgoogle検索
     53
     54
     55
     56{{{
     57$ tar xvjf arm-2014.05-28-arm-none-eabi.src.tar.bz2
     58}}}
     59 * ツールチェーンのインストールディレクトリを作成し,パスを通す
     60
     61
     62
     63{{{
     64$ mkdir /usr/local/arm-none-eabi_140528
     65$ export PATH=/usr/local/arm-none-eabi_140528/bin:$PATH
     66}}}
     67 * binutilsのmake
     68
     69
     70
     71{{{
     72$ cd arm-2014.05-28-arm-none-eabi
     73$ tar xvjf binutils-2014.05-28.tar.bz2 
     74$ cd binutils-2014.05
     75$ mkdir work
     76$ cd work/
     77$ ../configure --prefix=/usr/local/arm-none-eabi_140528 --target=arm-none-eabi --program-prefix=arm-none-eabi-
     78$ make
     79$ make install
     80}}}
     81 * gccのmake(上からの続き)
     82
     83
     84
     85{{{
     86$ cd ../..
     87$ tar xvjf gcc-2014.05-28.tar.bz2 
     88$ tar xvjf newlib-2014.05-28.tar.bz2 
     89$ cd gcc-4.8-2014.05/
     90$ mkdir work
     91$ cd work/
     92$ ../configure --prefix=/usr/local/arm-none-eabi_140528 --target=arm-none-eabi --with-newlib --with-headers=../../newlib-2014.05/newlib/libc/include --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --with-libiconv-prefix=/opt/local --disable-nls --disable-shared --disable-libmudflap --disable-libssp --disable-libgomp --with-gnu-as --with-gnu-ld --disable-initfini-array --disable-threads --disable-bootstrap --enable-multilib --enable-languages=c,c++
     93$ ln -s /path/to/newlib-2014.05/newlib/libc/include/ /usr/local/arm-none-eabi_140528/arm-none-eabi/include
     94$ make
     95$ make install
     96$ rm /usr/local/arm-none-eabi_140528/arm-none-eabi/include
     97}}}
     98 * newlibのmake(上からの続き)
     99
     100
     101
     102{{{
     103$ cd ../..
     104$ cd newlib-2014.05
     105$ mkdir work
     106$ cd work/
     107$ ../configure --prefix=/usr/local/arm-none-eabi_140528 --target=arm-none-eabi --enable-interwork --enable-multilib
     108$ make
     109$ make install
     110}}}
     111== ev3rtの準備 ==
     112 * hrp2-ev3-beta1.1.zipをダウロードして解凍
     113
     114
     115
     116{{{
     117$ unzip hrp2-ev3-beta1.1.zip
     118}}}
     119 * 同梱されているcfgを削除し,上記で作成したcfgを使うようにする
     120
     121
     122
     123{{{
     124$ cd hrp2-ev3-beta1.1
     125$ rm -rf cfg
     126$ ln -s /path/to/cfg .(cfgの実行バイナリでなく,トップディレクトリ)
     127}}}
     128    つまり,hrp2-ev3-beta1.1/cfg/cfg/cfg が実行バイナリ
     129
     130 * アプリごとのMakefile(Makefile.app)を作成
     131
     132
     133
     134{{{
     135$ cd workspace
     136$ cp common/Makefile.app helloev3/Makefile.app
     137}}}
     138 * make
     139
     140
     141
     142{{{
     143$ make app=helloev3 (動的ロードモジュール版の場合は, make mod=helloev3)
     144}}}
     145== bluetooth接続 ==
     146 * EV3でアプリの実行を開始する
     147 * Mac内蔵のbluetoothを使用し,メニューバーのbluetoothアイコンから,「Bluetoothデバイスを設定」Mindsotrms EV3 を選択
     148 * ピンコードを入力(デフォルトは0000)し,下記コマンドによりシリアル送受信を開始
     149
     150
     151
     152{{{
     153$ screen /dev/tty.MindstormsEV3-SerialPor 115200
     154}}}
     155 *   ※デバイス名は変わる可能性があります.