LoginSignup
2
0

More than 1 year has passed since last update.

MacからWio TerminalをOpenOCDを使ってデバッグする

Posted at

 はじめに

参考書籍ではWindows/Ubuntuを扱っているが、Macでもできたという追試験。

開発環境

  • MacBook Pro 2017
  • macOS 10.15.7 Catalina

使用ハードウェア

参考

というかこれをMacでやってみただけ。

ツールのインストール

OpenOCD

Homebrewでインストールできる。

brew install openocd

必要な設定ファイル類もパッケージに含まれていた。

Seeeduino XIAOをDAPLink化する

ここかXIAO用のDAPLinkをダウンロードした。

リンク先の要領でXIAOをブートローダーモードに入れるとMacがドライブとして認識するので、ダウンロードしたuf2をD&Dするだけ。

ハードウェアの接続

XIAO - Wio Terminal

Wio Terminalの箱を開け(この時点で保証対象外になると思うので注意!!)、フラットケーブルで接続する。
フラットケーブルの向きは

  • FFC変換コネクタ側は水色の面が表に出るように
  • Wio Terminal側は水色の面が箱の外側になるように

である。あと、スライドできるようになっているのでスライドしてゆるくしてから、ケーブルをはめ、締める。

XIAO - FPC変換基板

ダウンロードしたuf2と参考URLではピン配置が違うので注意。

FPCピン番号 SWD信号名 XIAOピン番号
1 SWDCLK 10
2 SWDIO 9
4 RESET 8
6 GND GND

OpenOCDの起動とGDBによる接続

下記でOpenOCDを立ち上げておく

% openocd -f interface/cmsis-dap.cfg -f target/atsame5x.cfg

Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: JTAG Supported
Info : CMSIS-DAP: FW Version = 1.10
Info : CMSIS-DAP: Serial# = F
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 2000 kHz
Info : SWD DPIDR 0x2ba01477
Info : atsame5.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for atsame5.cpu on 3333
Info : Listening on port 3333 for gdb connections

gdbを立ち上げ、target remoteコマンドで接続する。

% arm-none-eabi-gdb target/thumbv7em-none-eabihf/debug/sample1
GNU gdb (GNU Tools for Arm Embedded Processors 9-2019-q4-major) 8.3.0.20190709-git
Copyright (C) 2019 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 --target=arm-none-eabi".
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 online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from target/thumbv7em-none-eabihf/debug/sample1...
(gdb) target remote localhost:3333
Remote debugging using localhost:3333
dispatcher_2 () at ../arch/arm_m_gcc/common/core_support.S:728
728     cpsie i               /* PRIMASK ?򥯥ꥢ?ʳ???ߤ?????դ???? */
(gdb)

以上

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0