gpt4 book ai didi

c - Eclipse J-Link ATMEL ARM ATSAME70Q21。当代码的起始地址不同于 0x00400000 时进行调试

转载 作者:太空宇宙 更新时间:2023-11-04 03:11:51 25 4
gpt4 key购买 nike

我正在尝试在 ATMEL ATSAME70Q21 上将 Eclipse 与 J-Link 结合使用。当代码起始地址位于默认地址 0x00400000 时,我能够完美地调试代码。它下载代码,在主断点处停止等。所有调试命令似乎都运行良好。

然而,当我将链接器文件上的地址更改为 0x00420000 时,代码已下载,但未命中主函数的断点。在控制台上可以看到很多消息(见下文)。

我试图通过在 Debug Configuration | 中发出以下命令来将 VTOR 寄存器设置为 0x0420000启动 |运行/重启命令监控 memU32 0xE000ED08 = 0x0420000但它的行为方式仍然相同。我相信 ARM 正试图在与内存 0x00420004 定义的起点不同的地址执行代码...

有什么想法吗?

控制台输出可以在下面找到。Flash 已被编程和验证。然而,最后两行表明出现了问题......


SEGGER J-Link GDB Server V6.34h Command Line Version

JLinkARM.dll V6.34h (DLL compiled Oct 9 2018 15:50:01)

Command line: -if swd -device ATSAME70Q21 -endian little -speed 1000 -port 2331 -swoport 2332 -telnetport 2333 -vd -ir -localhostonly 1 -log /home/user/svn/SDCO-504/AtmelSAM-2/FreeRTOS_IP_SAME70_v3/Debug/GDBlog -singlerun -strict -timeout 0 -nogui
-----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: 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: ATSAME70Q21
Target interface: SWD
Target interface speed: 1000kHz
Target endian: little

Connecting to J-Link...
J-Link is connected.
Firmware: J-Link V10 compiled Sep 4 2018 11:24:21
Hardware: V10.10
SAM-ICE found !
S/N: 20125801
OEM: SAM-ICE
Feature(s): RDI, GDB
Checking target voltage...
Target voltage: 3.32 V
Listening on TCP/IP port 2331
Connecting to target...Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x00000000 (Data = 0x20459B48)
Read 2 bytes @ address 0x00000000 (Data = 0x9B48)
Received monitor command: speed 1000
Target interface speed set to 1000 kHz
Received monitor command: clrbp
Received monitor command: reset
Resetting target
Received monitor command: halt
Halting target CPU...
...Target halted (PC = 0x0040E410)
Received monitor command: regs
R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
R12= 00000000, R13= 20459B48, MSP= 20459B48, PSP= 00000000
R14(LR) = FFFFFFFF, R15(PC) = 0040E410
XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
Read 4 bytes @ address 0x0040E410 (Data = 0xB084B580)
Read 2 bytes @ address 0x0040E410 (Data = 0xB580)
Received monitor command: speed auto
Select auto target interface speed (2000 kHz)
Received monitor command: flash breakpoints 1
Flash breakpoints enabled
Read 4 bytes @ address 0x0040E410 (Data = 0xB084B580)
Read 2 bytes @ address 0x0040E410 (Data = 0xB580)
Downloading 16128 bytes @ address 0x00420000 - Verified OK
Downloading 16080 bytes @ address 0x00423F00 - Verified OK
Downloading 16112 bytes @ address 0x00427DD0 - Verified OK
Downloading 16128 bytes @ address 0x0042BCC0 - Verified OK
Downloading 16064 bytes @ address 0x0042FBC0 - Verified OK
Downloading 14764 bytes @ address 0x00433A80 - Verified OK
Downloading 8 bytes @ address 0x0043742C - Verified OK
Downloading 2536 bytes @ address 0x00437434 - Verified OK
Comparing flash [....................] Done.
Verifying flash [....................] Done.
Writing register (PC = 0x 420000)
Read 4 bytes @ address 0x00420000 (Data = 0x20459B48)
Read 2 bytes @ address 0x00420000 (Data = 0x9B48)
Read 2 bytes @ address 0x0042FD5A (Data = 0xF7FF)
Read 2 bytes @ address 0x0042FD5A (Data = 0xF7FF)
Received monitor command: clrbp
Received monitor command: reset
Resetting target
Received monitor command: halt
Halting target CPU...
...Target halted (PC = 0x0040E410)
Received monitor command: memU32 0xE000ED08 = 0x0420000
Writing 0x00420000 @ address 0xE000ED08
Read 2 bytes @ address 0x0042FD5A (Data = 0xF7FF)
Read 2 bytes @ address 0x0042FD5A (Data = 0xF7FF)
Read 2 bytes @ address 0x0042FD5A (Data = 0xF7FF)
Received monitor command: regs
R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
R12= 00000000, R13= 20459B48, MSP= 20459B48, PSP= 00000000
R14(LR) = FFFFFFFF, R15(PC) = 0040E410
XPSR 01000000, APSR 00000000, EPSR 01000000, IPSR 00000000
CFBP 00000000, CONTROL 00, FAULTMASK 00, BASEPRI 00, PRIMASK 00
Reading all registers
Read 4 bytes @ address 0x0040E410 (Data = 0xB084B580)
Read 2 bytes @ address 0x0040E410 (Data = 0xB580)
Read 2 bytes @ address 0x0042FD5A (Data = 0xF7FF)
Read 2 bytes @ address 0x0042FD5A (Data = 0xF7FF)
WARNING: Failed to read memory @ address 0xFFFFFFFE
WARNING: Failed to read memory @ address 0xFFFFFFFE

最佳答案

您要在地址 0xE000ED08 处设置值,因此命令必须是:

set *0xE000ED08 = 0x0420000

我也很确定您需要将堆栈指针和程序计数器设置为有意义的地址,这可以通过这种方式完成:

set $sp = *(unsigned int*)0x0420000
set $pc = *(unsigned int*)0x0420004

请记住,此设备上的程序计数器实际上提前 4 个字节。

关于c - Eclipse J-Link ATMEL ARM ATSAME70Q21。当代码的起始地址不同于 0x00400000 时进行调试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55573772/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com