0

我目前正在研究 NXP i.MX8M Mini 内的 ARM Cortex-M4。我能够在 Ubuntu VM 上的 Eclipse IDE 上为 M4 编译一个项目。我现在想通过仍然来自 Ubuntu 的 SEGGER Flasher ARM 探针在 M4 上进行调试。

我的探针很容易被 Ubuntu 识别,我只需键入以下命令即可启动 J-Link GDB 服务器:

$ sudo ./JLinkGDBServerCLExe

但是,如果我在没有 sudo 的情况下键入相同的命令,我会得到:

$ ./JLinkGDBServerCLExe
SEGGER J-Link GDB Server V7.58b Command Line Version

JLinkARM.dll V7.58b (DLL compiled Nov 16 2021 15:04:27)

-----GDB Server start settings-----
GDBInit file: none
GDB Server Listening port: 2331
SWO raw output listening port: 2332
Terminal I/O port: 2333
Accept remote connection: yes
Generate logfile: off
Verify download: off
Init regs on start: off
Silent mode: off
Single run mode: off
Target connection timeout: 0 ms
------J-Link related settings------
J-Link Host interface: USB
J-Link script: none
J-Link settings file: none
------Target related settings------
Target device: Unspecified
Target interface: JTAG
Target interface speed: 4000kHz
Target endian: little

Connecting to J-Link...
Connecting to J-Link failed. Connected correctly?
GDBServer will be closed...
Shutting down...
Could not connect to J-Link.
Please check power, connection and settings.

我的问题是,当我启动 eclipse 时,我得到的结果与在没有 sudo 的情况下启动 GDB 服务器相同。这似乎是一个权利问题,我该如何解决?

4

1 回答 1

0

正如@KamilCuk 所说,问题来自 udev 规则。

因此,您只需将 Segger 提供的规则与系统上的 J-Link 软件一起复制即可:

$ sudo cp 99-jlink.rules /etc/udev/rules.d

然后你必须重新启动系统:

$ reboot
于 2021-11-22T10:59:20.330 回答