当前位置: 首页 > news >正文

msys2+gdb-multiarch+jlinkGDBServer的nrf52调试环境搭建

前言

刚拿到一块nrf52840的板子,为了方便以后的开发,先搭建一个调试环境,为方便以后回忆记录一下过程。


提示:以下是本篇文章正文内容,下面案例可供参考

1.msys2命令行调用jlink工具

将jlink工具路径加入msys2的PATH,在MSYS2 UCRT64中使用下面命令。

$ echo 'export PATH="/c/Program Files/SEGGER/JLink_V794e:$PATH"' >> ~/.bashrc
$ source ~/.bashrc

这个~/.bashrc是打开MSYS2 UCRT64时要首先运行的命令。

2、开启jlink GDB Server

在MSYS2 UCRT64中使用下面命令:

$ JLinkGDBServerCL.exe -device nrf52832_xxaa -if swd -port 2331

得到下面log,应该是服务开启了。

3.用gdb-multiarch连接gdb server

新开一个MSYS2 UCRT64输入如下命令:

$ gdb-multiarch
(gdb) set architecture arm
(gdb) target remote localhost:2331

这个2331就是刚刚用jlink gdb server设置的端口号,下面是我的运行结果:

qjqadams@DESKTOP-T7T738U UCRT64 /
$ gdb-multiarch
GNU gdb (GDB) 15.2
Copyright (C) 2024 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 "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://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".
(gdb) set architecture arm
warning: A handler for the OS ABI "Windows" is not built into this configuration
of GDB.  Attempting to continue with the default arm settings.The target architecture is set to "arm".
(gdb) target remote localhost:2331
Remote debugging using localhost:2331
warning: A handler for the OS ABI "Windows" is not built into this configuration
of GDB.  Attempting to continue with the default arm settings.warning: No executable has been specified and target does not support
determining executable automatically.  Try using the "file" command.
0x00029fc2 in ?? ()
(gdb) ls
Undefined command: "ls".  Try "help".
(gdb) n
Cannot find bounds of current function
(gdb) n
Cannot find bounds of current function
(gdb) n
Cannot find bounds of current function
(gdb) c
Continuing.Program received signal SIGTRAP, Trace/breakpoint trap.
0x00029fc4 in ?? ()
(gdb) ir
Undefined command: "ir".  Try "help".
(gdb) i r
r0             0x8000              32768
r1             0x2000              8192
r2             0x50000000          1342177280
r3             0x4e4bb7            5131191
r4             0x4000              16384
r5             0x0                 0

参考

Using GDB with Nordic devices

gdb调试arm:gdb-multiarch gdbserver coredump


http://www.mrgr.cn/news/41965.html

相关文章:

  • 【Kubernetes】常见面试题汇总(五十四)
  • 实现实时数据推送:设计一个WebSocket服务器的实用指南
  • 组合框QGroupBox设置checked属性
  • 深度优先搜索:解锁无向图连通分量的编号策略
  • 【Ubuntu】使用阿里云apt源来更新apt源
  • 量化交易backtrader实践(三)_指标与策略篇(2)_内置指标A开头
  • OpenCV threhold()函数
  • B 私域模式升级:开源技术助力传统经销体系转型
  • 学习C语言(22)
  • Kubernetes-环境篇-01-mac开发环境搭建
  • msys2软件包手动安装
  • Stream流的终结方法(二)——collect
  • 【超声波焊接】塑胶紧固件设计参考
  • 第4篇:MSSQL日志分析----应急响应之日志分析篇
  • 874653
  • YOLO11改进|上采样篇|引入CARAFE上采样模块
  • C++-vector模拟实现
  • 【C语言系统编程】【第三部分:网络编程】3.2 数据传输和协议
  • Codeforces Round 922 (Div. 2) D题 Blocking Elements(单调队列优化dp)
  • 优化理论及应用精解【17】