I have this working now, my elf file has content at address 0 which overwrites the initial SP and reset vector. I fixed that and now JRun runs perfectly with semihosting.
Posts by 40490FDB
-
-
This is better, but still not working:
Start target application...OK
Reading output from target until exit command.
==============================================FATAL ERROR: Target halted on unknown BKPT.
-
Semihosting works perfectly using Ozone and my test results are written to the terminal window. But since we are evaluating ways to perform automated software test I need to be able to run the tests in a batch mode such as using JRun. Trying JRun, no terminal messages are shown and it appears to hang indefinitely. Is it possible to use semihosting with JRun instead of Ozone? Or perhaps J-Link?
jrun -device "MK66FN2M0XXX18" --semihost mytest.elf
J-Run compiled Sep 14 2021 16:09:55
(c) 2018-2021 SEGGER Microcontroller GmbH http://www.segger.comOpen application...OK
Set target device to MK66FN2M0XXX18...OK
Select SWD interface...OK
Set interface speed to 4000 kHz...OK
Reset target...OK
Download 00000000-000061CF...OK
Download 00006400-0003EE63...OK
Download 0004EE64-0004EE87...OK
Download 1FFF0000-2000C00B...OK
Start target application...OK
Reading output from target until exit command.
==============================================
(Hangs here.) -
I've been using Ozone with J-Link for trace. I had trouble several months ago but the latest versions seem to work well.
But we are interested in using the profiling features of J-Trace. It sounds like the answer is, we can't because Atmel/Microchip didn't plumb the required signals to the pins.
Thanks for the replies.
-
We are considering purchasing a J-Trace for profiling features not available on our J-Link devices. Using IAR.
I'm trying to find which pins need to be routed to a connector and what connector that is. Also, if the J-Trace is compatible with our device.
We use an SAMA5D27 Arm processor. We have a JTAG connector but presumably ETM requires more pins and another connector(?).
Will the J-Trace work with our processor (support profiling features)? What connector is needed and what is the pinout regarding the A5?
I've looked through the datasheet (Microchip DS60001476C) and haven't found the information there.
Thanks!
-
-
Thanks, that was very helpful! The trace is working now.
Since I don't fully understand what the ReadIntoTraceCache command is doing, can you provide details? Is there a limitation to the number of bytes cached? For example, I have a fairly large app loaded into DDRAM and would like to be able to trace all of it. It's well over a MB.
-
-
I'm using Ozone for instruction trace with a ATSAMA5D27.
Initially a bootloader is run from SRAM and trace and breakpoints work well at that point. But as soon as execution is started in DRAM the instruction trace listing is mostly 0xFFs.
Using J-Link Ultra+ with Trace Buffer setting. Perhaps there are settings related to memory access that need to be tweaked when executing in DRAM.
Thanks
-
I have two SAMA5D2 Xplained boards, tried them both. I have tried all combinations of open and closed JP1 and JP2. I have installed Ozone on another PC, still not working.
I also have two SOM1-EK dev kits, might try running the trace example on those.
Thanks!
-
Trying to run the example in Embedded Studio (release 4.18) results in an error message: Failed to download application. Generic error. Please check J-Link and target connection.
Ozone is V2.62f. When I select "Start Debugging" "Download and Reset Program" I get the following in the console window. (Thanks.)
(BTW I used jlink.exe to connect to the XPlained board and it seems to be OK.)
Debug.Stop();
J-Link: disconnected from target device
Debug.SetConnectMode (CM_DOWNLOAD_RESET);
Debug.Start();
Device "ATSAMA5D27" selected.
ConfigTargetSettings() start
---Setting ETB available---
---Setting ETB Base Address---
---Setting ETM Base Address---
ConfigTargetSettings() end
TotalIRLen = 4, IRPrint = 0x01
JTAG chain detection found 1 devices:
#0 Id: 0x5BA00477, IRLen: 04, CoreSight JTAG-DP
Scanning AP map to find all available APs
AP[1]: Stopped AP scan as end of AP map has been reached
AP[0]: APB-AP (IDR: 0x44770002)
Iterating through AP map to find APB-AP to use
AP[0]: APB-AP found
ROMTbl[0][0]: CompAddr: 80020000 CID: B105100D, PID:04-000BB4A5 ROM Table
ROMTbl[1][0]: CompAddr: 80030000 CID: B105900D, PID:04-001BBC05 Cortex-A5
Found Cortex-A5 r0p1
3 code breakpoints, 2 data breakpoints
Debug architecture ARMv7.0
Data endian: little
Main ID register: 0x410FC051
I-Cache L1: 32 KB, 512 Sets, 32 Bytes/Line, 2-Way
D-Cache L1: 32 KB, 256 Sets, 32 Bytes/Line, 4-Way
System control register:
Instruction endian: little
Level-1 instruction cache enabled
Level-1 data cache disabled
MMU disabled
Branch prediction enabled
Using stop mode for background memory accesses: https://wiki.segger.com/Memory_accesses
J-Link: connected to target device
ResetTarget() start
J-Link script: Reset
J-Link script: Core did not halt after reset. Halting core...
J-Link script: Done
ResetTarget() end
CPU could not be halted
Can not read register 26 (R13_SVC) while CPU is running
Can not read register 9 (R15 (PC)) while CPU is running
Memory access: CPU temp. halted: https://wiki.segger.com/Memory_accesses#Stop_mode
Can not read register 26 (R13_SVC) while CPU is running
Can not read register 9 (R15 (PC)) while CPU is running
Can not read register 26 (R13_SVC) while CPU is running
Can not read register 9 (R15 (PC)) while CPU is running
Executed J-Link command "SelectTraceSource=0"
Can not read register 0 (R0) while CPU is running
Can not read register 1 (R1) while CPU is running
Can not read register 2 (R2) while CPU is running
Can not read register 3 (R3) while CPU is running
Can not read register 4 (R4) while CPU is running
Can not read register 5 (R5) while CPU is running
Can not read register 6 (R6) while CPU is running
Can not read register 7 (R7) while CPU is running
Can not read register 10 (R8_USR) while CPU is running
Can not read register 11 (R9_USR) while CPU is running
Can not read register 12 (R10_USR) while CPU is running
Can not read register 13 (R11_USR) while CPU is running
Can not read register 14 (R12_USR) while CPU is running
Can not read register 26 (R13_SVC) while CPU is running
Can not read register 27 (R14_SVC) while CPU is running
Can not read register 9 (R15 (PC)) while CPU is running
Can not read register 8 (CPSR) while CPU is running
Can not read register 25 (SPSR_SVC) while CPU is running
Can not read register 38 (FPSCR) while CPU is
CPU is not halted -
I've tried the ATSAMA5D2 trace example from the tested devices link shown above, without success. I have a J-Link Base as well as a J-Link Ultra+. The documentation specifies J-Link Pro so perhaps someone can confirm that neither of my units will perform the trace function?
Thanks
-
Using the right cable solved the problem. Thanks.
-
I downloaded 6.34g, updated the firmware, but no help.
The connector I use is an Atmel part.
SEGGER J-Link V6.34g Log File
DLL Compiled: Sep 26 2018 14:45:08
Logging started @ 2018-10-03 14:30
T0D6C 000:000 JLINK_GetDLLVersion() returns 63407 (0000ms, 0000ms total)
T0D6C 000:000 JLINK_GetCompileDateTime() (0000ms, 0000ms total)
T0D6C 000:002 JLINK_SelectUSB(Port = 0) returns 0x00 (0005ms, 0005ms total)
T0D6C 000:007 JLINK_SetWarnOutHandler(...) (0000ms, 0005ms total)
T0D6C 000:007 JLINK_OpenEx(...)
Firmware: J-Link V10 compiled Sep 4 2018 11:24:21
Hardware: V10.10
S/N: 50114432
Feature(s): GDB
TELNET listener socket opened on port 19021WEBSRV
Starting webserver (2521ms, 2526ms total)
T0D6C 000:007 WEBSRV Webserver running on local port 19080 (2522ms, 2527ms total)
T0D6C 000:007 returns O.K. (2522ms, 2527ms total)
T0D6C 002:530 JLINK_GetFirmwareString(...) (0000ms, 2527ms total)
T0D6C 002:533 JLINK_GetHardwareVersion() returns 0x18A88 (0000ms, 2527ms total)
T0D6C 002:550 JLINK_EMU_HasCapEx(0x00000026) returns 0x00 (0000ms, 2527ms total)
T0D6C 002:550 JLINK_EMU_GetProductId() (0000ms, 2527ms total)
T0D6C 002:550 JLINK_GetHardwareVersion() returns 0x18A88 (0000ms, 2527ms total)
T0D6C 002:550 JLINK_GetFirmwareString(...) (0000ms, 2527ms total)
T0D6C 002:550 JLINK_GetEmuCaps() returns 0xB9FF7BBF (0000ms, 2527ms total)
T0D6C 002:550 JLINK_GetEmuCaps() returns 0xB9FF7BBF (0000ms, 2527ms total)
T0D6C 002:550 JLINK_GetHWStatus(...) returns 0x00 (0000ms, 2527ms total)
T0D6C 002:550 JLINK_EMU_HasCapEx(0x00000044) returns 0x01 (0000ms, 2527ms total)
T0D6C 002:550 JLINK_ReadEmuConfigMem(..., Off = 0x9A, NumBytes = 0x01) returns 0x00 (0001ms, 2528ms total)
T0D6C 003:939 JLINK_Api_MRU_GetList()JLINK_DEVICE_GetIndex(sDeviceName = ATSAMA5D27)XML file found at: C:\Program Files (x86)\SEGGER\JLink_V634g\JLinkDevices.xml (0001ms, 2533ms total)
T0D6C 004:717 C:\Program Files (x86)\SEGGER\JLink_V634g\JLinkDevices.xml evaluated successfully. returns 321 (0119ms, 2651ms total)
T0D6C 004:836 JLINK_DEVICE_GetInfo(DeviceIndex = 321) returns 0 (0000ms, 2651ms total)
T0D6C 005:171 JLINK_ConfigJTAG(IRPre = -1, DRPre = -1) (0000ms, 2651ms total)
T0D6C 005:347 JLINK_ExecCommand("device=ATSAMA5D27", ...). Device "ATSAMA5D27" selected. returns 0x00 (0009ms, 2660ms total)
T0D6C 005:356 JLINK_EnableLog(...) (0000ms, 2660ms total)
T0D6C 005:358 JLINK_GetEmuCaps() returns 0xB9FF7BBF (0000ms, 2660ms total)
T0D6C 005:358 JLINK_TIF_GetAvailable(...) (0000ms, 2660ms total)
T0D6C 005:358 JLINK_TIF_Select(JLINKARM_TIF_JTAG) returns 0x00 (0006ms, 2666ms total)
T0D6C 005:364 JLINK_SetSpeed(4000) (0001ms, 2667ms total)
T0D6C 005:365 JLINK_Connect() J-Link Script File: Executing ConfigTargetSettings() ---Setting ETB available------Setting ETB Base Address------Setting ETM Base Address--- >0x2F8 JTAG>TotalIRLen = ?, IRPrint = 0x..000000000000000000000000 >0xC8 JTAG>RESET (pin 15) high, but should be low. Please check target hardware. J-Link Script File: Executing ConfigTargetSettings() ---Setting ETB available------Setting ETB Base Address------Setting ETM Base Address--- >0x2F8 JTAG>
TotalIRLen = ?, IRPrint = 0x..000000000000000000000000 >0xC8 JTAG> returns 0x01 (0389ms, 3056ms total)
T0D6C 005:754 JLINK_GetIdData(...) J-Link Script File: Executing ConfigTargetSettings() ---Setting ETB available------Setting ETB Base Address------Setting ETM Base Address--- >0x2F8 JTAG>TotalIRLen = ?, IRPrint = 0x..000000000000000000000000 >0xC8 JTAG>RESET (pin 15) high, but should be low. Please check target hardware. J-Link Script File: Executing ConfigTargetSettings() ---Setting ETB available------Setting ETB Base Address------Setting ETM Base Address--- >0x2F8 JTAG>
TotalIRLen = ?, IRPrint = 0x..000000000000000000000000 >0xC8 JTAG> (0401ms, 3457ms total)
T0D6C 007:222 JLINK_IsOpen() returns 0x01 (0000ms, 3457ms total)
T0D6C 007:243 JLINK_Close() (0012ms, 3469ms total)
T0D6C 007:243 (0012ms, 3469ms total)
T0D6C 007:243 Closed (0012ms, 3469ms total) -
If I open J7, J-Link can see the SOM1 through the USB connection. I can program the board but debugging is limited, and I'd prefer to get the JTAG ICE working.
With J7 closed, the emulator connected to JTAG can't see the board, as shown above.
Should I try another J-Link emulator, as perhaps this one is faulty?
(I received a new SOM1 eval board, and it behaves identically.)
Any help would be appreciated.
-
**************************
WARNING: RESET (pin 15) high, but should be low. Please check target hardware.
**************************Why does J-Link complain about pin 15 Reset when the SOM1 datasheet lists pin 47 as Reset?
-
Thank you for your response.
SEGGER J-Link Commander V6.32f (Compiled Jun 12 2018 14:47:13)
DLL version V6.32f, compiled Jun 12 2018 14:46:40When I press the reset button, I see RomBOOT on the serial port, so I think J-Link OB (USB J10) works.
Yes, I have a jumper closing J7.
I have ordered another board, perhaps this one is defective.
What is pin 15 (RESET)?
-
Having trouble with J-Link communicating with the SAMA5D27 on the eval board, ATSAMA5D27-SOM1-EK1. JLink.exe reports:
TotalIRLen = ?, IRPrint = 0x..000000000000000000000000
**************************
WARNING: RESET (pin 15) high, but should be low. Please check target hardware.
**************************Firmware: J-Link V10 compiled Apr 20 2018 16:47:09
Hardware version: V10.10
S/N: XXXXXXXX
License(s): GDB
VTref=3.193VThe Eval board reports RomBOOT over serial so it's powered up. And my J-link Base works fine with my other eval board, Xplained Ultra.
Advice?
-
Using IAR IDE and a J-Link Base ICE with SAMA5D2 on XPlained eval board. Stepping through the code, the IDE locks up. When I break, the code is execting the Undefined Insruction exception handler. Looking at the LR, the instruction at that address disassembles, so I presume it is not the problem. Stack pointer looks good.
Any suggestion how to diagnose this condition?