3

我正在尝试调试 Atmel 给出的示例代码。我已经成功构建了程序。

对于调试,我使用eclipseplus gdbplus JlinkGDBServerplus 板载 Jtag。

虽然程序可以下载到板上并且运行良好,但我无法调试程序。每次我启动调试会话时,JLinkGDBServer都会因以下错误而终止

在此处输入图像描述

以下是控制台中显示的每个程序终止的消息:

JLinkGDB服务器

SEGGER J-Link GDB Server V4.96g Command Line Version

JLinkARM.dll V4.96g (DLL compiled Feb  6 2015 17:54:32)

-----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:      localhost only
Generate logfile:              on
Verify download:               on
Init regs on start:            on
Silent mode:                   off
Single run mode:               on
Target connection timeout:     5 ms
------J-Link related settings------
J-Link Host interface:         USB
J-Link script:                 none
J-Link settings file:          none
------Target related settings------
Target device:                 Cortex-A5
Target interface:              JTAG
Target interface speed:        1000kHz
Target endian:                 little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link OB-SAM3U128 V1 compiled Nov 28 2014 10:24:11
Hardware: V1.00
S/N: 480300770
Checking target voltage...
Target voltage: 3.30 V
Listening on TCP/IP port 2331
Connecting to target...
J-Link found 1 JTAG device, Total IRLen = 4
JTAG ID: 0x4BA00477 (Cortex-A5)
Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x00000000 (Data = 0xE59FF070)
Target interface speed set to 1000 kHz
Resetting target
Halting target CPU...
...Target halted (PC = 0x00000000)
PC = 00000000, CPSR = 000001D3 (SVC mode, ARM FIQ dis. IRQ dis.)
R0 = 00000004, R1 = 0031E0C3, R2 = 00016AAD, R3 = 00016965
R4 = 0031FFA0, R5 = C0542A08, R6 = C0512000, R7 = C051DA90
USR: R8 =C051DD80, R9 =410FC051, R10=C0512000, R11 =0031FF94, R12 =003020C0
     R13=BEBF5C70, R14=B6F12F1C
FIQ: R8 =9ABE0586, R9 =7E72A55E, R10=73DBFC6B, R11 =4F6717CF, R12 =05EDA809
     R13=5AC81462, R14=24683958, SPSR=370D2C67
SVC: R13=0031FF80, R14=00300620, SPSR=000001D3
ABT: R13=C0542B4C, R14=C000DC80, SPSR=A0000193
IRQ: R13=00320000, R14=80000053, SPSR=80000053
UND: R13=C0542B58, R14=C000DB60, SPSR=60000093
Reading all registers
Select auto target interface speed (1000 kHz)
Flash breakpoints enabled
Semi-hosting enabled (VectorAddr = 0x08)
Semihosting I/O set to TELNET and GDB Client
Downloading 15488 bytes @ address 0x00300000 - Verified OK
Writing register (PC = 0x00300080)
GDB closed TCP/IP connection
Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x00300080 (Data = 0xF1080100)
Resetting target
Writing register (PC = 0x00300000)
Writing register (PC = 0x00300000)
Starting target CPU...
GDB closed TCP/IP connection

arm-none-eabi-gdb

Warning: the current language does not match this frame.
The target endianness is set automatically (currently little endian)

半主机和 SWV

SEGGER J-Link GDB Server V4.96g - Terminal output channel
Connection closed by the GDB server.

以下是我的调试配置: 在此处输入图像描述 在此处输入图像描述 在此处输入图像描述

在运行命令下,框中的命令如下:

target remote localhost:2331
monitor reset
load
mon reg pc = 0x300000
mon reg pc = 0x300000
end

我不知道根本原因是什么。我怀疑这是arm-none-eabi-gdb导致JLinkGDBServer以退出代码终止的原因-1

请帮忙。

编辑 1

仅供参考,我正在使用 SAMA5D3x-EK 开发板。

4

1 回答 1

1

很难说,但看起来处理器在加载代码时是否出现异常。我建议验证 ELF 文件部分的加载地址,并查看项目的链接器设置。

希望能帮助到你...

于 2016-02-23T19:44:59.940 回答