Hi,
I'm using the Jlink-ARM V4.02 with the SAM9260 EV board
I had my connection set and can debug, when the connection is established ok (eclipse or insight debuggers)
see below my config file
However in many cases the cpu is not reset by the " monitor reset 0 " command , causing the debug session to stall
this happens in various cases like after download, before download, after power recycle or after hitting a BP
below also is the log. please help.
Moti
ConnectOne
Jlink Config File
==================
# Listening for commands on this PC's tcp port 2331
target remote localhost:2331
# Set gdb server to little endian
monitor endian little
# Set JTAG speed to 30 kHz
monitor speed auto
# Reset the chip to get to a known state.
monitor reset 0
monitor sleep 100
# Perform peripheral reset
monitor long 0xFFFFFD00 = 0xA5000004
monitor sleep 10
# Disable watchdog
monitor long 0xFFFFFD44 = 0x00008000
monitor sleep 10
# Configure master clock
echo Enable main oscillator
monitor memU32 0xFFFFFC20 = 0x4001
monitor sleep 100
# Set PLL to 200MHz
monitor memU32 0xFFFFFC28 = 0x2060BF09
monitor sleep 100
# Set PLLB for USB usage
monitor memU32 0xFFFFFC2C = 0x207C3F0C
monitor sleep 100
# Select prescaler
monitor memU32 0xFFFFFC30 = 0x00000100
monitor sleep 100
# Select master clock
monitor memU32 0xFFFFFC30 = 0x00000102
monitor sleep 10
# Set JTAG speed to 10Mhz
monitor speed 10000
monitor sleep 100
echo Master clock ok.\n
echo Configuring the SDRAM controller...\n
# Enable EBI chip select for the SDRAM
monitor memU32 0xFFFFEF1C = 0x2
monitor sleep 10
#config PIO_ASR,PIO_PDR fot SDRAM
monitor memU32 0xFFFFF870 = 0xFFFF0000
monitor memU32 0xFFFFF804 = 0xFFFF0000
# SDRAM configuration
monitor memU32 0xFFFFEA08 = 0x85227259
# SDRAMC Memory Device Register
monitor memU32 0xFFFFEA00 = 0x1
monitor memU32 0x20000000 = 0
#All Banks Precharge command is issued to the SDRAM devices
monitor memU32 0xFFFFEA00 = 0x2
monitor memU32 0x20000000 = 0
#Eight auto-refresh (CBR) cycles
#1
monitor memU32 0xFFFFEA00 = 0x4
monitor memU32 0x20000000 = 0
#2
monitor memU32 0xFFFFEA00 = 0x4
monitor memU32 0x20000000 = 0
#3
monitor memU32 0xFFFFEA00 = 0x4
monitor memU32 0x20000000 = 0
#4
monitor memU32 0xFFFFEA00 = 0x4
monitor memU32 0x20000000 = 0
#5
monitor memU32 0xFFFFEA00 = 0x4
monitor memU32 0x20000000 = 0
#6
monitor memU32 0xFFFFEA00 = 0x4
monitor memU32 0x20000000 = 0
#7
monitor memU32 0xFFFFEA00 = 0x4
monitor memU32 0x20000000 = 0
#8
monitor memU32 0xFFFFEA00 = 0x4
monitor memU32 0x20000000 = 0
#A Mode Register set (MRS) cycle is issued to program the parameters of the SDRAM devices
monitor memU32 0xFFFFEA00 = 0x3
monitor memU32 0x20000000 = 0
#go into Normal Mode, setting Mode to 0
monitor memU32 0xFFFFEA00 = 0x0
monitor memU32 0x20000000 = 0
#Write the refresh rate into the count field in the SDRAMC Refresh Timer register
monitor memU32 0xFFFFEA04 = 0x2B7
#REMAP RAM
monitor memU32 0xFFFFEF00 = 0x3
#check remap
monitor memU32 0xFFFFEF00
break main
load
continue
-----------------------------------------------------------------------------------------------------
Log file:
-----------------------------------------------------------------------------------------------------
SEGGER J-Link GDB Server V4.02 LogFile
Logging started @ 2009-03-04 14:48
..............
03-00-00005493-0016: Connected to 127.0.0.1
02-00-00005495-0039: T05D8 005:494 JLINKARM_SetSpeed(5) (0001ms, 0851ms total)
02-00-00005495-0046: T05D8 005:495 JLINKARM_GetSpeed() returns 0x05 (0000ms, 0851ms total)
02-00-00005495-007A: T05D8 005:495 JLINKARM_SetResetType(JLINKARM_RESET_TYPE_NORMAL) returns JLINKARM_RESET_TYPE_NORMAL (0000ms, 0851ms total)
02-00-00005495-003E: T05D8 005:495 JLINKARM_SetResetDelay(0) (0000ms, 0851ms total)
02-00-00005513-0052: T05D8 005:495 JLINKARM_IsHalted() >0x48 JTAG> returns TRUE (0018ms, 0851ms total)
02-00-00005513-004A: T05D8 005:513 JLINKARM_GetDeviceFamily() returns 9 (0000ms, 0851ms total)
02-00-00005513-004D: T05D8 005:513 JLINKARM_ReadReg(R0) returns 0x000000DF (0000ms, 0851ms total)
02-00-00005513-004A: T05D8 005:513 JLINKARM_GetDeviceFamily() returns 9 (0000ms, 0851ms total)
read regs....
02-00-00005514-0053: T05D8 005:514 JLINKARM_ReadReg(R15 (PC)) returns 0x000000B4 (0000ms, 0852ms total)
02-00-00005514-004A: T05D8 005:514 JLINKARM_GetDeviceFamily() returns 9 (0000ms, 0852ms total)
02-00-00005514-004F: T05D8 005:514 JLINKARM_ReadReg(CPSR) returns 0x000000DF (0000ms, 0852ms total)
00-00-00005515-000E: $qSupported#37
01-00-00005515-0001: +
01-00-00005515-0013: $PacketSize=1024#f7
00-00-00005515-0001: +
00-00-00005515-0001: +
00-00-00005515-0005: $?#3f
01-00-00005515-0001: +
01-00-00005515-0007: $S0f#e9
00-00-00005515-0001: +
00-00-00005515-0008: $Hc-1#09
01-00-00005516-0001: +
01-00-00005516-0006: $OK#9a
00-00-00005516-0001: +
00-00-00005516-0006: $qC#b4
01-00-00005516-0001: +
01-00-00005516-0004: $#00
00-00-00005516-0001: +
00-00-00005516-000C: $qOffsets#4b
01-00-00005516-0001: +
01-00-00005516-0004: $#00
00-00-00005517-0001: +
00-00-00005517-0007: $Hg0#df
01-00-00005517-0001: +
01-00-00005517-0006: $OK#9a
00-00-00005517-0001: +
00-00-00005517-0005: $g#67
01-00-00005517-0001: +
03-00-00005517-0015: Reading all registers
download......
a warning below:
02-00-00007416-004C: T07E4 007:415 JLINKARM_GetHWStatus(...) returns 0x00 (0001ms, 2748ms total)
02-00-00007416-0058: T05D8 007:416 JLINKARM_SetEndian(ARM_ENDIAN_LITTLE) returns 0x00 (0000ms, 2748ms total)
01-00-00007416-0056: $54617267657420656e6469616e6573732073657420746f20226c6974746c6520656e6469616e220D0A#3d
00-00-00007416-0001: +
03-00-00007416-0027: Target endianess set to "little endian"
00-00-00007417-001E: $qRcmd,7370656564206175746f#70
01-00-00007417-0001: +
02-00-00007458-00F7: T05D8 007:417 JLINKARM_SetMaxSpeed() -- Detecting speed: - RTCK reaction time is approx. 60228nsRTCK reaction time is approx. 60228ns - 4kHz: >0x70 JTAG> O.K. -- Auto JTAG speed: AdaptiveAuto JTAG speed: Adaptive >0x08 JTAG> (0041ms, 2789ms total)
02-00-00007460-0048: T05D8 007:460 JLINKARM_GetSpeed() returns 0xFFFF (0000ms, 2789ms total)
01-00-00007460-004C: $53656c656374206175746f204a54414720737065656420283635353335206b487a290D0A#ab
00-00-00007460-0001: +
03-00-00007460-0022: Select auto JTAG speed (65535 kHz)
00-00-00007460-0018: $qRcmd,72657365742030#fc
01-00-00007460-0001: +
02-00-00007460-007A: T05D8 007:460 JLINKARM_SetResetType(JLINKARM_RESET_TYPE_NORMAL) returns JLINKARM_RESET_TYPE_NORMAL (0000ms, 2789ms total)
02-00-00007460-0041: T05D8 007:460 JLINKARM_ResetPullsRESET(ON) (0000ms, 2789ms total)
02-00-00007557-0078: T05D8 007:461 JLINKARM_Reset() >0x30 JTAG> >0x48 JTAG> >0x1B8 JTAG>TotalIRLen = 4, IRPrint = 0x01 (0096ms, 2885ms total)
03-00-00008265-004C: WARNING: PC of target system has unexpected value of 0x00000434 after reset.
02-00-00008413-01E8: T05D8 007:557 >0x30 JTAG> >0x110 JTAG> >0x58 JTAG>_ResetBP0: >0x58 JTAG> >0x18 JTAG> >0x50 JTAG> >0x138 JTAG> >0x48 JTAG> >0x48 JTAG> >0x7F8 JTAG>PC of target system has unexpected value of 0x00000434 after reset. >0xA0 JTAG> >0x18 JTAG> >0x88 JTAG> >0x70 JTAG> >0x90 JTAG>CP15.0.0: 0x41069265: ARM, Architecure 5TEJ >0x90 JTAG>CP15.0.1: 0x1D112112: ICache: 8kB (4*64*32), DCache: 8kB (4*64*32)Cache type: Separate, Write-back, Format C (WT supported) >0x18 JTAG> (0856ms, 3741ms total)
01-00-00008413-004E: $526573657474696e6720746172676574202868616c74206166746572207265736574290D0A#b3
00-00-00008413-0001: +
03-00-00008413-0023: Resetting target (halt after reset)
00-00-00008413-001C: $qRcmd,736c65657020313030#ef
01-00-00008413-0001: +
02-00-00008417-004C: T07E4 008:416 JLINKARM_GetHWStatus(...) returns 0x00 (0001ms, 3742ms total)
01-00-00008514-001E: $536c656570203130306d730D0A#b3
00-00-00008514-0001: +
03-00-00008514-000B: Sleep 100ms
-----------------
...... set BP, continue and get the error
----------------
02-00-00011586-0069: T05D8 011:586 JLINKARM_SetBPEx(Addr = 0x20033298, Type = 0x01) returns 0x00000001 (0000ms, 6142ms total)
03-00-00011586-0044: Setting breakpoint @ address 0x20033298, Size = 4, BPHandle = 0x0001
01-00-00011587-0006: $OK#9a
00-00-00011587-0001: +
00-00-00011587-000A: $vCont?#49
01-00-00011587-0001: +
01-00-00011587-0004: $#00
00-00-00011587-0001: +
00-00-00011587-0007: $Hc0#db
01-00-00011587-0001: +
01-00-00011587-0006: $OK#9a
00-00-00011587-0001: +
00-00-00011587-0007: $C0f#d9
01-00-00011588-0001: +
03-00-00011588-0016: Starting target CPU...
02-00-00011589-0052: T05D8 011:588 JLINKARM_IsHalted() >0x48 JTAG> returns TRUE (0001ms, 6142ms total)
02-00-00011590-0048: T05D8 011:589 JLINKARM_GetScanLen() returns 0x05 (0000ms, 6142ms total)
02-00-00011590-005B: T05D8 011:590 JLINKARM_WriteICEReg(0x02, 0x00000000, AllowDelay = 1) (0000ms, 6142ms total)
02-00-00011596-0040: T05D8 011:590 JLINKARM_Go() >0x1C48 JTAG> (0006ms, 6148ms total)
02-00-00011597-002D: T05D8 011:596 JLINKARM_IsHalted() >0x48 JTAG>
02-00-00011597-007D: ***** Error: Bad JTAG communication: Write to IR: Expected 0x1, got 0x0 (TAP Command : 2) @ Off 0x5. (0001ms, 6148ms total)
02-00-00011597-0034: T05D8 011:597 returns FALSE (0000ms, 6148ms total)
03-00-00011597-005E: ERROR: Bad JTAG communication: Write to IR: Expected 0x1, got 0x0 (TAP Command : 2) @ Off 0x5.
03-00-00011597-001F: Connection to debugger closed !
02-00-00011597-0047: T05D8 011:597 JLINKARM_IsHalted() returns FALSE (0000ms, 6148ms total)
02-00-00011597-0042: T05D8 011:597 JLINKARM_Halt() returns 0x01 (0000ms, 6148ms total)
02-00-00011597-0067: T05D8 011:597 JLINKARM_ClrBPEx(BPHandle = 0x00000001) -- Has error returns 0x01 (0000ms, 6148ms total)
03-00-00011597-001F: All pending breakpoints removed
03-00-00012087-0016: Connected to 127.0.0.1