[doc] update cklink debug rst
|
@ -5,6 +5,90 @@
|
|||
|
||||
本节主要介绍如何使用调试器进行代码的调试。
|
||||
|
||||
使用 CKlink + Eclipse 调试代码
|
||||
使用 CKLink + Eclipse 调试代码
|
||||
-------------------------------------------
|
||||
|
||||
- 从 Bouffalo Lab 开发者社区下载带有 RISC-V 工具链的 `Eclipse 安装包 <https://dev.bouffalolab.com/media/upload/download/BouffaloLab_eclipse_x86_64_win_v1.2.0.zip>`_ 。
|
||||
- 从 T-HEAD 官网下载最新版本 `CKLink 驱动 <https://occ.t-head.cn/community/download?id=4103855596351066112>`_
|
||||
|
||||
安装和配置 Eclipse
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- 将获取到的 eclipse 压缩包拷贝到您的工作目录,解压 eclipse 压缩包
|
||||
- 进入 eclipse 目录,双击 ``eclipse.exe`` 启动 eclipse
|
||||
- 选择您的 ``Workspace`` 目录,点击 ``Launch`` 进入工作空间
|
||||
|
||||
.. figure:: img/eclipse1.png
|
||||
:alt:
|
||||
|
||||
- 点击菜单栏中 ``Window->preferences`` 打开环境配置相关页面,准备导入相关的配置环境
|
||||
|
||||
.. figure:: img/eclipse2.png
|
||||
:alt:
|
||||
|
||||
- 点击下图 1 处的图标,打开导入配置界面,按照如图所示步骤,选择 ``eclipse.exe`` 目录下的 ``bflb_mcu_preferences.epf`` 配置文件。
|
||||
|
||||
.. figure:: img/eclipse3.png
|
||||
:alt:
|
||||
|
||||
- 选择好对应的文件后,点击 ``Finish``,在弹出的对话框选中点击 ``cancel`` ,不用重新启动。
|
||||
|
||||
.. figure:: img/eclipse4.png
|
||||
:alt:
|
||||
|
||||
- 点击 菜单栏 ``File->Import`` ,打开导入项目的配置界面
|
||||
|
||||
.. figure:: img/eclipse5.png
|
||||
:alt:
|
||||
|
||||
- 在打开的 ``Import`` 窗口中选择 ``C/C++->Existing Code as Makefile Project`` ,然后点击 ``Next``
|
||||
|
||||
.. figure:: img/eclipse6.png
|
||||
:alt:
|
||||
|
||||
- 导入 bl_mcu_sdk 的工程路径后,点击 ``Finsh`` 完成
|
||||
|
||||
.. figure:: img/eclipse7.png
|
||||
:alt:
|
||||
|
||||
- 最终效果如下
|
||||
|
||||
.. figure:: img/eclipse8.png
|
||||
:alt:
|
||||
|
||||
安装和配置 CKLink
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- 将下载的 CKLink 安装包解压,并双击 `Setup` ,一路 next 即可,安装完成以后,桌面会有一个 `T-HeadDebugServer` 图标
|
||||
|
||||
.. figure:: img/cklink1.png
|
||||
:alt:
|
||||
|
||||
.. figure:: img/cklink2.png
|
||||
:alt:
|
||||
|
||||
- 将板子的 JTAG 引脚和 CKLink 调试器连接以后,点击 **三角** 按钮,如果变成 **圆圈**,则表示 JTAG 连接成功。如果失败,则需要检查 JTAG 线序是否正确。
|
||||
|
||||
.. figure:: img/cklink3.png
|
||||
:alt:
|
||||
|
||||
|
||||
调试 ELF
|
||||
^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
完成上述两步以后,如果是在 **flash 上调试,需要先将 bin 文件烧录到芯片中** ,最后才能够进行下面的调试环节。
|
||||
|
||||
- 在 Eclipse 中 点击 `debug` 图标,并点击 `Debug Configurations`
|
||||
|
||||
.. figure:: img/eclipse9.png
|
||||
:alt:
|
||||
|
||||
- 左侧打开 `GDB Hardware Debugging`,选择对应芯片的配置按钮,并导入编译生成的 **elf**,最后点击 `Debug`
|
||||
|
||||
.. figure:: img/eclipse10.png
|
||||
:alt:
|
||||
|
||||
- 最终进入调试界面
|
||||
|
||||
.. figure:: img/eclipse11.png
|
||||
:alt:
|
||||
|
|
BIN
docs/source/get_started/img/cklink1.png
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
docs/source/get_started/img/cklink2.png
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
docs/source/get_started/img/cklink3.png
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
docs/source/get_started/img/cklink4.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
docs/source/get_started/img/eclipse1.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
docs/source/get_started/img/eclipse10.png
Normal file
After Width: | Height: | Size: 65 KiB |
BIN
docs/source/get_started/img/eclipse11.png
Normal file
After Width: | Height: | Size: 79 KiB |
BIN
docs/source/get_started/img/eclipse2.png
Normal file
After Width: | Height: | Size: 178 KiB |
BIN
docs/source/get_started/img/eclipse3.png
Normal file
After Width: | Height: | Size: 156 KiB |
BIN
docs/source/get_started/img/eclipse4.png
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
docs/source/get_started/img/eclipse5.png
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
docs/source/get_started/img/eclipse6.png
Normal file
After Width: | Height: | Size: 33 KiB |
BIN
docs/source/get_started/img/eclipse7.png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
docs/source/get_started/img/eclipse8.png
Normal file
After Width: | Height: | Size: 28 KiB |
BIN
docs/source/get_started/img/eclipse9.png
Normal file
After Width: | Height: | Size: 9.8 KiB |