[i=s] 本帖最后由 hdydy 于 2025-5-13 23:28 编辑 [/i]
有时候代码在wsl2中编译,调试和串口工具在Windows中,需要在wsl2中用gdb连接Windows gdb server
Ai-WB2-32S-Kit开发板引出了bl602的默认JTAG引脚GPIO11,GPIO12,GPIO14,GPIO17

Windows中openocd开启gdb server
c:\software\openocd-0.12.0-mingw64\bin\openocd.exe -c "adapter driver cmsis-dap;transport select jtag;adapter speed 4000" -f C:/work/Ai-Thinker-WB2/tools/debug/602/tgt_602_xip_attach.cfg -c "bindto 0.0.0.0"

注意后面的 -c "bindto 0.0.0.0"
,不加的话,wsl2中gdb连不上server
wsl2中gdb连接gdb server
先查看Windows的IP地址 cat /etc/resolv.conf

然后连接server
toolchain_riscv_sifive_linux/bin/riscv64-unknown-elf-gdb
target remote 172.17.192.1:3333
前面如果不加 -c "bindto 0.0.0.0"
,会出现 Connection timed out

加了之后,连接成功

