我目前在调试我的MIMXRT1180-EVK在 VSCode 中使用 Zephyr RTOS 的
电路板。MCU Link 和 JLink 都无法正常工作,但存在不同的问题。
MCULink:
使用 MCULink(以及由 west 作为 GDB 服务器运行的 Linkserver),我无法访问多个地址区域(例如,所有外设地址 0x40000000/0x50000000 和 0x14000000 的外部 RAM)。VSCode 和 CortexDebug 扩展向我提供如下错误消息(尝试访问 CCM 寄存器):
-data-read-memory-bytes "0x44452200" 52error,msg="Unable to read memory."其他所有内容(闪烁、停止、断点、重置)都按预期工作。
在 MCUXpresso IDE 中调试示例应用时,一切(包括外设寄存器读出)都工作正常。
JLink:
当尝试选择 JLink 作为 west 的运行器时,我能够连接到正在运行的应用程序(west attach 或通过 CortexDebug VSCode-Extension),并且可以毫无问题地访问那里的所有相关地址(特别是外设寄存器地址)。尝试重置时,没有任何反应。应用程序似乎继续正常运行,没有重置(启动时未到达断点)。
尝试启动调试会话(west debug/west debugserver 或通过 CortexDebug VSCode-Extension)时,应用程序无法启动。JLinkScript 文件是 NXP 提供的文件。JLink GDB 服务器提供以下输出:
JLinkGDBServer -singlerun -nogui -if swd -port 50000 -swoport 50001 -telnetport 50002 -device MIMXRT1189XXX8_M33 -jlinkscriptfile /workdir/modules/hal/nxp/mcux/mcux-sdk/boards/evkmimxrt1180/jlinkscript/evkmimxrt1180_cm33.jlinkscriptSEGGER J-Link GDB Server V8.12 Command Line VersionJLinkARM.dll V8.12 (DLL compiled Dec 18 2024 15:43:28)Command line: -singlerun -nogui -if swd -port 50000 -swoport 50001 -telnetport 50002 -device MIMXRT1189XXX8_M33 -jlinkscriptfile /workdir/modules/hal/nxp/mcux/mcux-sdk/boards/evkmimxrt1180/jlinkscript/evkmimxrt1180_cm33.jlinkscript-----GDB Server start set
tings-----GDBInit file: noneGDB Server Listening port: 50000SWO raw output listening port: 50001Terminal I/O port: 50002Accept remote connection: yesGenerate logfile: offVerify download: offInit regs on start: offSilent mode: offSingle run mode: onTarget connection timeout: 0 ms------J-Link related settings------J-Link Host interface: USBJ-Link script: /workdir/modules/hal/nxp/mcux/mcux-sdk/boards/evkmimxrt1180/jlinkscript/evkmimxrt1180_cm33.jlinkscriptJ-Link settings file: none------Target related settings------Target device: MIMXRT1189XXX8_M33Target device parameters: noneTarget interface: SWDTarget interface speed: 4000kHzTarget endian: littleConnecting to J-Link...J-Link is connected.Firmware: J-Link V10 compiled Jan 30 2023 11:28:07Hardware: V10.10S/N: 50107660Feature(s): GDBChecking target voltage...Target voltage: 3.31 VListening on TCP/IP port 50000Connecting to target...Halting core...Core security extensions: ImplementedConnected to targetWaiting for GDB connection...Connected to 0000:0000:0000:0000:0000:0000:0000:0001GDB client (conn. 10) requested target.xml from GDB ServerReading common registers: Read register 'r0' (4 bytes) from hardware: 0x74280014Read register 'r1' (4 bytes) from hardware: 0x00000000Read register 'r2' (4 bytes) from hardware: 0x00000000Read register 'r3' (4 bytes) from hardware: 0x00000000Read register 'r4' (4 bytes) from hardware: 0xCC820014Read register 'r5' (4 bytes) from hardware: 0x19E30128Read register 'r6' (4 bytes) from hardware: 0x74280014Read register 'r7' (4 bytes) from hardware: 0x00000000Read register 'r8' (4 bytes) from hardware: 0x00000000Read register 'r9' (4 bytes) from hardware: 0x08000000Read register 'r10' (4 bytes) from hardware: 0x00000000Read register 'r11' (4 bytes) from hardware: 0x00000000Read register 'r12' (4 bytes) from hardware: 0x00000041Read register 'sp' (4 bytes) from hardware: 0xB8820014Read register 'lr' (4 bytes) from hardware: 0x2DE30128Read register 'pc' (4 bytes) from hardware: 0xD0810128Read register 'xpsr' (4 bytes) from hardware: 0x00000061Received monitor command: haltHalting target CPU......Target halted (PC = 0x280181D0)Received monitor command: resetResetting targetDownloading 16352 bytes @ address 0x28000000Downloading 16352 bytes @ address 0x28003FE0Downloading 13372 bytes @ address 0x28007FC0Downloading 16080 bytes @ address 0x2800B400Downloading 16048 bytes @ address 0x2800F2D0Downloading 16000 bytes @ address 0x28013180Downloading 16096 bytes @ address 0x28017000Downloading 15968 bytes @ address 0x2801AEE0Downloading 544 bytes @ address 0x2801ED40Downloading 8 bytes @ address 0x2801EF60Downloading 216 bytes @ address 0x2801EF68Downloading 360 bytes @ address 0x2801F040Downloading 1912 bytes @ address 0x2801F1A8Downloading 144 bytes @ address 0x2801F920Downloading 96 bytes @ address 0x2801F9B0Downloading 36 bytes @ address 0x2801FA10Downloading 24 bytes @ address 0x2801FA34Downloading 28 bytes @ address 0x2801FA4CDownloading 28 bytes @ address 0x2801FA68Downloading 16 bytes @ address 0x2801FA84Downloading 24 bytes @ address 0x2801FA94Downloading 20 bytes @ address 0x2801FAACDownloading 40 bytes @ address 0x2801FAC0Downloading 16 bytes @ address 0x2801FAE8Downloading 176 bytes @ address 0x2801FAF8Downloading 16 bytes @ address 0x2801FBA8Downloading 9404 bytes @ address 0x2801FBB8Downloading 1476 bytes @ address 0x28022074Downloading 36 bytes @ address 0x28022638Downloading 64 bytes @ address 0x2802265CDownloading 4 bytes @ address 0x2802269CDownloading 56 bytes @ address 0x280226A0Downloading 80 bytes @ address 0x280226D8Downloading 24 bytes @ address 0x28022728Downloading 88 bytes @ address 0x28022740Downloading 20 bytes @ address 0x28022798Downloading 4 bytes @ address 0x280227ACWriting register 'pc' = 0x2800E6A4Comparing flash [....................] Done.Received monitor command: resetResetting targetReading 64 bytes @ address 0x2800BF40Read 4 bytes @ address 0x2800C010 (Data = 0x14002874)Read 4 bytes @ address 0x2800C010 (Data = 0x14002874)Read 4 bytes @ address 0x2800C010 (Data = 0x14002874)Read 4 bytes @ address 0x2800C010 (Data = 0x14002874)Read 4 bytes @ address 0x2800C010 (Data = 0x14002874)Read 2 bytes @ address 0x2800BF52 (Data = 0x4B2F)Read 2 bytes @ address 0x2800BF56 (Data = 0x2300)Read 2 bytes @ address 0x2800BF5E (Data = 0xB08A)Read 2 bytes @ address 0x2800BF62 (Data = 0xF11C)Read 2 bytes @ address 0x2800C000 (Data = 0x2000)Reading 64 bytes @ address 0x2800C000Read 2 bytes @ address 0x2800C106 (Data = 0xF44F)Setting breakpoint @ address 0x2800BF52, Kind = 2, Type = THUMB, BPHandle = 0x0001Setting breakpoint @ address 0x2800BF56, Kind = 2, Type = THUMB, BPHandle = 0x0002Setting breakpoint @ address 0x2800BF5E, Kind = 2, Type = THUMB, BPHandle = 0x0003Setting breakpoint @ address 0x2800BF62, Kind = 2, Type = THUMB, BPHandle = 0x0004Setting breakpoint @ address 0x2800C000, Kind = 2, Type = THUMB, BPHandle = 0x0005Setting breakpoint @ address 0x2800C106, Kind = 2, Type = THUMB, BPHandle = 0x0006Starting target CPU...Reading common registers: Read register 'r0' (4 bytes) from hardware: 0x00000000Read register 'r1' (4 bytes) from hardware: 0x01000000Read register 'r2' (4 bytes) from hardware: 0x01000000Read register 'r3' (4 bytes) from hardware: 0x99000020Read register 'r4' (4 bytes) from hardware: 0x98680020Read register 'r5' (4 bytes) from hardware: 0x78170020Read register 'r6' (4 bytes) from hardware: 0x00000028Read register 'r7' (4 bytes) from hardware: 0xF8680020Read register 'r8' (4 bytes) from hardware: 0x00000000Read register 'r9' (4 bytes) from hardware: 0x24230040Read register 'r10' (4 bytes) from hardware: 0x00000000Read register 'r11' (4 bytes) from hardware: 0x00000000Read register 'r12' (4 bytes) from hardware: 0x0F000000Read register 'sp' (4 bytes) from hardware: 0x68280020Read register 'lr' (4 bytes) from hardware: 0xAF090020Read register 'pc' (4 bytes) from hardware: 0x68090020Read register 'xpsr' (4 bytes) from hardware: 0x00000021Removing breakpoint @ address 0x2800BF52, Size = 2Removing breakpoint @ address 0x2800BF56, Size = 2Removing breakpoint @ address 0x2800BF5E, Size = 2Removing breakpoint @ address 0x2800BF62, Size = 2Removing breakpoint @ address 0x2800C000, Size = 2Removing breakpoint @ address 0x2800C106, Size = 2Read 4 bytes @ address 0x20000968 (Data = 0xDEADBEEF)Read 2 bytes @ address 0x20000968 (Data = 0xBEEF)Reading 52 bytes @ address 0x44450000Reading 52 bytes @ address 0x44450000Read 4 bytes @ address 0x200009AE (Data = 0xBEEFDEAD)Read 2 bytes @ address 0x200009AE (Data = 0xDEAD)Read 4 bytes @ address 0x200009AE (Data = 0xBEEFDEAD)Read 2 bytes @ address 0x200009AE (Data = 0xDEAD)Reading 52 bytes @ address 0x44450080Reading 52 bytes @ address 0x44450080Reading 52 bytes @ address 0x44450100Reading 52 bytes @ address 0x44450100Reading 52 bytes @ address 0x44450180Reading 52 bytes @ address 0x44450180Reading 52 bytes @ address 0x44450200Reading 52 bytes @ address 0x44450200Reading 52 bytes @ address 0x44450280Reading 52 bytes @ address 0x44450280Reading 52 bytes @ address 0x44450300Reading 52 bytes @ address 0x44450300Reading 52 bytes @ address 0x44450380Reading 52 bytes @ address 0x44450380Reading 52 bytes @ address 0x44450400Reading 52 bytes @ address 0x44450400Reading 52 bytes @ address 0x44450480Reading 52 bytes @ address 0x44450480Reading 52 bytes @ address 0x44450500Reading 52 bytes @ address 0x44450500Reading 52 bytes @ address 0x44450580Reading 52 bytes @ address 0x44450580Reading 52 bytes @ address 0x44450600Reading 52 bytes @ address 0x44450600Reading 52 bytes @ address 0x44450680Reading 52 bytes @ address 0x44450680Reading 52 bytes @ address 0x44450700Reading 52 bytes @ address 0x44450700Reading 52 bytes @ address 0x44450780Reading 52 bytes @ address 0x44450780Reading 52 bytes @ address 0x44450800Reading 52 bytes @ address 0x44450800Reading 52 bytes @ address 0x44450880Reading 52 bytes @ address 0x44450880Reading 52 bytes @ address 0x44450900Reading 52 bytes @ address 0x44450900Reading 52 bytes @ address 0x44450980Reading 52 bytes @ address 0x44450980Reading 52 bytes @ address 0x44450A00Reading 52 bytes @ address 0x44450A00Reading 52 bytes @ address 0x44450A80Reading 52 bytes @ address 0x44450A80Reading 52 bytes @ address 0x44450B00Reading 52 bytes @ address 0x44450B00Reading 52 bytes @ address 0x44450B80Reading 52 bytes @ address 0x44450B80Reading 52 bytes @ address 0x44450C00Reading 52 bytes @ address 0x44450C00Reading 52 bytes @ address 0x44450C80Reading 52 bytes @ address 0x44450C80Reading 52 bytes @ address 0x44450D00Reading 52 bytes @ address 0x44450D00Reading 52 bytes @ address 0x44450D80Reading 52 bytes @ address 0x44450D80Reading 52 bytes @ address 0x44450E00Reading 52 bytes @ address 0x44450E00Reading 52 bytes @ address 0x44450E80Reading 52 bytes @ address 0x44450E80Reading 52 bytes @ address 0x44450F00Reading 52 bytes @ address 0x44450F00Reading 52 bytes @ address 0x44450F80Reading 52 bytes @ address 0x44450F80Reading 52 bytes @ address 0x44451000Reading 52 bytes @ address 0x44451000Reading 52 bytes @ address 0x44451080Reading 52 bytes @ address 0x44451080Reading 52 bytes @ address 0x44451100Reading 52 bytes @ address 0x44451100Reading 52 bytes @ address 0x44451180Reading 52 bytes @ address 0x44451180Reading 52 bytes @ address 0x44451200Reading 52 bytes @ address 0x44451200Reading 52 bytes @ address 0x44451280Reading 52 bytes @ address 0x44451280Reading 52 bytes @ address 0x44451300Reading 52 bytes @ address 0x44451300Reading 52 bytes @ address 0x44451380Reading 52 bytes @ address 0x44451380Reading 52 bytes @ address 0x44451400Reading 52 bytes @ address 0x44451400Reading 52 bytes @ address 0x44451480Reading 52 bytes @ address 0x44451480Reading 52 bytes @ address 0x44451500Reading 52 bytes @ address 0x44451500Reading 52 bytes @ address 0x44451580Reading 52 bytes @ address 0x44451580Reading 52 bytes @ address 0x44451600Reading 52 bytes @ address 0x44451600Reading 52 bytes @ address 0x44451680Reading 52 bytes @ address 0x44451680Reading 52 bytes @ address 0x44451700Reading 52 bytes @ address 0x44451700Reading 52 bytes @ address 0x44451780Reading 52 bytes @ address 0x44451780Reading 52 bytes @ address 0x44451800Reading 52 bytes @ address 0x44451800Reading 52 bytes @ address 0x44451880Reading 52 bytes @ address 0x44451880Reading 52 bytes @ address 0x44451900Reading 52 bytes @ address 0x44451900Reading 52 bytes @ address 0x44451980Reading 52 bytes @ address 0x44451980Reading 52 bytes @ address 0x44451A00Reading 52 bytes @ address 0x44451A00Reading 52 bytes @ address 0x44451A80Reading 52 bytes @ address 0x44451A80Reading 52 bytes @ address 0x44451B00Reading 52 bytes @ address 0x44451B00Reading 52 bytes @ address 0x44451B80Reading 52 bytes @ address 0x44451B80Reading 52 bytes @ address 0x44451C00Reading 52 bytes @ address 0x44451C00Reading 52 bytes @ address 0x44451C80Reading 52 bytes @ address 0x44451C80Reading 52 bytes @ address 0x44451D00Reading 52 bytes @ address 0x44451D00Reading 52 bytes @ address 0x44451D80Reading 52 bytes @ address 0x44451D80Reading 52 bytes @ address 0x44451E00Reading 52 bytes @ address 0x44451E00Reading 52 bytes @ address 0x44451E80Reading 52 bytes @ address 0x44451E80Reading 52 bytes @ address 0x44451F00Reading 52 bytes @ address 0x44451F00Reading 52 bytes @ address 0x44451F80Reading 52 bytes @ address 0x44451F80Reading 52 bytes @ address 0x44452000Reading 52 bytes @ address 0x44452000Reading 52 bytes @ address 0x44452080Reading 52 bytes @ address 0x44452080Reading 52 bytes @ address 0x44452100Reading 52 bytes @ address 0x44452100Reading 52 bytes @ address 0x44452180Reading 52 bytes @ address 0x44452180Reading 52 bytes @ address 0x44452200Reading 52 bytes @ address 0x44452200Reading 52 bytes @ address 0x44452280Reading 52 bytes @ address 0x44452280Reading 52 bytes @ address 0x44452300Reading 52 bytes @ address 0x44452300Reading 52 bytes @ address 0x44452380Reading 52 bytes @ address 0x44452380Reading 52 bytes @ address 0x44452400Reading 52 bytes @ address 0x44452400Reading 52 bytes @ address 0x44452480Reading 52 bytes @ address 0x44452480Reading 252 bytes @ address 0x44454400Reading 252 bytes @ address 0x44454400Reading 544 bytes @ address 0x44454800Reading 544 bytes @ address 0x44454800Reading 128 bytes @ address 0x44454C00Reading 128 bytes @ address 0x44454C00Reading 1588 bytes @ address 0x44455000Reading 1588 bytes @ address 0x44455000Reading 4096 bytes @ address 0x44458000Reading 4096 bytes @ address 0x44458000Reading 4096 bytes @ address 0x44459000Reading 4096 bytes @ address 0x44459000Reading 1332 bytes @ address 0x4445A000Reading 1332 bytes @ address 0x4445A000Setting breakpoint @ address 0x2800BF52, Kind = 2, Type = THUMB, BPHandle = 0x0007Setting breakpoint @ address 0x2800BF56, Kind = 2, Type = THUMB, BPHandle = 0x0008Setting breakpoint @ address 0x2800BF5E, Kind = 2, Type = THUMB, BPHandle = 0x0009Setting breakpoint @ address 0x2800BF62, Kind = 2, Type = THUMB, BPHandle = 0x000ASetting breakpoint @ address 0x2800C000, Kind = 2, Type = THUMB, BPHandle = 0x000BSetting breakpoint @ address 0x2800C106, Kind = 2, Type = THUMB, BPHandle = 0x000CStarting target CPU...Reading common registers: Read register 'r0' (4 bytes) from hardware: 0x00000000Read register 'r1' (4 bytes) from hardware: 0x01000000Read register 'r2' (4 bytes) from hardware: 0x01000000Read register 'r3' (4 bytes) from hardware: 0x99000020Read register 'r4' (4 bytes) from hardware: 0x98680020Read register 'r5' (4 bytes) from hardware: 0x78170020Read register 'r6' (4 bytes) from hardware: 0x00000028Read register 'r7' (4 bytes) from hardware: 0xF8680020Read register 'r8' (4 bytes) from hardware: 0x00000000Read register 'r9' (4 bytes) from hardware: 0x24230040Read register 'r10' (4 bytes) from hardware: 0x00000000Read register 'r11' (4 bytes) from hardware: 0x00000000Read register 'r12' (4 bytes) from hardware: 0x0F000000Read register 'sp' (4 bytes) from hardware: 0x68280020Read register 'lr' (4 bytes) from hardware: 0xAF090020Read register 'pc' (4 bytes) from hardware: 0x68090020Read register 'xpsr' (4 bytes) from hardware: 0x00000021Removing breakpoint @ address 0x2800BF52, Size = 2Removing breakpoint @ address 0x2800BF56, Size = 2Removing breakpoint @ address 0x2800BF5E, Size = 2Removing breakpoint @ address 0x2800BF62, Size = 2Removing breakpoint @ address 0x2800C000, Size = 2Removing breakpoint @ address 0x2800C106, Size = 2Read 4 bytes @ address 0x20000968 (Data = 0xDEADBEEF)Read 2 bytes @ address 0x20000968 (Data = 0xBEEF)Reading 52 bytes @ address 0x44450000Read 4 bytes @ address 0x200009AE (Data = 0xBEEFDEAD)Read 2 bytes @ address 0x200009AE (Data = 0xDEAD)Read 4 bytes @ address 0x200009AE (Data = 0xBEEFDEAD)Read 2 bytes @ address 0x200009AE (Data = 0xDEAD)
此外,当尝试从 MCUXpressoIDE 中启动调试会话时,我可以看到类似的行为。