この文書の現在のバージョンと選択したバージョンの差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
xg_series_devel:build_openocd:start [2018/03/07 11:32] admin |
xg_series_devel:build_openocd:start [2018/03/07 11:40] (現在) admin |
||
---|---|---|---|
ライン 1: | ライン 1: | ||
+ | ====== OpenOCD のインストール ====== | ||
+ | |||
+ | XG-50 と接続して、 | ||
+ | |||
+ | * ファームウェアのダウンロード | ||
+ | * gdb でのデバッグ | ||
+ | |||
+ | を行うために、OpenOCD のインストールが必要になります。 | ||
+ | |||
+ | Ubuntu のパッケージをインストールするだけでも良いのですが、SONY さんが NuttX の task/thread を扱えるように\\ | ||
+ | 手を入れた [[https://github.com/sony/openocd-nuttx|ソースを公開]] してくださっていますので、それを有難く利用させていただこうと思います。 | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ===== ビルドに必要なパッケージのインストール ===== | ||
+ | |||
+ | Debian Package をビルドするために、**devscripts** をインストールします。 | ||
+ | |||
+ | <code> | ||
+ | xubuntu64:~$ sudo apt install devscripts | ||
+ | パッケージリストを読み込んでいます... 完了 | ||
+ | 依存関係ツリーを作成しています | ||
+ | 状態情報を読み取っています... 完了 | ||
+ | 以下の追加パッケージがインストールされます: | ||
+ | at dctrl-tools dput libdistro-info-perl python3-magic wdiff | ||
+ | 提案パッケージ: | ||
+ | default-mta | mail-transport-agent debtags bsd-mailx | mailx cvs-buildpackage diffoscope devscripts-el | ||
+ | dose-extra gnuplot libterm-size-perl libyaml-syck-perl mozilla-devscripts mutt svn-buildpackage w3m | ||
+ | debian-keyring equivs libsoap-lite-perl mini-dinstall python-bzrlib | ||
+ | 以下のパッケージが新たにインストールされます: | ||
+ | at dctrl-tools devscripts dput libdistro-info-perl python3-magic wdiff | ||
+ | アップグレード: 0 個、新規インストール: 7 個、削除: 0 個、保留: 0 個。 | ||
+ | 1,017 kB のアーカイブを取得する必要があります。 | ||
+ | この操作後に追加で 2,952 kB のディスク容量が消費されます。 | ||
+ | 続行しますか? [Y/n] | ||
+ | 取得:1 http://jp.archive.ubuntu.com/ubuntu xenial/main amd64 at amd64 3.1.18-2ubuntu1 [37.8 kB] | ||
+ | 取得:2 http://jp.archive.ubuntu.com/ubuntu xenial/main amd64 dctrl-tools amd64 2.24-2 [59.1 kB] | ||
+ | 取得:3 http://jp.archive.ubuntu.com/ubuntu xenial/main amd64 devscripts amd64 2.16.2ubuntu3 [848 kB] | ||
+ | 取得:4 http://jp.archive.ubuntu.com/ubuntu xenial/main amd64 dput all 0.9.6.4ubuntu3 [33.1 kB] | ||
+ | 取得:5 http://jp.archive.ubuntu.com/ubuntu xenial/main amd64 libdistro-info-perl all 0.14build1 [4,780 B] | ||
+ | 取得:6 http://jp.archive.ubuntu.com/ubuntu xenial/main amd64 wdiff amd64 1.2.2-1build1 [28.8 kB] | ||
+ | 取得:7 http://jp.archive.ubuntu.com/ubuntu xenial/main amd64 python3-magic all 1:5.25-2ubuntu1 [5,438 B] | ||
+ | 1,017 kB を 0秒 で取得しました (5,264 kB/s) | ||
+ | 以前に未選択のパッケージ at を選択しています。 | ||
+ | (データベースを読み込んでいます ... 現在 206197 個のファイルとディレクトリがインストールされています。) | ||
+ | .../at_3.1.18-2ubuntu1_amd64.deb を展開する準備をしています ... | ||
+ | at (3.1.18-2ubuntu1) を展開しています... | ||
+ | 以前に未選択のパッケージ dctrl-tools を選択しています。 | ||
+ | .../dctrl-tools_2.24-2_amd64.deb を展開する準備をしています ... | ||
+ | dctrl-tools (2.24-2) を展開しています... | ||
+ | 以前に未選択のパッケージ devscripts を選択しています。 | ||
+ | .../devscripts_2.16.2ubuntu3_amd64.deb を展開する準備をしています ... | ||
+ | devscripts (2.16.2ubuntu3) を展開しています... | ||
+ | 以前に未選択のパッケージ dput を選択しています。 | ||
+ | .../dput_0.9.6.4ubuntu3_all.deb を展開する準備をしています ... | ||
+ | dput (0.9.6.4ubuntu3) を展開しています... | ||
+ | 以前に未選択のパッケージ libdistro-info-perl を選択しています。 | ||
+ | .../libdistro-info-perl_0.14build1_all.deb を展開する準備をしています ... | ||
+ | libdistro-info-perl (0.14build1) を展開しています... | ||
+ | 以前に未選択のパッケージ wdiff を選択しています。 | ||
+ | .../wdiff_1.2.2-1build1_amd64.deb を展開する準備をしています ... | ||
+ | wdiff (1.2.2-1build1) を展開しています... | ||
+ | 以前に未選択のパッケージ python3-magic を選択しています。 | ||
+ | .../python3-magic_1%3a5.25-2ubuntu1_all.deb を展開する準備をしています ... | ||
+ | python3-magic (1:5.25-2ubuntu1) を展開しています... | ||
+ | man-db (2.7.5-1) のトリガを処理しています ... | ||
+ | systemd (229-4ubuntu21.1) のトリガを処理しています ... | ||
+ | ureadahead (0.100.0-19) のトリガを処理しています ... | ||
+ | install-info (6.1.0.dfsg.1-5) のトリガを処理しています ... | ||
+ | at (3.1.18-2ubuntu1) を設定しています ... | ||
+ | dctrl-tools (2.24-2) を設定しています ... | ||
+ | devscripts (2.16.2ubuntu3) を設定しています ... | ||
+ | dput (0.9.6.4ubuntu3) を設定しています ... | ||
+ | libdistro-info-perl (0.14build1) を設定しています ... | ||
+ | wdiff (1.2.2-1build1) を設定しています ... | ||
+ | python3-magic (1:5.25-2ubuntu1) を設定しています ... | ||
+ | systemd (229-4ubuntu21.1) のトリガを処理しています ... | ||
+ | ureadahead (0.100.0-19) のトリガを処理しています ... | ||
+ | xubuntu64:~$ | ||
+ | </code> | ||
+ | |||
+ | \\ | ||
+ | |||
+ | OpenOCD のビルドに必要なパッケージもインストールします。 | ||
+ | |||
+ | <code> | ||
+ | xubuntu64:~$ sudo apt install cdbs debhelper autotools-dev libftdi-dev libusb-1.0-0-dev texinfo texlive autoconf libhidapi-dev libjim-dev pkg-config dh-autoreconf | ||
+ | パッケージリストを読み込んでいます... 完了 | ||
+ | 依存関係ツリーを作成しています | ||
+ | 状態情報を読み取っています... 完了 | ||
+ | 以下の追加パッケージがインストールされます: | ||
+ | automake autopoint dh-strip-nondeterminism dh-translations fonts-lato fonts-lmodern fonts-texgyre intltool | ||
+ | javascript-common libfile-stripnondeterminism-perl libftdi1 libhidapi-hidraw0 libhidapi-libusb0 libjim0.76 | ||
+ | libjs-jquery libltdl-dev libmail-sendmail-perl libpotrace0 libptexenc1 libruby2.3 libsynctex1 | ||
+ | libsys-hostname-long-perl libtexlua52 libtexluajit2 libtext-unidecode-perl libtool libusb-1.0-doc | ||
+ | libusb-dev libzzip-0-13 lmodern m4 po-debconf prosper ps2eps python-pkg-resources python-scour python-six | ||
+ | rake ruby ruby-did-you-mean ruby-minitest ruby-net-telnet ruby-power-assert ruby-test-unit ruby2.3 | ||
+ | rubygems-integration tex-common tex-gyre texlive-base texlive-binaries texlive-extra-utils | ||
+ | texlive-font-utils texlive-fonts-recommended texlive-fonts-recommended-doc texlive-generic-recommended | ||
+ | texlive-latex-base texlive-latex-base-doc texlive-latex-recommended texlive-latex-recommended-doc | ||
+ | texlive-pictures texlive-pictures-doc texlive-pstricks texlive-pstricks-doc tipa | ||
+ | 提案パッケージ: | ||
+ | autoconf-archive gnu-standards autoconf-doc dh-make apache2 | lighttpd | httpd libtool-doc gfortran | ||
+ | | fortran95-compiler gcj-jdk libmail-box-perl python-setuptools python-rsvg python-cairo ri ruby-dev | ||
+ | bundler texinfo-doc-nonfree perl-tk dvipng dvidvi xindy fragmaster purifyeps lacheck chktex latexmk | ||
+ | latexdiff psutils libtcltk-ruby texlive-latex-extra dot2tex prerex | ||
+ | 以下のパッケージが新たにインストールされます: | ||
+ | autoconf automake autopoint autotools-dev cdbs debhelper dh-autoreconf dh-strip-nondeterminism | ||
+ | dh-translations fonts-lato fonts-lmodern fonts-texgyre intltool javascript-common | ||
+ | libfile-stripnondeterminism-perl libftdi-dev libftdi1 libhidapi-dev libhidapi-hidraw0 libhidapi-libusb0 | ||
+ | libjim-dev libjim0.76 libjs-jquery libltdl-dev libmail-sendmail-perl libpotrace0 libptexenc1 libruby2.3 | ||
+ | libsynctex1 libsys-hostname-long-perl libtexlua52 libtexluajit2 libtext-unidecode-perl libtool | ||
+ | libusb-1.0-0-dev libusb-1.0-doc libusb-dev libzzip-0-13 lmodern m4 pkg-config po-debconf prosper ps2eps | ||
+ | python-pkg-resources python-scour python-six rake ruby ruby-did-you-mean ruby-minitest ruby-net-telnet | ||
+ | ruby-power-assert ruby-test-unit ruby2.3 rubygems-integration tex-common tex-gyre texinfo texlive | ||
+ | texlive-base texlive-binaries texlive-extra-utils texlive-font-utils texlive-fonts-recommended | ||
+ | texlive-fonts-recommended-doc texlive-generic-recommended texlive-latex-base texlive-latex-base-doc | ||
+ | texlive-latex-recommended texlive-latex-recommended-doc texlive-pictures texlive-pictures-doc | ||
+ | texlive-pstricks texlive-pstricks-doc tipa | ||
+ | アップグレード: 0 個、新規インストール: 76 個、削除: 0 個、保留: 0 個。 | ||
+ | 405 MB のアーカイブを取得する必要があります。 | ||
+ | この操作後に追加で 701 MB のディスク容量が消費されます。 | ||
+ | 続行しますか? [Y/n] | ||
+ | </code> | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ===== ソースのダウンロード ===== | ||
+ | |||
+ | OpenOCD のソースを [[https://github.com/centurysys/openocd-nuttx.git|ここ]] からダウンロードします。\\ | ||
+ | |||
+ | <code> | ||
+ | xubuntu64:~/src$ git clone https://github.com/centurysys/openocd-nuttx.git | ||
+ | Cloning into 'openocd-nuttx'... | ||
+ | remote: Counting objects: 55885, done. | ||
+ | remote: Compressing objects: 100% (3/3), done. | ||
+ | remote: Total 55885 (delta 0), reused 1 (delta 0), pack-reused 55882 | ||
+ | Receiving objects: 100% (55885/55885), 13.87 MiB | 1.74 MiB/s, done. | ||
+ | Resolving deltas: 100% (46167/46167), done. | ||
+ | Checking connectivity... done. | ||
+ | xubuntu64:~/src$ cd openocd-nuttx/ | ||
+ | xubuntu64:~/src/openocd-nuttx$ git branch | ||
+ | * centurysys | ||
+ | xubuntu64:~/src/openocd-nuttx$ | ||
+ | </code> | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ===== ビルド ===== | ||
+ | |||
+ | ==== bootstrap ==== | ||
+ | |||
+ | まず、追加で必要なソース類を自動でダウンロードするため、**bootstrap** スクリプトを実行します。 | ||
+ | |||
+ | <code> | ||
+ | xubuntu64:~/src/openocd-nuttx$ ./bootstrap | ||
+ | + aclocal | ||
+ | + libtoolize --automake --copy | ||
+ | + autoconf | ||
+ | + autoheader | ||
+ | + automake --gnu --add-missing --copy | ||
+ | configure.ac:26: installing './compile' | ||
+ | configure.ac:37: installing './config.guess' | ||
+ | configure.ac:37: installing './config.sub' | ||
+ | configure.ac:16: installing './install-sh' | ||
+ | configure.ac:16: installing './missing' | ||
+ | Makefile.am:46: warning: wildcard $(srcdir: non-POSIX variable name | ||
+ | Makefile.am:46: (probably a GNU make extension) | ||
+ | Makefile.am: installing './INSTALL' | ||
+ | Makefile.am: installing './depcomp' | ||
+ | Makefile.am:23: installing './mdate-sh' | ||
+ | Makefile.am:23: installing './texinfo.tex' | ||
+ | Setting up submodules | ||
+ | Submodule 'jimtcl' (http://repo.or.cz/r/jimtcl.git) registered for path 'jimtcl' | ||
+ | Submodule 'src/jtag/drivers/libjaylink' (http://repo.or.cz/r/libjaylink.git) registered for path 'src/jtag/drivers/libjaylink' | ||
+ | Submodule 'tools/git2cl' (http://repo.or.cz/r/git2cl.git) registered for path 'tools/git2cl' | ||
+ | Cloning into 'jimtcl'... | ||
+ | remote: Counting objects: 7381, done. | ||
+ | remote: Total 7381 (delta 0), reused 0 (delta 0) | ||
+ | Receiving objects: 100% (7381/7381), 5.91 MiB | 1.00 MiB/s, done. | ||
+ | Resolving deltas: 100% (5370/5370), done. | ||
+ | Checking connectivity... done. | ||
+ | Submodule path 'jimtcl': checked out 'a9bf5975fd0f89974d689a2d9ebd0873c8d64787' | ||
+ | Cloning into 'src/jtag/drivers/libjaylink'... | ||
+ | remote: Counting objects: 970, done. | ||
+ | remote: Total 970 (delta 0), reused 0 (delta 0) | ||
+ | Receiving objects: 100% (970/970), 229.04 KiB | 94.00 KiB/s, done. | ||
+ | Resolving deltas: 100% (742/742), done. | ||
+ | Checking connectivity... done. | ||
+ | Submodule path 'src/jtag/drivers/libjaylink': checked out '699b7001d34a79c8e7064503dde1bede786fd7f0' | ||
+ | Cloning into 'tools/git2cl'... | ||
+ | remote: Counting objects: 64, done. | ||
+ | remote: Total 64 (delta 0), reused 0 (delta 0) | ||
+ | Unpacking objects: 100% (64/64), done. | ||
+ | Checking connectivity... done. | ||
+ | Submodule path 'tools/git2cl': checked out '8373c9f74993e218a08819cbcdbab3f3564bbeba' | ||
+ | Generating build system... | ||
+ | libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'. | ||
+ | libtoolize: copying file 'build-aux/config.guess' | ||
+ | libtoolize: copying file 'build-aux/config.sub' | ||
+ | libtoolize: copying file 'build-aux/install-sh' | ||
+ | libtoolize: copying file 'build-aux/ltmain.sh' | ||
+ | libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'. | ||
+ | libtoolize: copying file 'm4/libtool.m4' | ||
+ | libtoolize: copying file 'm4/ltoptions.m4' | ||
+ | libtoolize: copying file 'm4/ltsugar.m4' | ||
+ | libtoolize: copying file 'm4/ltversion.m4' | ||
+ | libtoolize: copying file 'm4/lt~obsolete.m4' | ||
+ | configure.ac:42: installing 'build-aux/ar-lib' | ||
+ | configure.ac:37: installing 'build-aux/compile' | ||
+ | configure.ac:30: installing 'build-aux/missing' | ||
+ | Makefile.am: installing './INSTALL' | ||
+ | libjaylink/Makefile.am: installing 'build-aux/depcomp' | ||
+ | Bootstrap complete. Quick build instructions: | ||
+ | ./configure .... | ||
+ | xubuntu64:~/src/openocd-nuttx$ | ||
+ | </code> | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ==== debuild ==== | ||
+ | |||
+ | あとは、通常の Debian Package をビルドする時と同様、**debuild** コマンドを実行します。 | ||
+ | |||
+ | <code> | ||
+ | xubuntu64:~/src/openocd-nuttx$ debuild -uc -us -b | ||
+ | |||
+ | ... 略 ... | ||
+ | |||
+ | # only call dh_scour for packages in main | ||
+ | if grep -q '^Component:[[:space:]]*main' /CurrentlyBuilding 2>/dev/null; then dh_scour -popenocd ; fi | ||
+ | dh_md5sums -popenocd | ||
+ | dh_builddeb -popenocd | ||
+ | dpkg-deb: `../openocd_0.10.0-1build1_amd64.deb' にパッケージ `openocd' を構築しています。 | ||
+ | dpkg-genchanges -b >../openocd_0.10.0-1build1_amd64.changes | ||
+ | dpkg-genchanges: binary-only upload (no source code included) | ||
+ | dpkg-source --after-build openocd-nuttx | ||
+ | dpkg-buildpackage: binary-only upload (no source included) | ||
+ | Now running lintian... | ||
+ | Finished running lintian. | ||
+ | xubuntu64:~/src/openocd-nuttx$ | ||
+ | </code> | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ビルドが終了すると、上のディレクトリにパッケージが作成されています。 | ||
+ | |||
+ | <code> | ||
+ | xubuntu64:~/src/openocd-nuttx$ ls -ln ../ | ||
+ | 合計 2372 | ||
+ | drwxrwxr-x 12 1000 1000 4096 3月 7 11:29 openocd-nuttx | ||
+ | -rw-r--r-- 1 1000 1000 348631 3月 7 11:29 openocd_0.10.0-1build1_amd64.build | ||
+ | -rw-r--r-- 1 1000 1000 765 3月 7 11:29 openocd_0.10.0-1build1_amd64.changes | ||
+ | -rw-r--r-- 1 1000 1000 2065308 3月 7 11:29 openocd_0.10.0-1build1_amd64.deb <------ | ||
+ | xubuntu64:~/src/openocd-nuttx$ | ||
+ | </code> | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ===== インストール ===== | ||
+ | |||
+ | **dpkg** コマンドでビルドされたパッケージをインストールします。 | ||
+ | |||
+ | <code> | ||
+ | xubuntu64:~/src/openocd-nuttx$ sudo dpkg -i ../openocd_0.10.0-1build1_amd64.deb | ||
+ | 以前に未選択のパッケージ openocd を選択しています。 | ||
+ | (データベースを読み込んでいます ... 現在 228042 個のファイルとディレクトリがインストールされています。) | ||
+ | .../openocd_0.10.0-1build1_amd64.deb を展開する準備をしています ... | ||
+ | openocd (0.10.0-1build1) を展開しています... | ||
+ | openocd (0.10.0-1build1) を設定しています ... | ||
+ | doc-base (0.10.7) のトリガを処理しています ... | ||
+ | doc-base ファイルを 1 個追加 を処理中... | ||
+ | man-db (2.7.5-1) のトリガを処理しています ... | ||
+ | install-info (6.1.0.dfsg.1-5) のトリガを処理しています ... | ||
+ | xubuntu64:~/src/openocd-nuttx$ | ||
+ | </code> | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ===== ビルドが面倒な場合 ===== | ||
+ | |||
+ | Ubuntu 16.04LTS(amd64) 用のパッケージを置いておきます。 | ||
+ | |||
+ | ^ File ^ Stat ^ SHA1SUM ^ Info | | ||
+ | |{{:xg_series_devel:build_openocd:openocd_0.10.0-1build1_amd64.deb|}}|2018/03/07 11:38 2.0 MB|fd7529354bb0189f32c2095437dbf64cef6783e0| | | ||
+ | |||
+ | \\ | ||
+ | |||