arm/Stellaris LM4F120 LaunchPad評価ボード
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
[[FrontPage]]
#contents
2013/10/13からのアクセス回数 &counter;
** Stellaris LM4F120 LaunchPadがMacOSXでも開発できる [#y1...
インタフェース2013年6月号で紹介されたTiのStellaris LM4F12...
LM4F120 PaunchPadは、純正のデバッガを搭載し、信号処理に必...
&ref(LM4F120_LaunchPad.png);
** 開発環境を整える [#lc03b74b]
MacOSXでのコンパイルには、MacPortsとXCodeを使用しました。
ころころ変わるXCodeの無償問題ですが、XCode 5で無償に戻っ...
https://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt...
分かりづらいのは、XCodeをダウンロードしてコマンドラインの...
環境の関係上Version 4 のXCodeで説明します。
XCodeメニューからPreferencesを選択します。Downloadsアイコ...
ここで、Command Line Toolsをインストールします。
&ref(Downloads.jpg);
MacPortsは、[[MacPortsのサイト>http://www.macports.org/in...
** OpenOCDのコンパイル [#mde9a7f4]
準備ができたので、LM4F120 PaunchPad用のOpenOCDを作成しま...
最初にOpenOCDで使用するLIBUSBをインストールします。
ターミナルソフトを起動して、以下のコマンドを入力します。
#pre{{
$ sudo port install libusb-legacy +universe
}}
続いて、OpenOCDのダウンロードとコンパイルです。
#pre{{
$ mkdir ~/LM4F120/; cd ~/LM4F120
$ git clone git://git.code.sf.net/p/openocd/code openocd-...
$ cd openocd-code
$ ./bootstrap
$ ./configure --enable-maintainer-mode --enable-ti-icdi \
CFLAGS="-I/opt/local/include" LDFLAGS="-L/opt/local/lib -...
$ make
}}
MacPortsでは、インストールしたライブラリやインクルードフ...
CFLAGS="-I/opt/local/include" LDFLAGS="-L/opt/local/lib -...
** StellarisWareのインストール [#cd72132b]
StellarisWareは、LM4F120 PaunchPadを簡単に使えるようにし...
StellarisWareは、以下のURLからダウンロードします。
http://www.tij.co.jp/tool/jp/SW-EK-LM4F120XL
詳しくは、同ページの「StellarisWareのダウンロード・インス...
Windowsユーザなら、開発環境を含んだものをダウンロードして...
以下では、ダウンロードしたStellarisWareを~/~/LM4F120/stel...
** 動作確認 [#x8aa09fc]
動作確認用のプロジェクトを作成します。
#pre{{
$ mkdir ~/LM4F120/stellaris/project;
$ cd ~/LM4F120/stellaris/project
$ git clone https://github.com/scompo/stellaris-launchpad...
}}
Makefileの以下の部分を変更
STELLARISWARE_PATH=~/LM4F120/stellaris/StellarisWare
プロジェクトをmakeします。
#pre{{
$ make
}}
*** OpenOCDの起動 [#c7b4f8b6]
ボード用にOpenOCDコンフィグファイルとしてLM4F120XL.cfgを...
#pre{{
$ cat >LM4F120XL.cfg <<EOF
# TI Stellaris Launchpad ek-lm4f120xl Evaluation Kits
#
# http://www.ti.com/tool/ek-lm4f120xl
#
#
# NOTE: using the bundled ICDI interface is optional!
# This interface is not ftdi based as previous board were
#
source [find interface/ti-icdi.cfg]
set WORKAREASIZE 0x4000
set CHIPNAME lm4f120h5qr
source [find target/stellaris_icdi.cfg]
EOF
}}
以下の様に新しく作成したopenocdを起動し、以下の様なメッセ...
#pre{{
$ sudo ../../../openocd-code/src/openocd -s ../../../open...
Open On-Chip Debugger 0.8.0-dev-00131-gf4943ac (2013-09-0...
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : This adapter doesn't support configurable speed
Info : ICDI Firmware version: 9270
Info : lm4f120h5qr.cpu: hardware has 6 breakpoints, 4 wat...
}}
別のターミナルウィンドウを開いて、gdbを起動してopenocdの...
- target extended-remote :3333 → openedを使ってデバッグで...
- monitor reset halt → LM4F120を停止します
- load → プログラムをLM4F120にダウンロードします
- monitor reset init → LM4F120をリセットします
- b main.c:51 → ブレークポイントをmain.cの51行にセットし...
- display count → 変数countの値を表示します
#pre{{
$ arm-none-eabi-gdb main.axf
GNU gdb (GDB) 7.0.50.20100218-cvs
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.or...
This is free software: you are free to change and redistr...
There is NO WARRANTY, to the extent permitted by law. Ty...
and "show warranty" for details.
This GDB was configured as "--host=i386-apple-darwin10.3....
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /Users/take/proj/LM4F120_LaunchPad/s...
(gdb) target extended-remote :3333
Remote debugging using :3333
0x00000000 in myvectors ()
(gdb) monitor reset halt
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0000334c msp: 0x20001000
(gdb) load
Loading section .text, size 0x7ac lma 0x0
Loading section .data, size 0x800 lma 0x7ac
Start address 0x0, load size 4012
Transfer rate: 9 KB/sec, 2006 bytes/write.
(gdb) monitor reset init
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0000026c msp: 0x20007ffc
(gdb) b main.c:51
Breakpoint 1 at 0x300: file main.c, line 51.
(gdb) b Timer1A_ISR
Breakpoint 2 at 0x3b8: file main.c, line 69.
(gdb) display count
1: count = 2
(gdb) c
Continuing.
Note: automatically using hardware breakpoints for read-o...
Breakpoint 1, main () at main.c:52
52 SysCtlClockSet(SYSCTL_SYSDIV_2_5|SYSCTL_USE_P...
1: count = 0
(gdb) c
Continuing.
Breakpoint 2, Timer1A_ISR () at main.c:69
69 TimerIntClear(TIMER1_BASE, TIMER_TIMA_TIMEOUT);
1: count = 3
}}
この時、LM4F120 LaunchPadは、USBモデルとしても認識されま...
#pre{{
$ ls /dev/cu.*
cu.Bluetooth-Modem cu.Bluetooth-PDA-Sync cu.usbmodem...
}}
以上で、OpenOCDの動作確認は終了です。
LPCXpresso 6を使ったデバッグについては、lbed関連のページ...
** コメント [#k24faf5c]
#vote(おもしろかった[1],そうでもない[0],わかりずらい[0])
皆様のご意見、ご希望をお待ちしております。
#comment_kcaptcha
終了行:
[[FrontPage]]
#contents
2013/10/13からのアクセス回数 &counter;
** Stellaris LM4F120 LaunchPadがMacOSXでも開発できる [#y1...
インタフェース2013年6月号で紹介されたTiのStellaris LM4F12...
LM4F120 PaunchPadは、純正のデバッガを搭載し、信号処理に必...
&ref(LM4F120_LaunchPad.png);
** 開発環境を整える [#lc03b74b]
MacOSXでのコンパイルには、MacPortsとXCodeを使用しました。
ころころ変わるXCodeの無償問題ですが、XCode 5で無償に戻っ...
https://itunes.apple.com/us/app/xcode/id497799835?ls=1&mt...
分かりづらいのは、XCodeをダウンロードしてコマンドラインの...
環境の関係上Version 4 のXCodeで説明します。
XCodeメニューからPreferencesを選択します。Downloadsアイコ...
ここで、Command Line Toolsをインストールします。
&ref(Downloads.jpg);
MacPortsは、[[MacPortsのサイト>http://www.macports.org/in...
** OpenOCDのコンパイル [#mde9a7f4]
準備ができたので、LM4F120 PaunchPad用のOpenOCDを作成しま...
最初にOpenOCDで使用するLIBUSBをインストールします。
ターミナルソフトを起動して、以下のコマンドを入力します。
#pre{{
$ sudo port install libusb-legacy +universe
}}
続いて、OpenOCDのダウンロードとコンパイルです。
#pre{{
$ mkdir ~/LM4F120/; cd ~/LM4F120
$ git clone git://git.code.sf.net/p/openocd/code openocd-...
$ cd openocd-code
$ ./bootstrap
$ ./configure --enable-maintainer-mode --enable-ti-icdi \
CFLAGS="-I/opt/local/include" LDFLAGS="-L/opt/local/lib -...
$ make
}}
MacPortsでは、インストールしたライブラリやインクルードフ...
CFLAGS="-I/opt/local/include" LDFLAGS="-L/opt/local/lib -...
** StellarisWareのインストール [#cd72132b]
StellarisWareは、LM4F120 PaunchPadを簡単に使えるようにし...
StellarisWareは、以下のURLからダウンロードします。
http://www.tij.co.jp/tool/jp/SW-EK-LM4F120XL
詳しくは、同ページの「StellarisWareのダウンロード・インス...
Windowsユーザなら、開発環境を含んだものをダウンロードして...
以下では、ダウンロードしたStellarisWareを~/~/LM4F120/stel...
** 動作確認 [#x8aa09fc]
動作確認用のプロジェクトを作成します。
#pre{{
$ mkdir ~/LM4F120/stellaris/project;
$ cd ~/LM4F120/stellaris/project
$ git clone https://github.com/scompo/stellaris-launchpad...
}}
Makefileの以下の部分を変更
STELLARISWARE_PATH=~/LM4F120/stellaris/StellarisWare
プロジェクトをmakeします。
#pre{{
$ make
}}
*** OpenOCDの起動 [#c7b4f8b6]
ボード用にOpenOCDコンフィグファイルとしてLM4F120XL.cfgを...
#pre{{
$ cat >LM4F120XL.cfg <<EOF
# TI Stellaris Launchpad ek-lm4f120xl Evaluation Kits
#
# http://www.ti.com/tool/ek-lm4f120xl
#
#
# NOTE: using the bundled ICDI interface is optional!
# This interface is not ftdi based as previous board were
#
source [find interface/ti-icdi.cfg]
set WORKAREASIZE 0x4000
set CHIPNAME lm4f120h5qr
source [find target/stellaris_icdi.cfg]
EOF
}}
以下の様に新しく作成したopenocdを起動し、以下の様なメッセ...
#pre{{
$ sudo ../../../openocd-code/src/openocd -s ../../../open...
Open On-Chip Debugger 0.8.0-dev-00131-gf4943ac (2013-09-0...
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : This adapter doesn't support configurable speed
Info : ICDI Firmware version: 9270
Info : lm4f120h5qr.cpu: hardware has 6 breakpoints, 4 wat...
}}
別のターミナルウィンドウを開いて、gdbを起動してopenocdの...
- target extended-remote :3333 → openedを使ってデバッグで...
- monitor reset halt → LM4F120を停止します
- load → プログラムをLM4F120にダウンロードします
- monitor reset init → LM4F120をリセットします
- b main.c:51 → ブレークポイントをmain.cの51行にセットし...
- display count → 変数countの値を表示します
#pre{{
$ arm-none-eabi-gdb main.axf
GNU gdb (GDB) 7.0.50.20100218-cvs
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.or...
This is free software: you are free to change and redistr...
There is NO WARRANTY, to the extent permitted by law. Ty...
and "show warranty" for details.
This GDB was configured as "--host=i386-apple-darwin10.3....
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /Users/take/proj/LM4F120_LaunchPad/s...
(gdb) target extended-remote :3333
Remote debugging using :3333
0x00000000 in myvectors ()
(gdb) monitor reset halt
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0000334c msp: 0x20001000
(gdb) load
Loading section .text, size 0x7ac lma 0x0
Loading section .data, size 0x800 lma 0x7ac
Start address 0x0, load size 4012
Transfer rate: 9 KB/sec, 2006 bytes/write.
(gdb) monitor reset init
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0000026c msp: 0x20007ffc
(gdb) b main.c:51
Breakpoint 1 at 0x300: file main.c, line 51.
(gdb) b Timer1A_ISR
Breakpoint 2 at 0x3b8: file main.c, line 69.
(gdb) display count
1: count = 2
(gdb) c
Continuing.
Note: automatically using hardware breakpoints for read-o...
Breakpoint 1, main () at main.c:52
52 SysCtlClockSet(SYSCTL_SYSDIV_2_5|SYSCTL_USE_P...
1: count = 0
(gdb) c
Continuing.
Breakpoint 2, Timer1A_ISR () at main.c:69
69 TimerIntClear(TIMER1_BASE, TIMER_TIMA_TIMEOUT);
1: count = 3
}}
この時、LM4F120 LaunchPadは、USBモデルとしても認識されま...
#pre{{
$ ls /dev/cu.*
cu.Bluetooth-Modem cu.Bluetooth-PDA-Sync cu.usbmodem...
}}
以上で、OpenOCDの動作確認は終了です。
LPCXpresso 6を使ったデバッグについては、lbed関連のページ...
** コメント [#k24faf5c]
#vote(おもしろかった[1],そうでもない[0],わかりずらい[0])
皆様のご意見、ご希望をお待ちしております。
#comment_kcaptcha
ページ名:
SmartDoc