First, thank you so much for your patience and for reading my post. It is long. I've tried to be both thorough and concise.
Summary:
Debugging is very unstable using Segger J-Link Plus with MCUxpresso 11.4.1 and MCUxpresso 11.5.0. Using the debugger through MCUxpresso appears to attach and download but I cannot debug. The exact behavior varies. I’ve tried everything and I have workarounds that intermittently work. Details including debugger console output are below.
Version 11.2.1 was stable for me but my project requires upgrading to 11.4.1.
I am using a mature custom board using an imxrt1060. The debugging interface is SWD. I’ve been able to reproduce several of these issues on an evk with sdk examples. I have made a support ticket and one of my issues (unable to “Restart”) was able to be reproduced but I have many more.
SDK version is 2.8.6. I also tried 2.11 with MCUx 11.5.0
Details:
Behavior observed:
- Debug RAM config
- First breakpoint appears to be the hardfault handler. Pressing play halts at the same line. console output below. Look for WARNING: Failed to read memory @ address 0x10D7263A
- No start breakpoint hit. Pausing shows the PC is in bootrom (0x200000 range). I know the boot mode is set correctly and can prove it if you aren't satisfied. Using serial download mode to erase/program does not fix it.
- Gets to main but when I step even once it doesn't hit the next line/instruction it just appears to be running. When I press pause it has been in bootrom or flash and I want to say even RAM instructions but I cannot debug.
- Works after multiple attempts - hit debug and PC is in bootrom, stop and re-debug and I get the hardfault issue, trying a third time gets to main and I can debug
- Does not work with the "Reset before running" box checked in the “J-Link Debugger” tab of the debug configuration. I believe this option is supposed to be ignored for RAM configurations.
- Runs to main. Press run and pause work debugging appears normal for a very brief time, then pausing moments later shows the PC in bootrom
- Debug Flash config
- Goes to main. Stepping does not hit the next line. Hitting pause shows the PC at flash memory locations (call stack will show 0x60000000 addresses) but no link to code. If I make an "attach only" configuration I can debug the application normally but only after power cycling the board
- Latest behavior is that I cannot attach to it and after restarting / power cycling the board the program does not print anything to the console.
- Debug RAM or Flash
- Debugger "halts" at 0xdeadbeee. Pressing run goes to main and then I can debug normally (this also happens in MCUxpresso 11.2.1)
- Using my work arounds and finally being able to debug - cannot restart a debug session with the Restart button. Hitting restart appears to do nothing only that the program is "running" because the pause and stop buttons are active and the play button is grey. Hitting pause usually shows the PC at the same location repeatedly.
What I have tried:
- I've tried deleting and recreating debug configurations every way I know how: Quickstart > Debug, right click project > Debug As and using the debug configuration to add a configuration
- Monitor sleep 500 command
- Deleting the “monitor reset” command in J-Link debug config settings
- Verified the JLink is working using Segger's utilities such as J-FLash and J-Commander
- Using JFlash, erased flash and verified all 0xff's, then try to debug. Doesn't help
- Use the MCUBootUtility to erase/program the board. Programming and erasing works but debugging has the same issues.
- Ensure SEMC SDRAM is being initialized correctly
- Used different versions of evkmimxrt1060_sdram_init.jlinkscript
- Debugging a RAM config with an evk program in flash. Sometimes this has worked possibly from the DCD header being run before I can debug. Debugging still unstable.
- Different Segger driver versions with varying levels of failures/successes, all unstable
- 6.86 (version I have been using for months successfully with MCUx 11.2.1). I’m currently using this one as it seems to be the most successful
- 6.98
- 7.54 (comes with MCUx 11.4.1)
- 7.60b (comes with MCUx 11.5.0)
- 7.62a
- J-Link Plus hardware versions 10 and 11.
- I have uninstalled all (8?) versions of MCUxpresso (including deleting any eclipse cache folders) and JLink software and tried fresh installs of MCUx 11.4.1 and MCUx 11.5.0. Restart my computer. Use fresh workspace with only sdk examples and evk board. Unstable debugging still.
- Co-worker trying on their machine. They experienced the same variety of issues.
- Different boards – no change
- Other J-Link's – no change
- Updating the firmware on my J-Links of course – no change
- Unplugging and plugging debugger back in
- Power cycling the target
Console output when it starts at hardfault:
[08-4-2022 02:11:04] Executing Server: "C:\Program Files (x86)\SEGGER\JLink_V686\JLinkGDBServerCL.exe" -nosilent -swoport 2332 -select USB=851003997 -jlinkscriptfile C:\fwtemp\ThirdPartyLibraries\MQX\mqx\source\bsp\imxrt1062_fbd\gcc_mcux\evkmimxrt1060_sdram_init.jlinkscript -telnetport 2333 -singlerun -endian little -noir -speed auto -port 2331 -vd -device MIMXRT1062xxx5A -if SWD -halt -reportuseraction
SEGGER J-Link GDB Server V6.86 Command Line Version
JLinkARM.dll V6.86 (DLL compiled Sep 24 2020 17:31:31)
Command line: -nosilent -swoport 2332 -select USB=851003997 -jlinkscriptfile C:\fwtemp\ThirdPartyLibraries\MQX\mqx\source\bsp\imxrt1062_fbd\gcc_mcux\evkmimxrt1060_sdram_init.jlinkscript -telnetport 2333 -singlerun -endian little -noir -speed auto -port 2331 -vd -device MIMXRT1062xxx5A -if SWD -halt -reportuseraction
-----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: off
Verify download: on
Init regs on start: off
Silent mode: off
Single run mode: on
Target connection timeout: 0 ms
------J-Link related settings------
J-Link Host interface: USB
J-Link script: C:\fwtemp\ThirdPartyLibraries\MQX\mqx\source\bsp\imxrt1062_fbd\gcc_mcux\evkmimxrt1060_sdram_init.jlinkscript
J-Link settings file: none
------Target related settings------
Target device: MIMXRT1062xxx5A
Target interface: SWD
Target interface speed: auto
Target endian: little
Connecting to J-Link...
J-Link is connected.
Device "MIMXRT1062XXX5A" selected.
Firmware: J-Link V11 compiled Dec 9 2021 14:14:49
Hardware: V11.00
S/N: 851003997
Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
Checking target voltage...
Target voltage: 3.36 V
Listening on TCP/IP port 2331
Connecting to target...
ConfigTargetSettings() start
Config JTAG Speed not changed
ConfigTargetSettings() end
InitTarget() start
InitTarget()
_TargetHalt: CPU halted
InitTarget() end
Found SW-DP with ID 0x0BD11477
DPIDR: 0x0BD11477
Scanning AP map to find all available APs
AP[1]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x04770041)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FD000
CPUID register: 0x411FC271. Implementer code: 0x41 (ARM)
Found Cortex-M7 r1p1, Little endian.
FPUnit: 8 code (BP) slots and 0 literal slots
CoreSight components:
ROMTbl[0] @ E00FD000
ROMTbl[0][0]: E00FE000, CID: B105100D, PID: 000BB4C8 ROM Table
ROMTbl[1] @ E00FE000
ROMTbl[1][0]: E00FF000, CID: B105100D, PID: 000BB4C7 ROM Table
ROMTbl[2] @ E00FF000
ROMTbl[2][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
ROMTbl[2][1]: E0001000, CID: B105E00D, PID: 000BB002 DWT
ROMTbl[2][2]: E0002000, CID: B105E00D, PID: 000BB00E FPB-M7
ROMTbl[2][3]: E0000000, CID: B105E00D, PID: 000BB001 ITM
ROMTbl[1][1]: E0041000, CID: B105900D, PID: 001BB975 ETM-M7
ROMTbl[1][2]: E0042000, CID: B105900D, PID: 004BB906 CTI
ROMTbl[0][1]: E0040000, CID: B105900D, PID: 000BB9A9 TPIU-M7
ROMTbl[0][2]: E0043000, CID: B105F00D, PID: 001BB101 TSG
Cache: Separate I- and D-cache.
I-Cache L1: 32 KB, 512 Sets, 32 Bytes/Line, 2-Way
D-Cache L1: 32 KB, 256 Sets, 32 Bytes/Line, 4-Way
SetupTarget() start
Enabling i.MXRT SDRAM
DCDC trim value loaded.
Clock Init Done
SDRAM Init Done
SetupTarget() end
ConfigTargetSettings() start
Config JTAG Speed not changed
ConfigTargetSettings() end
InitTarget() start
InitTarget()
_TargetHalt: CPU halted
InitTarget() end
Found SW-DP with ID 0x0BD11477
DPIDR: 0x0BD11477
AP map detection skipped. Manually configured AP map found.
AP[0]: AHB-AP (IDR: Not set)
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FD000
CPUID register: 0x411FC271. Implementer code: 0x41 (ARM)
Found Cortex-M7 r1p1, Little endian.
FPUnit: 8 code (BP) slots and 0 literal slots
CoreSight components:
ROMTbl[0] @ E00FD000
ROMTbl[0][0]: E00FE000, CID: B105100D, PID: 000BB4C8 ROM Table
ROMTbl[1] @ E00FE000
ROMTbl[1][0]: E00FF000, CID: B105100D, PID: 000BB4C7 ROM Table
ROMTbl[2] @ E00FF000
ROMTbl[2][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
ROMTbl[2][1]: E0001000, CID: B105E00D, PID: 000BB002 DWT
ROMTbl[2][2]: E0002000, CID: B105E00D, PID: 000BB00E FPB-M7
ROMTbl[2][3]: E0000000, CID: B105E00D, PID: 000BB001 ITM
ROMTbl[1][1]: E0041000, CID: B105900D, PID: 001BB975 ETM-M7
ROMTbl[1][2]: E0042000, CID: B105900D, PID: 004BB906 CTI
ROMTbl[0][1]: E0040000, CID: B105900D, PID: 000BB9A9 TPIU-M7
ROMTbl[0][2]: E0043000, CID: B105F00D, PID: 001BB101 TSG
Cache: Separate I- and D-cache.
I-Cache L1: 32 KB, 512 Sets, 32 Bytes/Line, 2-Way
D-Cache L1: 32 KB, 256 Sets, 32 Bytes/Line, 4-Way
SetupTarget() start
Enabling i.MXRT SDRAM
DCDC trim value loaded.
Clock Init Done
SDRAM Init Done
SetupTarget() end
Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x80018CD6 (Data = 0x3328F8D3)
Read 4 bytes @ address 0x80015FB8 (Data = 0xB084B580)
Reading 64 bytes @ address 0x8007AFC0
Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x80018CD6 (Data = 0x3328F8D3)
Read 4 bytes @ address 0x80015FB8 (Data = 0xB084B580)
Reading 64 bytes @ address 0x8007AFC0
Downloading 16128 bytes @ address 0x80000000 - Verified OK
Downloading 15984 bytes @ address 0x80003F00 - Verified OK
Downloading 16080 bytes @ address 0x80007D70 - Verified OK
Downloading 16080 bytes @ address 0x8000BC40 - Verified OK
Downloading 16064 bytes @ address 0x8000FB10 - Verified OK
Downloading 15936 bytes @ address 0x800139D0 - Verified OK
Downloading 16016 bytes @ address 0x80017810 - Verified OK
Downloading 16064 bytes @ address 0x8001B6A0 - Verified OK
Downloading 16160 bytes @ address 0x8001F560 - Verified OK
Downloading 16192 bytes @ address 0x80023480 - Verified OK
Downloading 16144 bytes @ address 0x800273C0 - Verified OK
Downloading 16128 bytes @ address 0x8002B2D0 - Verified OK
Downloading 16064 bytes @ address 0x8002F1D0 - Verified OK
Downloading 16096 bytes @ address 0x80033090 - Verified OK
Downloading 16080 bytes @ address 0x80036F70 - Verified OK
Downloading 16048 bytes @ address 0x8003AE40 - Verified OK
Downloading 16032 bytes @ address 0x8003ECF0 - Verified OK
Downloading 16048 bytes @ address 0x80042B90 - Verified OK
Downloading 16128 bytes @ address 0x80046A40 - Verified OK
Downloading 16080 bytes @ address 0x8004A940 - Verified OK
Downloading 16112 bytes @ address 0x8004E810 - Verified OK
Downloading 16176 bytes @ address 0x80052700 - Verified OK
Downloading 16144 bytes @ address 0x80056630 - Verified OK
Downloading 16128 bytes @ address 0x8005A540 - Verified OK
Downloading 16064 bytes @ address 0x8005E440 - Verified OK
Downloading 16016 bytes @ address 0x80062300 - Verified OK
Downloading 16096 bytes @ address 0x80066190 - Verified OK
Downloading 16192 bytes @ address 0x8006A070 - Verified OK
Downloading 16336 bytes @ address 0x8006DFB0 - Verified OK
Downloading 16320 bytes @ address 0x80071F80 - Verified OK
Downloading 7212 bytes @ address 0x80075F40 - Verified OK
Downloading 4 bytes @ address 0x80077B6C - Verified OK
Downloading 4 bytes @ address 0x80077B70 - Verified OK
Downloading 3116 bytes @ address 0x80077B78 - Verified OK
Writing register (PC = 0x8000031c)
Read 4 bytes @ address 0x8000031C (Data = 0xB672B510)
Reading all registers
Read 4 bytes @ address 0x8000031C (Data = 0xB672B510)
Reading 64 bytes @ address 0x80004E00
Read 2 bytes @ address 0x80004E0E (Data = 0xF042)
Received monitor command: semihosting enable
Semi-hosting enabled (Handle on BKPT)
Received monitor command: exec SetRestartOnClose=1
Executed SetRestartOnClose=1
Setting breakpoint @ address 0x80004E0E, Size = 2, BPHandle = 0x0001
Starting target CPU...
Debugger requested to halt target...
...Target halted (PC = 0x800003AA)
Reading all registers
Removing breakpoint @ address 0x80004E0E, Size = 2
Read 4 bytes @ address 0x800003AA (Data = 0xE7FEE7FE)
Read 4 bytes @ address 0xE00FD000 (Data = 0x00001003)
Read 4 bytes @ address 0xE00FEFF4 (Data = 0x00000010)
Read 4 bytes @ address 0xE00FD004 (Data = 0xFFF43003)
Read 4 bytes @ address 0xE0040FF4 (Data = 0x00000090)
Read 4 bytes @ address 0xE00FD008 (Data = 0xFFF46003)
Reading register (MSP = 0x2001C7A0)
Read 4 bytes @ address 0xE0043FF4 (Data = 0x000000F0)
Read 4 bytes @ address 0xE00FD00C (Data = 0x1FF03002)
Read 4 bytes @ address 0x2001C7BC (Data = 0x8100008A)
Reading 64 bytes @ address 0x2001C780
WARNING: Failed to read memory @ address 0x10D7263A
Read 4 bytes @ address 0x800005BA (Data = 0xBC08B672)
Reading 64 bytes @ address 0x80000580
Read 4 bytes @ address 0x800005BA (Data = 0xBC08B672)
Read 4 bytes @ address 0x2001C7A0 (Data = 0x0000008A)
Read 4 bytes @ address 0xE00FD010 (Data = 0x00000000)
Read 4 bytes @ address 0x2001C7A4 (Data = 0xBF082E8E)
Read 4 bytes @ address 0xE00FE000 (Data = 0x00001003)
Read 4 bytes @ address 0xE0040FE0 (Data = 0x000000A9)
Read 4 bytes @ address 0xE0040FE4 (Data = 0x000000B9)
Read 4 bytes @ address 0xE0040FE8 (Data = 0x0000000B)
Read 4 bytes @ address 0xE0040FEC (Data = 0x00000000)
Read 4 bytes @ address 0xE0040FD0 (Data = 0x00000004)
Read 4 bytes @ address 0xE0040FBC (Data = 0x00000000)
Read 4 bytes @ address 0xE0040FCC (Data = 0x00000011)
Read 4 bytes @ address 0x2001C7A8 (Data = 0x10D7263B)
Read 4 bytes @ address 0xE00FFFF4 (Data = 0x00000010)
Read 4 bytes @ address 0xE00FE004 (Data = 0xFFF43003)
Read 4 bytes @ address 0x2001C7AC (Data = 0xFFFFFFFF)
Read 4 bytes @ address 0xE0041FF4 (Data = 0x00000090)
Read 4 bytes @ address 0xE00FE008 (Data = 0xFFF44003)
Read 4 bytes @ address 0x2001C7B0 (Data = 0x00000000)
Read 4 bytes @ address 0xE0042FF4 (Data = 0x00000090)
Read 4 bytes @ address 0xE00FE00C (Data = 0x1FF02002)
Read 4 bytes @ address 0x2001C7B4 (Data = 0x800005BB)
Read 4 bytes @ address 0xE00FE010 (Data = 0x00000000)
Read 4 bytes @ address 0x2001C7B8 (Data = 0x10D7263A)
Read 4 bytes @ address 0xE00FF000 (Data = 0xFFF0F003)
Read 4 bytes @ address 0xE0041FE0 (Data = 0x00000075)
Read 4 bytes @ address 0xE0041FE4 (Data = 0x000000B9)
Read 4 bytes @ address 0xE0041FE8 (Data = 0x0000001B)
Read 4 bytes @ address 0xE0041FEC (Data = 0x00000000)
Read 4 bytes @ address 0xE0041FD0 (Data = 0x00000004)
Read 4 bytes @ address 0xE0041FBC (Data = 0x47704A13)
Read 4 bytes @ address 0xE0041FCC (Data = 0x00000013)
Read 4 bytes @ address 0xE0042FE0 (Data = 0x00000006)
Read 4 bytes @ address 0xE0042FE4 (Data = 0x000000B9)
Read 4 bytes @ address 0xE0042FE8 (Data = 0x0000004B)
Read 4 bytes @ address 0xE0042FEC (Data = 0x00000000)
Read 4 bytes @ address 0xE0042FD0 (Data = 0x00000004)
Read 4 bytes @ address 0xE0042FBC (Data = 0x00000000)
Read 4 bytes @ address 0xE0042FCC (Data = 0x00000014)
Read 4 bytes @ address 0x2001C7BC (Data = 0x8100008A)
Read 4 bytes @ address 0xE000EFF4 (Data = 0x000000E0)
Read 4 bytes @ address 0xE00FF004 (Data = 0xFFF02003)
Reading 64 bytes @ address 0x10D72600
WARNING: Failed to read memory @ address 0x10D72600
WARNING: Failed to read memory @ address 0x10D7263A
Reading 64 bytes @ address 0x800005C0
Reading 64 bytes @ address 0x80000600
Read 4 bytes @ address 0xE000ED28 (Data = 0x00000100)
Read 4 bytes @ address 0xE0001FF4 (Data = 0x000000E0)
Read 4 bytes @ address 0xE00FF008 (Data = 0xFFF03003)
Read 1 bytes @ address 0xE000ED28 (Data = 0x00)
Read 4 bytes @ address 0xE0002FF4 (Data = 0x000000E0)
Read 4 bytes @ address 0xE00FF00C (Data = 0xFFF01003)
Read 1 bytes @ address 0xE000ED29 (Data = 0x01)
Read 4 bytes @ address 0xE0000FF4 (Data = 0x000000E0)
Read 4 bytes @ address 0xE00FF010 (Data = 0xFFF41002)
Read 2 bytes @ address 0xE000ED2A (Data = 0x0000)
Read 4 bytes @ address 0xE00FF014 (Data = 0xFFF42002)
Read 4 bytes @ address 0xE000ED2C (Data = 0x40000000)
Read 4 bytes @ address 0xE00FF018 (Data = 0x00000000)
Read 4 bytes @ address 0xE000ED30 (Data = 0x00000001)
Read 4 bytes @ address 0xE000EFE0 (Data = 0x0000000C)
Read 4 bytes @ address 0xE000EFE4 (Data = 0x000000B0)
Read 4 bytes @ address 0xE000EFE8 (Data = 0x0000000B)
Read 4 bytes @ address 0xE000EFEC (Data = 0x00000000)
Read 4 bytes @ address 0xE000EFD0 (Data = 0x00000004)
Read 4 bytes @ address 0xE0001FE0 (Data = 0x00000002)
Read 4 bytes @ address 0xE0001FE4 (Data = 0x000000B0)
Read 4 bytes @ address 0xE0001FE8 (Data = 0x0000000B)
Read 4 bytes @ address 0xE0001FEC (Data = 0x00000000)
Read 4 bytes @ address 0xE0001FD0 (Data = 0x00000004)
Read 4 bytes @ address 0xE0002FE0 (Data = 0x0000000E)
Read 4 bytes @ address 0xE0002FE4 (Data = 0x000000B0)
Read 4 bytes @ address 0xE0002FE8 (Data = 0x0000000B)
Read 4 bytes @ address 0xE0002FEC (Data = 0x00000000)
Read 4 bytes @ address 0xE0002FD0 (Data = 0x00000004)
Read 4 bytes @ address 0xE0000FE0 (Data = 0x00000001)
Read 4 bytes @ address 0xE0000FE4 (Data = 0x000000B0)
Read 4 bytes @ address 0xE0000FE8 (Data = 0x0000000B)
Read 4 bytes @ address 0xE0000FEC (Data = 0x00000000)
Read 4 bytes @ address 0xE0000FD0 (Data = 0x00000004)
Read 4 bytes @ address 0xE000ED34 (Data = 0x00000000)
Read 4 bytes @ address 0xE000ED38 (Data = 0x00000000)
Read 4 bytes @ address 0xE000EFA8 (Data = 0x00000000)
Console output when debugging and it suddenly goes to bootrom:
Debugger requested to halt target...
...Target halted (PC = 0x800162F8)
Reading all registers
Read 4 bytes @ address 0x800162F8 (Data = 0x6B737461)
Read 4 bytes @ address 0x80014392 (Data = 0x74616B73)
Reading 64 bytes @ address 0x2001C700
Reading 64 bytes @ address 0x2001C780
Read 4 bytes @ address 0x800162F8 (Data = 0x6B737461)
Read 4 bytes @ address 0x80014392 (Data = 0x74616B73)
Read 4 bytes @ address 0x80004E84 (Data = 0x6B737461)
Reading 64 bytes @ address 0x2001C740
Reading register (MSP = 0x2001C730)
Read 4 bytes @ address 0x2001C730 (Data = 0x6FF8513C)
Read 4 bytes @ address 0x2001C734 (Data = 0x8164A21F)
Read 4 bytes @ address 0x2001C738 (Data = 0x2001C748)
Read 4 bytes @ address 0x2001C73C (Data = 0x2001C748)
Read 4 bytes @ address 0x2001C740 (Data = 0x00000000)
Read 4 bytes @ address 0x2001C744 (Data = 0x401F81CC)
Read 4 bytes @ address 0x2001C748 (Data = 0x2001C758)
Read 4 bytes @ address 0x2001C74C (Data = 0x8006DB74)
Reading 64 bytes @ address 0x401F81C0
Reading 64 bytes @ address 0x401F8200
Read 4 bytes @ address 0xE000ED28 (Data = 0x00000500)
Read 1 bytes @ address 0xE000ED28 (Data = 0x00)
Read 1 bytes @ address 0xE000ED29 (Data = 0x05)
Read 2 bytes @ address 0xE000ED2A (Data = 0x0000)
Read 4 bytes @ address 0xE000ED2C (Data = 0x40000000)
Read 4 bytes @ address 0xE000ED30 (Data = 0x00000001)
Read 4 bytes @ address 0xE000ED34 (Data = 0x00000000)
Read 4 bytes @ address 0xE000ED38 (Data = 0x00000000)
Read 4 bytes @ address 0xE000EFA8 (Data = 0x00000208)
Starting target CPU...
ERROR: Cannot read register 15 (R15) while CPU is running
Reading all registers
ERROR: Cannot read register 0 (R0) while CPU is running
ERROR: Cannot read register 1 (R1) while CPU is running
...
ERROR: Cannot read register 64 (FPS31) while CPU is running
WARNING: Failed to read memory @ address 0xDEADBEEE
WARNING: Failed to read memory @ address 0xDEADBEEE
ERROR: Cannot read register 18 (PSP) while CPU is running
Reading register (PSP = 0xDEADBEEF)
WARNING: Failed to read memory @ address 0xDEADBEEE
Starting target CPU...
Debugger requested to halt target...
...Target halted (PC = 0x0020D108)
Reading all registers
Read 4 bytes @ address 0x0020D108 (Data = 0x203CF647)
Read 2 bytes @ address 0x0020D108 (Data = 0xF647)
Read 4 bytes @ address 0x0020D108 (Data = 0x203CF647)
Read 2 bytes @ address 0x0020D108 (Data = 0xF647)
Read 4 bytes @ address 0x0020ED48 (Data = 0x28007F20)
Read 2 bytes @ address 0x0020ED48 (Data = 0x7F20)
Read 4 bytes @ address 0x0020ED48 (Data = 0x28007F20)
Read 2 bytes @ address 0x0020ED48 (Data = 0x7F20)
Console output when it shows 0xdeadbeee in callstack and pressing play gets to main okay and debugging works:
[08-4-2022 03:15:06] Executing Server: "C:\Program Files (x86)\SEGGER\JLink_V686\JLinkGDBServerCL.exe" -nosilent -swoport 2332 -select USB=851003997 -telnetport 2333 -singlerun -endian little -ir -speed auto -port 2331 -vd -device MIMXRT1062xxx5A -if SWD -halt -reportuseraction
SEGGER J-Link GDB Server V6.86 Command Line Version
JLinkARM.dll V6.86 (DLL compiled Sep 24 2020 17:31:31)
Command line: -nosilent -swoport 2332 -select USB=851003997 -telnetport 2333 -singlerun -endian little -ir -speed auto -port 2331 -vd -device MIMXRT1062xxx5A -if SWD -halt -reportuseraction
-----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: off
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: MIMXRT1062xxx5A
Target interface: SWD
Target interface speed: auto
Target endian: little
Connecting to J-Link...
J-Link is connected.
Device "MIMXRT1062XXX5A" selected.
Firmware: J-Link V11 compiled Dec 9 2021 14:14:49
Hardware: V11.00
S/N: 851003997
Feature(s): RDI, FlashBP, FlashDL, JFlash, GDB
Checking target voltage...
Target voltage: 3.35 V
Listening on TCP/IP port 2331
Connecting to target...
InitTarget() start
InitTarget()
_TargetHalt: CPU halted
InitTarget() end
Found SW-DP with ID 0x0BD11477
DPIDR: 0x0BD11477
Scanning AP map to find all available APs
AP[1]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x04770041)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FD000
CPUID register: 0x411FC271. Implementer code: 0x41 (ARM)
Found Cortex-M7 r1p1, Little endian.
FPUnit: 8 code (BP) slots and 0 literal slots
CoreSight components:
ROMTbl[0] @ E00FD000
ROMTbl[0][0]: E00FE000, CID: B105100D, PID: 000BB4C8 ROM Table
ROMTbl[1] @ E00FE000
ROMTbl[1][0]: E00FF000, CID: B105100D, PID: 000BB4C7 ROM Table
ROMTbl[2] @ E00FF000
ROMTbl[2][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
ROMTbl[2][1]: E0001000, CID: B105E00D, PID: 000BB002 DWT
ROMTbl[2][2]: E0002000, CID: B105E00D, PID: 000BB00E FPB-M7
ROMTbl[2][3]: E0000000, CID: B105E00D, PID: 000BB001 ITM
ROMTbl[1][1]: E0041000, CID: B105900D, PID: 001BB975 ETM-M7
ROMTbl[1][2]: E0042000, CID: B105900D, PID: 004BB906 CTI
ROMTbl[0][1]: E0040000, CID: B105900D, PID: 000BB9A9 TPIU-M7
ROMTbl[0][2]: E0043000, CID: B105F00D, PID: 001BB101 TSG
Cache: Separate I- and D-cache.
I-Cache L1: 32 KB, 512 Sets, 32 Bytes/Line, 2-Way
D-Cache L1: 32 KB, 256 Sets, 32 Bytes/Line, 4-Way
InitTarget() start
InitTarget()
_TargetHalt: CPU halted
InitTarget() end
Found SW-DP with ID 0x0BD11477
DPIDR: 0x0BD11477
AP map detection skipped. Manually configured AP map found.
AP[0]: AHB-AP (IDR: Not set)
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FD000
CPUID register: 0x411FC271. Implementer code: 0x41 (ARM)
Found Cortex-M7 r1p1, Little endian.
FPUnit: 8 code (BP) slots and 0 literal slots
CoreSight components:
ROMTbl[0] @ E00FD000
ROMTbl[0][0]: E00FE000, CID: B105100D, PID: 000BB4C8 ROM Table
ROMTbl[1] @ E00FE000
ROMTbl[1][0]: E00FF000, CID: B105100D, PID: 000BB4C7 ROM Table
ROMTbl[2] @ E00FF000
ROMTbl[2][0]: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7
ROMTbl[2][1]: E0001000, CID: B105E00D, PID: 000BB002 DWT
ROMTbl[2][2]: E0002000, CID: B105E00D, PID: 000BB00E FPB-M7
ROMTbl[2][3]: E0000000, CID: B105E00D, PID: 000BB001 ITM
ROMTbl[1][1]: E0041000, CID: B105900D, PID: 001BB975 ETM-M7
ROMTbl[1][2]: E0042000, CID: B105900D, PID: 004BB906 CTI
ROMTbl[0][1]: E0040000, CID: B105900D, PID: 000BB9A9 TPIU-M7
ROMTbl[0][2]: E0043000, CID: B105F00D, PID: 001BB101 TSG
Cache: Separate I- and D-cache.
I-Cache L1: 32 KB, 512 Sets, 32 Bytes/Line, 2-Way
D-Cache L1: 32 KB, 256 Sets, 32 Bytes/Line, 4-Way
Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x00000000 (Data = 0x1853A3BE)
Read 2 bytes @ address 0x00000000 (Data = 0xA3BE)
Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x00000000 (Data = 0x1853A3BE)
Read 2 bytes @ address 0x00000000 (Data = 0xA3BE)
Received monitor command: reset
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
Resetting target
Downloading 8192 bytes @ address 0x60000000 - Verified OK
Downloading 16112 bytes @ address 0x60002000 - Verified OK
Downloading 16032 bytes @ address 0x60005EF0 - Verified OK
Downloading 16112 bytes @ address 0x60009D90 - Verified OK
Downloading 16048 bytes @ address 0x6000DC80 - Verified OK
Downloading 16032 bytes @ address 0x60011B30 - Verified OK
Downloading 9244 bytes @ address 0x600159D0 - Verified OK
Downloading 8 bytes @ address 0x60017DEC - Verified OK
Downloading 2632 bytes @ address 0x60017DF4 - Verified OK
J-Link: Flash download: Bank 0 @ 0x60000000: 1 range affected (131072 bytes)
J-Link: Flash download: Total: 2.191s (Prepare: 0.459s, Compare: 0.129s, Erase: 0.000s, Program & Verify: 1.599s, Restore: 0.004s)
J-Link: Flash download: Program & Verify speed: 79 KB/s
Writing register (PC = 0x6000231c)
Read 4 bytes @ address 0x6000231C (Data = 0xB672B510)
Reading all registers
Read 4 bytes @ address 0x6000231C (Data = 0xB672B510)
Reading 64 bytes @ address 0x6000E580
Read 2 bytes @ address 0x6000E588 (Data = 0xF007)
Received monitor command: exec SetRestartOnClose=1
Executed SetRestartOnClose=1
Setting breakpoint @ address 0x6000E588, Size = 2, BPHandle = 0x0001
Starting target CPU...
ERROR: Cannot read register 15 (R15) while CPU is running
Reading all registers
ERROR: Cannot read register 0 (R0) while CPU is running
ERROR: Cannot read register 1 (R1) while CPU is running
ERROR: Cannot read register 2 (R2) while CPU is running
ERROR: Cannot read register 3 (R3) while CPU is running
ERROR: Cannot read register 4 (R4) while CPU is running
ERROR: Cannot read register 5 (R5) while CPU is running
ERROR: Cannot read register 6 (R6) while CPU is running
ERROR: Cannot read register 7 (R7) while CPU is running
ERROR: Cannot read register 8 (R8) while CPU is running
ERROR: Cannot read register 9 (R9) while CPU is running
ERROR: Cannot read register 10 (R10) while CPU is running
ERROR: Cannot read register 11 (R11) while CPU is running
ERROR: Cannot read register 12 (R12) while CPU is running
ERROR: Cannot read register 13 (R13) while CPU is running
ERROR: Cannot read register 14 (R14) while CPU is running
ERROR: Cannot read register 15 (R15) while CPU is running
ERROR: Cannot read register 16 (XPSR) while CPU is running
ERROR: Cannot read register 17 (MSP) while CPU is running
ERROR: Cannot read register 18 (PSP) while CPU is running
ERROR: Cannot read register 24 (PRIMASK) while CPU is running
ERROR: Cannot read register 25 (BASEPRI) while CPU is running
ERROR: Cannot read register 26 (FAULTMASK) while CPU is running
Removing breakpoint @ address 0x6000E588, Size = 2
WARNING: Failed to read memory @ address 0xDEADBEEE
Read 4 bytes @ address 0xE00FD000 (Data = 0x00001003)
WARNING: Failed to read memory @ address 0xDEADBEEE
Read 4 bytes @ address 0xE00FEFF4 (Data = 0x00000010)
Read 4 bytes @ address 0xE00FD004 (Data = 0xFFF43003)
Read 4 bytes @ address 0xE0040FF4 (Data = 0x00000090)
Read 4 bytes @ address 0xE00FD008 (Data = 0xFFF46003)
Reading register (PSP = 0x2001FFF0)
Read 4 bytes @ address 0xE0043FF4 (Data = 0x000000F0)
Read 4 bytes @ address 0xE00FD00C (Data = 0x1FF03002)
Read 4 bytes @ address 0xE00FD010 (Data = 0x00000000)
Read 4 bytes @ address 0xE00FE000 (Data = 0x00001003)
Read 4 bytes @ address 0xE0040FE0 (Data = 0x000000A9)
Read 4 bytes @ address 0xE0040FE4 (Data = 0x000000B9)
Read 4 bytes @ address 0xE0040FE8 (Data = 0x0000000B)
Read 4 bytes @ address 0xE0040FEC (Data = 0x00000000)
Read 4 bytes @ address 0xE0040FD0 (Data = 0x00000004)
Read 4 bytes @ address 0xE0040FBC (Data = 0x00000000)
Read 4 bytes @ address 0xE0040FCC (Data = 0x00000011)
Read 4 bytes @ address 0xE00FFFF4 (Data = 0x00000010)
Read 4 bytes @ address 0xE00FE004 (Data = 0xFFF43003)
Read 4 bytes @ address 0xE0041FF4 (Data = 0x00000090)
Read 4 bytes @ address 0xE00FE008 (Data = 0xFFF44003)
Read 4 bytes @ address 0xE0042FF4 (Data = 0x00000090)
Read 4 bytes @ address 0xE00FE00C (Data = 0x1FF02002)
Read 4 bytes @ address 0xE00FE010 (Data = 0x00000000)
Read 4 bytes @ address 0xE00FF000 (Data = 0xFFF0F003)
Read 4 bytes @ address 0xE0041FE0 (Data = 0x00000075)
Read 4 bytes @ address 0xE0041FE4 (Data = 0x000000B9)
Read 4 bytes @ address 0xE0041FE8 (Data = 0x0000001B)
Read 4 bytes @ address 0xE0041FEC (Data = 0x00000000)
Read 4 bytes @ address 0xE0041FD0 (Data = 0x00000004)
Read 4 bytes @ address 0xE0041FBC (Data = 0x47704A13)
Read 4 bytes @ address 0xE0041FCC (Data = 0x00000013)
Read 4 bytes @ address 0xE0042FE0 (Data = 0x00000006)
Read 4 bytes @ address 0xE0042FE4 (Data = 0x000000B9)
Read 4 bytes @ address 0xE0042FE8 (Data = 0x0000004B)
Read 4 bytes @ address 0xE0042FEC (Data = 0x00000000)
Read 4 bytes @ address 0xE0042FD0 (Data = 0x00000004)
Read 4 bytes @ address 0xE0042FBC (Data = 0x00000000)
Read 4 bytes @ address 0xE0042FCC (Data = 0x00000014)
Read 4 bytes @ address 0xE000EFF4 (Data = 0x000000E0)
Read 4 bytes @ address 0xE00FF004 (Data = 0xFFF02003)
Read 4 bytes @ address 0xE0001FF4 (Data = 0x000000E0)
Read 4 bytes @ address 0xE00FF008 (Data = 0xFFF03003)
Read 4 bytes @ address 0xE0002FF4 (Data = 0x000000E0)
Read 4 bytes @ address 0xE00FF00C (Data = 0xFFF01003)
Read 4 bytes @ address 0xE0000FF4 (Data = 0x000000E0)
Read 4 bytes @ address 0xE00FF010 (Data = 0xFFF41002)
Read 4 bytes @ address 0xE00FF014 (Data = 0xFFF42002)
Read 4 bytes @ address 0xE00FF018 (Data = 0x00000000)
Read 4 bytes @ address 0xE000EFE0 (Data = 0x0000000C)
Read 4 bytes @ address 0xE000EFE4 (Data = 0x000000B0)
Read 4 bytes @ address 0xE000EFE8 (Data = 0x0000000B)
Read 4 bytes @ address 0xE000EFEC (Data = 0x00000000)
Read 4 bytes @ address 0xE000EFD0 (Data = 0x00000004)
Read 4 bytes @ address 0xE0001FE0 (Data = 0x00000002)
Read 4 bytes @ address 0xE0001FE4 (Data = 0x000000B0)
Read 4 bytes @ address 0xE0001FE8 (Data = 0x0000000B)
Read 4 bytes @ address 0xE0001FEC (Data = 0x00000000)
Read 4 bytes @ address 0xE0001FD0 (Data = 0x00000004)
Read 4 bytes @ address 0xE0002FE0 (Data = 0x0000000E)
Read 4 bytes @ address 0xE0002FE4 (Data = 0x000000B0)
Read 4 bytes @ address 0xE0002FE8 (Data = 0x0000000B)
Read 4 bytes @ address 0xE0002FEC (Data = 0x00000000)
Read 4 bytes @ address 0xE0002FD0 (Data = 0x00000004)
Read 4 bytes @ address 0xE0000FE0 (Data = 0x00000001)
Read 4 bytes @ address 0xE0000FE4 (Data = 0x000000B0)
Read 4 bytes @ address 0xE0000FE8 (Data = 0x0000000B)
Read 4 bytes @ address 0xE0000FEC (Data = 0x00000000)
Read 4 bytes @ address 0xE0000FD0 (Data = 0x00000004)
Setting breakpoint @ address 0x6000E588, Size = 2, BPHandle = 0x0002
Starting target CPU...
...Breakpoint reached @ address 0x6000E588
Reading all registers
Removing breakpoint @ address 0x6000E588, Size = 2
Read 4 bytes @ address 0x6000E588 (Data = 0xFB2FF007)
Reading 64 bytes @ address 0x2001FFC0
Performing single step...
...Breakpoint reached @ address 0x60015BEA
Reading all registers
Read 4 bytes @ address 0x60015BEA (Data = 0xAF00B580)
Read 4 bytes @ address 0x6000E58C (Data = 0xFBFCF000)
Reading 64 bytes @ address 0x2001FFC0
Read 2 bytes @ address 0x6000E58C (Data = 0xF000)
Setting breakpoint @ address 0x6000E58C, Size = 2, BPHandle = 0x0003
Starting target CPU...
...Breakpoint reached @ address 0x6000E58C
Reading all registers
Read 4 bytes @ address 0x6000E58C (Data = 0xFBFCF000)
Reading 64 bytes @ address 0x2001FFC0
Removing breakpoint @ address 0x6000E58C, Size = 2
Read 4 bytes @ address 0x6000E58C (Data = 0xFBFCF000)