# 请问大家用Debugger Probe吗？

**URL:** <https://forum.amebaiot.com/t/debugger-probe/1352>\
**Category:** Hardware\
**Tags:** evb-amb82\
**Created:** [July 14, 2022, 9:49pm UTC](https://forum.amebaiot.com/t/debugger-probe/1352 "2022-07-14T21:49:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![gingerologist](https://avatars.discourse-cdn.com/v4/letter/g/6bbea6/32.png) [@gingerologist](https://forum.amebaiot.com/u/gingerologist)\
**Post date:** [July 14, 2022, 9:49pm UTC](https://forum.amebaiot.com/t/debugger-probe/1352/1 "2022-07-14T21:49:48Z")

</div>

我买了一块AMB23； AN0400 Realtek Ameba-D Application Note里写了两种debug probe，一个是jlink，另一个似乎是realtek自己的debug probe，后面这个没见到哪里有卖，jlink太贵了，最近几年都是在ti/st/nxp的平台上开发很久没用过jlink了。

请问：

1. debugger probe是开发必须的吗？还是象内核一样print也够了？esp32的开发就基本不用debugger probe，只打印就够了。
2. 如果debugger probe是必须的，realtek那个自己的probe比jlink便宜很多吗？哪里有卖？还是就推荐jlink？jlink虽然贵但是对gdb的支持倒是很好的。

新人想听一下建议，准备在这个平台上试试开发了，虽然用命令行gdb有点难过但也还能接受。

---

<div class="post-metadata">

**Author:** ![wyy](https://avatars.discourse-cdn.com/v4/letter/w/bc8723/32.png) [@wyy](https://forum.amebaiot.com/u/wyy)\
**Post date:** [July 15, 2022, 2:19am UTC](https://forum.amebaiot.com/t/debugger-probe/1352/2 "2022-07-15T02:19:09Z")

</div>

> [@gingerologist](#):
>
> - debugger probe是开发必须的吗？还是象内核一样print也够了？esp32的开发就基本不用debugger probe，只打印就够了。

我的个人经验，debugger probe 不是必须的，主要还是靠 printf debug。联网的应用大部分都不方便使用debug probe 那种暂停处理器看 memory 的方式。

> [@gingerologist](#):
>
> - 如果debugger probe是必须的，realtek那个自己的probe比jlink便宜很多吗？哪里有卖？还是就推荐jlink？jlink虽然贵但是对gdb的支持倒是很好的。

我也没见过 AN0400 里面指的另一个 probe，主要还是用 jlink。我试过 jlink 最便宜的 [EDU mini](https://www.segger.com/products/debug-probes/j-link/models/j-link-edu-mini/) 是可以用的，就是接线需要个 adaptor board，但是经过一些设置后可以用 segger 的 ozone debugger。

---

<div class="post-metadata">

**Author:** ![gingerologist](https://avatars.discourse-cdn.com/v4/letter/g/6bbea6/32.png) [@gingerologist](https://forum.amebaiot.com/u/gingerologist)\
**Post date:** [July 15, 2022, 7:11pm UTC](https://forum.amebaiot.com/t/debugger-probe/1352/3 "2022-07-15T19:11:18Z")

</div>

非常感谢回答和建议。

再请教一个问题。根据AN0400文档，下载到目标板的方式似乎是两个，一个是用debugger probe，加上make flash命令，这个方式windows和linux均可，只要程序都装对了；另一个是用ImageTool，这个只有windows有，编译在ImageTool里写对地址用USB-serial cable就能下载；但ImageTool没有linux版本；我的理解对吗？

---

<div class="post-metadata">

**Author:** ![wyy](https://avatars.discourse-cdn.com/v4/letter/w/bc8723/32.png) [@wyy](https://forum.amebaiot.com/u/wyy)\
**Post date:** [July 16, 2022, 1:24am UTC](https://forum.amebaiot.com/t/debugger-probe/1352/4 "2022-07-16T01:24:29Z")

</div>

对的，那个有 GUI 的 ImageTool 只有 windows 版本。

如果必须用 linux，是可以尝试用 Arduino 里面的 [image tool linux 版本](https://github.com/ambiot/ambd_arduino/blob/dev/Arduino_package/ameba_d_tools_linux/upload_image_tool_linux)。 这个是专门针对 Arduino 的要求写的，功能和选项都比较少，用起来也比较麻烦，但是基本运作原理和 GUI ImageTool 一样。

把 [flashloader](https://github.com/ambiot/ambd_arduino/tree/dev/Arduino_package/ameba_d_tools_linux/tools/linux/image_tool) 和 ImageTool 需要的三个 bin 放进同样文件夹，提供 port 和 文件夹路径就可以了。

`upload_image_tool_windows.exe C:\Users\username\AppData\Local\Arduino15\packages\realtek\tools\ameba_d_tools\1.0.8 COM3 ameba_rtl8721d Disable Disable`

指令格式是可以从 Arduino [文件](https://github.com/ambiot/ambd_arduino/blob/dev/Arduino_package/hardware/platform.txt)看出来的。  
`upload_image_tool_windows.exe "{runtime.tools.ameba_d_tools.path}" "{serial.port}" "{board}" "{build.auto_upload_mode}" "{build.erase_flash}" "1500000" {upload.verbose}`

---

<div class="post-metadata">

**Author:** ![gingerologist](https://avatars.discourse-cdn.com/v4/letter/g/6bbea6/32.png) [@gingerologist](https://forum.amebaiot.com/u/gingerologist)\
**Post date:** [July 16, 2022, 2:28pm UTC](https://forum.amebaiot.com/t/debugger-probe/1352/5 "2022-07-16T14:28:33Z")

</div>

@wyy 非常感谢，我用arduino sdk里的`upload_image_tool_linux`成功的在Ubuntu Linux上烧录了自己编译的固件。现在开始读Makefile了，没找到任何文档关于项目的源码结构的，以及怎么编译和运行除了`project/realtek_amebaD_va0_example/GCC-RELEASE`这个文档里的例子之外的任何其它例子，比如ambd\_sdk/component/common/example目录下似乎有很多例子，但不知道怎么使用。我注意到论坛里有其他人问了类似的问题，也见你有回答，我还没来得及都看完，正在努力学习。

 ![Screenshot from 2022-07-16 22-17-05](https://us1.discourse-cdn.com/flex016/uploads/ameba/original/2X/f/f00d9bfd2eae266fe976708bc38d02c64b981d70.png)

---

<div class="post-metadata">

**Author:** ![wyy](https://avatars.discourse-cdn.com/v4/letter/w/bc8723/32.png) [@wyy](https://forum.amebaiot.com/u/wyy)\
**Post date:** [July 16, 2022, 5:06pm UTC](https://forum.amebaiot.com/t/debugger-probe/1352/6 "2022-07-16T17:06:23Z")

</div>

> [@gingerologist](#):
>
> 没找到任何文档关于项目的源码结构的

SDK 结构和使用可以参考 [AN0400](https://www.amebaiot.com/en/ameba-arduino-download-8722/) 第二和第三章。

> [@](#):
>
> peripheral examples are examples that show how to use hardware peripherals on the chip, e.g. ADC, flash, GPIO, I2C, RTC, SDIO, SPI, timer, UART
> 
> software examples are examples that show how to use software libraries for communication / data processing, e.g. file system, HTTP, MQTT, OTA, SSL, TCP, WiFi
> 
> For peripheral examples found in `\project\realtek_amebaD_va0_example\example_sources`, you should copy the example source files and replace those found in `\project\realtek_amebaD_va0_example\src\src_hp`.
> 
> For software examples found in `\component\common\example`, they can be enabled by modifying the corresponding `#define` in `\project\realtek_amebaD_va0_example\inc\inc_hp\platform_opts.h`. Some examples will also require you to enter the `make menuconfig` configuration menu to enable the feature first (e.g. BLE).

可以运行例子大概分两组：

- 硬件 / 外设例子 ( ADC, flash, GPIO, I2C, RTC, SDIO, SPI, timer, UART )
  - 例子代码文件在 `\project\realtek_amebaD_va0_example\example_sources`
  - 使用时应该直接复制粘贴代替 `\project\realtek_amebaD_va0_example\src\src_hp` 里面的文件

- 软件 / 通讯例子 ( HTTP, MQTT, OTA, SSL, TCP, WiFi )
  - 例子代码文件在 `\component\common\example`
  - 使用时需要更改 `\project\realtek_amebaD_va0_example\inc\inc_hp\platform_opts.h` 文件里面相对应的 `#define`，去开启功能
  - 有些功能还需要先在 `make menuconfig` 指令里面提前开启功能 ( BLE，MQTT )
