3

GDB を使用して、OpenOCD と GNU ARM ツールチェーン (MacPorts と共にインストール) を使用して Stellaris LM3S8962 評価ボードをデバッグしようとしています。何がうまくいかないのかについてのアイデアはありますか? 不足しているものはありますか?

[bcochran@narada arm]$ arm-none-eabi-gdb
GNU gdb (GDB) 7.3
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-apple-darwin10.7.0 --target=arm-none-eabi".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
(gdb) set remotebaud 115200
(gdb) set debug remote 1
(gdb) file ~/dev/eclipse_workspace/hello_world_arm/bin/main.axf
Reading symbols from /Users/bcochran/dev/eclipse_workspace/hello_world_arm/bin/main.axf...(no debugging symbols found)...done.
(gdb) target remote localhost:4444
Remote debugging using localhost:4444
Sending packet: $qSupported:qRelocInsn+#9a...putpkt: Junk: {{}~Open On
Nak
Sending packet: $qSupported:qRelocInsn+#9a...putpkt: Junk: Chip Debugger
> 
Ack
Packet received: qSupported:qRelocInsn+
Packet qSupported (supported-packets) is supported
...
Packet qAttached (query-attached) is supported
Sending packet: $qOffsets#4b...Ack
Packet received: qOffsets
Malformed response to offset query, qOffsets

これがopenocdの出力です...不正な形式の応答が見つかるとすぐに、openocdはtelnet接続をドロップします...

[bcochran@narada bin]$ openocd -f ../openocd/luminary.cfg -f ../openocd/stellaris.cfg
Open On-Chip Debugger 0.6.0-dev-00014-g827057f (2011-08-09-22:02)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.berlios.de/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
500 kHz
Info : clock speed 500 kHz
Info : JTAG tap: lm3s.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : lm3s.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'telnet' connection from 4444
Error: error during read: Connection reset by peer
Info : dropped 'telnet' connection

私の arm-none-eabi-* ツールチェーンのバージョン出力は次のとおりです...

[bcochran@narada tcl]$ arm-none-eabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-none-eabi-gcc
COLLECT_LTO_WRAPPER=/opt/local/libexec/gcc/arm-none-eabi/4.6.1/lto-wrapper
Target: arm-none-eabi
Configured with: ../gcc-4.6.1/configure --prefix=/opt/local --target=arm-none-eabi --enable-languages=c,objc,c++,obj-c++ --infodir=/opt/local/share/info --mandir=/opt/local/share/man --datarootdir=/opt/local/share/arm-none-eabi-gcc --with-system-zlib --disable-nls --with-gmp=/opt/local --with-mpfr=/opt/local --with-mpc=/opt/local --enable-stage1-checking --enable-multilib --with-newlib --enable-interwork
Thread model: single
gcc version 4.6.1 (GCC)

[bcochran@narada tcl]$ arm-none-eabi-gdb -v
GNU gdb (GDB) 7.3
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-apple-darwin10.7.0 --target=arm-none-eabi".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.

ツールチェーンを使用してコンパイルし、OpenOCD を使用して結果の .bin ファイルをフラッシュできます。Web を検索しただけでは、「不正な応答」の問題に対する解決策を見つけることができませんでした。

アドバイスや支援をよろしくお願いします!

アップデート

@turbo-j と @guy-sirton からの回答のおかげで、もう少し先に進むことができました...これまでで最も役に立ったのは、実際に間違ったポート (3333 ではなく 4444) を使用していたことですが、今では取得しています-c "init" -c "halt" -c "reset halt"openocd コマンド文字列に追加するかどうかに関係なく、次のようになります。

(gdb) target remote localhost:3333
Remote debugging using localhost:3333
Remote 'g' packet reply is too long:     0080004000000000040000220f0000002833405451332abc009600a4d2b86092c0c118c03040d6f0284dbb93204b40c2000000000c010020ffffffff550400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000001

(これは、現在渡されている qOffsets req/resp の直後です)

OpenOCD 側:

Info : accepting 'gdb' connection from 3333
Warn : acknowledgment received, but no packet pending
Info : dropped 'gdb' connection

時々undefined debug reason 6 - target needs resetOpenOCDコンソールで...何が起こっているのかわかりませんが、機能に近づいているようです

アップデート 2

ファイル 'main.axf' または 'main.o' をロードしないと、実行されませんがRemote 'g' packet reply is too long、シンボルが表示されません... 他の Web サイトが主に .elf 拡張子を扱っていることに気付きました。違いはなんですか?コマンドから main.axf、main.bin (フラッシュ書き込みおよび正常に実行)、main.d、main.o を生成する StellarisWare の「Hello World」の例を使用していmakeます。Makefile に何か変なところがありますか?

4

5 に答える 5

4

これは@athquadが言及したようなパッチです。詳細については、彼の回答を参照してください。適切な場所に私を効率的に指摘してくれた彼に感謝し、パッチを提供せずに提供したことは本当に恥ずべきことです。:-P

http://pastebin.com/rdFF2eZd

openocd commit 631b80fd0835055bb385314f569f589b99d7441d に対してパッチが作成されました。

使用するには: (./configure オプションは jtag ハードウェアに依存します)

git clone git://git.code.sf.net/p/openocd/code openocd
cd openocd
patch -p1 < /path/to/patch/file
./bootstrap
./configure --enable-maintainer-mode --enable-ft2232_libftdi
nice make && sudo make install
于 2012-03-28T22:55:53.087 に答える
3

間違ったポートを使用しました。target remote localhost 3333GDB から OpenOCD への接続に使用します。ポート 4444 は、端末を介した人との対話を目的としており、GDB 接続に加えて使用できます。

于 2011-08-15T13:41:17.747 に答える
1

tacosとatquadの答えとして、OpenOCDをコンパイルしたくない場合は、GNU ARMツールチェーンの古いリリースを使用できます(たとえば、7.2.5で問題ありません)。(プリコンパイルされた0.4.0と0.5.0のウィンドウは両方ともこの問題を引き起こしています)。

于 2012-08-17T11:12:29.620 に答える
1

I have just encountered the same "'g' packet reply is too long" bug and traced it to its cause.

It seems that for a very long time GNU ARM tools have used an ARM model with 9 obsolete floating point registers. OpenOCD is wise to this and in response to GDB's register request supplies dummy values. However, recent eabi toolchains including GDB have come up to date and so your GDB no longer expects these registers - hence the message.

In the OpenOCD source I have patched armv7m_get_gdb_reg_list() in armv7m.c to make this work, but my patch isn't smart enough to know which GDB version is being used - it simply uses an #ifdef switch - so it would need a bit more work to integrate with the OpenOCD source code.

A patch could be available to anyone who wants.

于 2011-10-05T12:47:11.277 に答える
0

私は ARM で多くのリモート デバッグを行っていますが、異なるプロセッサ、OS、およびツールチェーンを使用しています :-) それにもかかわらず、ここにいくつかの考えがあります。

この提案:

openocd -f openocd.cfg -c "init" -c "停止" -c "停止のリセット"

ここから来ます: http://michaldemin.wordpress.com/2010/02/22/part-2-debugging-with-gdb-and-openocd/

さもないと:

  • リモートと gdb 間のリモート gdb プロトコルの不一致。別のバージョンのツールチェーンを試すことができます。Google で、他の人に役立つものを見つけてください。

  • コミュニケーションの問題。ボーレートを下げてみませんか?シリアル ポート パラメータが適切であることを確認します。

于 2011-08-14T19:27:05.177 に答える