Hi,
I am using a MIMXRT1170-EVK board and I am trying to follow the instructions of the AN14071 AppNote to debug/trace software execution using a Segger J-Trace probe and Ozone
I followed the section 2.4 of the AppNote (soldered R1881, R1882, R1883, R1884 & R1885, removed jumpers J5, J6, J7 & J8, connected the probe and downloaded the Segger example project).
But when I press the "download and reset" button in Ozone to start debugging, the probe connects to the target and immediately the debug session ends up on error "Connection to target device lost".
Debugging works fine with MCUXpresso and the J-Trace probe (same board configuration), but it does not support trace feature. So, I have to use Ozone for this reason.
I have 2 MIMXRT1170-EVK boards and both behave the same way
Any idea that can help me to solve this problem?
Here is the Ozone console log:
Debug.Start();
Project.SetJLinkScript ("./NXP_IMXRT1176_M7_TracePins.pex");
Executed J-Link command "ScriptFile=./NXP_IMXRT1176_M7_TracePins.pex"
Device "MIMXRT1176XXXA_M7" selected.
ConfigTargetSettings() start
ConfigTargetSettings() end - Took 7us
Found SW-DP with ID 0x6BA02477
DPIDR: 0x6BA02477
CoreSight SoC-400 or earlier
Scanning AP map to find all available APs
AP[3]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x84770001, ADDR: 0x00000000)
AP[1]: AHB-AP (IDR: 0x24770011, ADDR: 0x01000000)
AP[2]: APB-AP (IDR: 0x54770002, ADDR: 0x02000000)
Iterating through AP map to find AHB-AP to use
AP[0]: Skipped. Could not read CPUID register
AP[1]: Skipped. Could not read CPUID register
AP[2]: Skipped. Not an AHB-AP
Attach to CPU failed. Executing connect under reset.
Failed to power up DAP
ConfigTargetSettings() start
ConfigTargetSettings() end - Took 6us
Found SW-DP with ID 0x6BA02477
DPIDR: 0x6BA02477
CoreSight SoC-400 or earlier
Scanning AP map to find all available APs
AP[3]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x84770001, ADDR: 0x00000000)
AP[1]: AHB-AP (IDR: 0x24770011, ADDR: 0x01000000)
AP[2]: APB-AP (IDR: 0x54770002, ADDR: 0x02000000)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FD000
CPUID register: 0x411FC272. Implementer code: 0x41 (ARM)
Cache: L1 I/D-cache present
Found Cortex-M7 r1p2, Little endian.
FPUnit: 8 code (BP) slots and 0 literal slots
CoreSight components:
ROMTbl[0] @ E00FD000
[0][0]: E00FE000 CID B105100D PID 000BB4C8 ROM Table
ROMTbl[1] @ E00FE000
[1][0]: E00FF000 CID B105100D PID 000BB4C7 ROM Table
ROMTbl[2] @ E00FF000
[2][0]: E000E000 CID B105E00D PID 000BB00C SCS-M7
[2][1]: E0001000 CID B105E00D PID 000BB002 DWT
[2][2]: E0002000 CID B105E00D PID 000BB00E FPB-M7
[2][3]: E0000000 CID B105E00D PID 000BB001 ITM
[1][1]: E0041000 CID B105900D PID 001BB975 ETM-M7
[1][2]: E0042000 CID B105900D PID 004BB906 CTI
[0][1]: E0043000 CID B105900D PID 001BB908 CSTF
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 device.
J-Link/J-Trace serial number: 933001269
Reset type: NORMAL (https://wiki.segger.com/J-Link_Reset_Strategies)
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
Reset: Core did not halt after reset, trying to disable WDT.
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
Core did not halt after reset, halting it manually.
AfterResetTarget() start
Valid application detected. Setting PC / SP manually.
Booting from FlexSPI1.
PC = 0x44041001
SP = 0x15445522
Clean & invalidate cached CPU registers
AfterResetTarget() end - Took 54.0ms
Elf.GetBaseAddr(); // returns 0x20200000
Target.ReadU32 (0x20200000); // returns 0x4, data is 0x20240000
Target.SetReg ("SP", 0x20240000);
Elf.GetEntryPointPC(); // returns 0x20200618
Target.SetReg ("PC", 0x20200618);
Elf.GetBaseAddr(); // returns 0x20200000
Target.ReadU32 (0x20200000); // returns 0x4, data is 0x20240000
Target.SetReg ("SP", 0x20240000);
Elf.GetEntryPointPC(); // returns 0x20200618
Target.SetReg ("PC", 0x20200618);
Executed J-Link command "TraceSampleAdjust TD = 500"
Executed J-Link command "SelectTraceSource=1"
Initializing trace type pin with configured Coresight trace components (* indicates set/detected address):
*TF: 0xE0045000
TMC: 0x00000000
ETB: 0x00000000
MTB: 0x00000000
*TPIU: 0xE0046000
*ETM: 0xE0041000
STM: 0x00000000
PTM: 0x00000000
OnTraceStart() start
Start: Initializing trace pins
End: Initializing trace pins
OnTraceStart() end - Took 4.49ms
Memory map 'after startup completion point' is active
Could not start CPU core. (ErrorCode: -1)
Connection to target device lost.
Solved! Go to Solution.
Hi,
I found what was causing the problem: the memory view in Ozone was pointing to an invalid address.
So, I guess Ozone was trying to read at that address, causing an exception on the core.
Hi,
I found what was causing the problem: the memory view in Ozone was pointing to an invalid address.
So, I guess Ozone was trying to read at that address, causing an exception on the core.
Hello @davidjaouen,
did you try the example from segger?
i.MXRT1176 - SEGGER Knowledge Base
Reagrds