日記/2017-10-31/ESP-WROOM-32をARM-USB-TINYでGDBデバッグする
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
] [
リンク元
]
開始行:
* ESP-WROOM-32をARM-USB-TINYでGDBデバッグする [#y4c72cd7]
ESP-WROOM-32 で hello,world サンプルプログラムが動いたの...
** 環境 [#o10f0b9c]
#af_amazon(B06XWP81GP,right)
:ターゲットボード|ESP-WROOM-32 ESP32 DevKitC
:JTAGアダプタ|Olimex ARM-USB-TINY
:PC|OS Linux (debian x64; buster(testing))
:開発環境|ESP-IDF
- 素の ESP-WROOM-32 では取扱いが面倒なので,開発ボードを...
- JTAG アダプタは手持ちのものを使用.
-- 名前に ARM と入っているのはコネクタが ARM 標準だという...
-- 今買うなら [[ARM-USB-TINY-H というハイスピード対応のも...
#clear
** 構成 [#gb75d0cb]
OpenOCD で JTAG プロトコル ←→ GDB プロトコルの変換をさせ...
図にするとこんな感じかな.
+-------...
| ...
ESP-WROOM-32 <--(JTAG)--> ARM-USB-TINY <--(USB)-|-> Open...
| ...
+-------...
** OpenOCD のインストール [#adf51ae8]
[[ここ>https://github.com/espressif/esp-idf/blob/master/d...
** デバッグされるプログラムの用意 [#wc5982b1]
デバッグ対象となるプログラムを用意します.
今回は ESP32 のサンプルプログラムの「[[hello,world>http:/...
main/hello_world_main.c ファイルの app_main() 中で
- app_main() から抜けずにループするようにする
- リブートしないようにする
ようにしました.
デバッガに接続したままリセットがかかると,デバッガとの同...
このプログラムをターゲットボードに書き込みます.
** ESP-WROOM-32 と ARM-JTAG-TINY の接続 [#s2242dfe]
ESP-WROOM-32 と ARM-JTAG-TINY を以下の表に従って接続しま...
|>|ARM-JTAG-TINY|ESP-WROOM-32|h
|ピン番号|名称|ピン名称|h
|1|VTREF|3.3V|
|4|GND|GND|
|5|TDI|GPIO12|
|7|TMS|GPIO14|
|9|TCK|GPIO13|
|13|TDO|GPIO15|
ARM-USB-TINY のピン番号は[[ここ>http://infocenter.arm.com...
今回はブレッドボードワイヤで接続しました.
一時的なものでなく使いつづけるのならば,きちんとしたもの...
#ref(1509428396842.jpg,center,10%)
** OpenOCD の起動 [#l43f6fd3]
JTAG アダプタを接続し,OpenOCD を起動します.
$ cd ~/esp/openocd-esp32
$ bin/openocd -s share/openocd/scripts -f interface/ftdi...
board/esp-wroom-32.cfg
Open On-Chip Debugger 0.10.0-dev-ga859564 (2017-07-24-16...
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 20000 kHz
force hard breakpoints
Info : ftdi: if you experience problems at higher adapte...
Info : clock speed 20000 kHz
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5...
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5...
Info : esp32: Debug controller was reset (pwrstat=0x5F, ...
Info : esp32: Core was reset (pwrstat=0x5F, after clear ...
** GDB の起動 [#c0100953]
OpenOCD を動かしているものとは別にターミナルを開いて GDB ...
$ cd ~/esp/hello_world/
$ xtensa-esp32-elf-gdb build/hello-world.elf
GNU gdb (crosstool-NG crosstool-ng-1.22.0-73-ge28a011) 7...
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.o...
This is free software: you are free to change and redist...
There is NO WARRANTY, to the extent permitted by law. T...
and "show warranty" for details.
This GDB was configured as "--host=x86_64-build_pc-linux...
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources on...
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "w...
Reading symbols from build/hello-world.elf...done.
(gdb) target remote localhost:3333
Remote debugging using localhost:3333
0x00000001 in ?? ()
(gdb) c
あとは,普通に GDB デバッグするだけです.
注意としては,プログラムのコードは ROM 上にあるので,通常...
代わりにハードウェアブレークポイントを使います.
例えば
(gdb) b 37
などでブレークポイントを設定していたところを
(gdb) hb 37
とするだけです.
終了行:
* ESP-WROOM-32をARM-USB-TINYでGDBデバッグする [#y4c72cd7]
ESP-WROOM-32 で hello,world サンプルプログラムが動いたの...
** 環境 [#o10f0b9c]
#af_amazon(B06XWP81GP,right)
:ターゲットボード|ESP-WROOM-32 ESP32 DevKitC
:JTAGアダプタ|Olimex ARM-USB-TINY
:PC|OS Linux (debian x64; buster(testing))
:開発環境|ESP-IDF
- 素の ESP-WROOM-32 では取扱いが面倒なので,開発ボードを...
- JTAG アダプタは手持ちのものを使用.
-- 名前に ARM と入っているのはコネクタが ARM 標準だという...
-- 今買うなら [[ARM-USB-TINY-H というハイスピード対応のも...
#clear
** 構成 [#gb75d0cb]
OpenOCD で JTAG プロトコル ←→ GDB プロトコルの変換をさせ...
図にするとこんな感じかな.
+-------...
| ...
ESP-WROOM-32 <--(JTAG)--> ARM-USB-TINY <--(USB)-|-> Open...
| ...
+-------...
** OpenOCD のインストール [#adf51ae8]
[[ここ>https://github.com/espressif/esp-idf/blob/master/d...
** デバッグされるプログラムの用意 [#wc5982b1]
デバッグ対象となるプログラムを用意します.
今回は ESP32 のサンプルプログラムの「[[hello,world>http:/...
main/hello_world_main.c ファイルの app_main() 中で
- app_main() から抜けずにループするようにする
- リブートしないようにする
ようにしました.
デバッガに接続したままリセットがかかると,デバッガとの同...
このプログラムをターゲットボードに書き込みます.
** ESP-WROOM-32 と ARM-JTAG-TINY の接続 [#s2242dfe]
ESP-WROOM-32 と ARM-JTAG-TINY を以下の表に従って接続しま...
|>|ARM-JTAG-TINY|ESP-WROOM-32|h
|ピン番号|名称|ピン名称|h
|1|VTREF|3.3V|
|4|GND|GND|
|5|TDI|GPIO12|
|7|TMS|GPIO14|
|9|TCK|GPIO13|
|13|TDO|GPIO15|
ARM-USB-TINY のピン番号は[[ここ>http://infocenter.arm.com...
今回はブレッドボードワイヤで接続しました.
一時的なものでなく使いつづけるのならば,きちんとしたもの...
#ref(1509428396842.jpg,center,10%)
** OpenOCD の起動 [#l43f6fd3]
JTAG アダプタを接続し,OpenOCD を起動します.
$ cd ~/esp/openocd-esp32
$ bin/openocd -s share/openocd/scripts -f interface/ftdi...
board/esp-wroom-32.cfg
Open On-Chip Debugger 0.10.0-dev-ga859564 (2017-07-24-16...
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
adapter speed: 20000 kHz
force hard breakpoints
Info : ftdi: if you experience problems at higher adapte...
Info : clock speed 20000 kHz
Info : JTAG tap: esp32.cpu0 tap/device found: 0x120034e5...
Info : JTAG tap: esp32.cpu1 tap/device found: 0x120034e5...
Info : esp32: Debug controller was reset (pwrstat=0x5F, ...
Info : esp32: Core was reset (pwrstat=0x5F, after clear ...
** GDB の起動 [#c0100953]
OpenOCD を動かしているものとは別にターミナルを開いて GDB ...
$ cd ~/esp/hello_world/
$ xtensa-esp32-elf-gdb build/hello-world.elf
GNU gdb (crosstool-NG crosstool-ng-1.22.0-73-ge28a011) 7...
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.o...
This is free software: you are free to change and redist...
There is NO WARRANTY, to the extent permitted by law. T...
and "show warranty" for details.
This GDB was configured as "--host=x86_64-build_pc-linux...
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources on...
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "w...
Reading symbols from build/hello-world.elf...done.
(gdb) target remote localhost:3333
Remote debugging using localhost:3333
0x00000001 in ?? ()
(gdb) c
あとは,普通に GDB デバッグするだけです.
注意としては,プログラムのコードは ROM 上にあるので,通常...
代わりにハードウェアブレークポイントを使います.
例えば
(gdb) b 37
などでブレークポイントを設定していたところを
(gdb) hb 37
とするだけです.
ページ名:
-->