resumed board from openocd but no display on hyperterminal

Hi everyone,

i’m a completely newbie on embedded system, sorry if i’m asking a basic question

now i’m doing a project to make an at91rm9200 board with linux in it

i want to download program using JTAG to at91rm9200 internal SRAM and run the program from it

my sequence is : (development host win 7, openocd 0.6.1)

  1. turn on the board, connect the debug port and connect the turtelizer2 to my win7 computer

  2. running hyperterminal then open the first cmd prompt to start openocd and the second cmd prompt to start telnet session to localhost 4444

  3. at91_init

  4. halt

  5. load_image loader.bin 0x0020 0000 bin → SRAM address at 0x0020 0000

  6. resume 0x0020 0000

the problem is that after i give the resume statement on telnet session, hyperterminal didn’t display anything, just an empty screen, but when i press enter on hyperterminal the LED display on my board (FT232RL RXLED) is blinking which means that my computer is connected with at91rm9200 board and there’s no problem with the debug port.

it seems that the loader.bin won’t run from SRAM. What should i do ? is there anything wrong in my sequence?

:cry:

here is the config file and the command on command prompt :

1st command prompt

C:\openocd-0.6.1>C:\openocd-0.6.1\bin-x64\openocd-x64-0.6.1.exe -s C:/openocd-0.
6.1 \ -c "source [find scripts/interface/turtelizer2.cfg]" \ -c "source [find sc
ripts/target/at91rm9200.cfg]"
Open On-Chip Debugger 0.6.1 (2012-10-07-10:39)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
dcc downloads are disabled
adapter speed: 8 kHz
at91_init
Info : clock speed 8 kHz
Info : JTAG tap: at91rm9200.cpu tap/device found: 0x05b0203f (mfg: 0x01f, part:
0x5b02, ver: 0x0)
Info : Embedded ICE version 2
Info : at91rm9200.cpu: hardware has 2 breakpoint/watchpoint units
Info : accepting 'telnet' connection from 4444
    TargetName         Type       Endian TapName            State
--  ------------------ ---------- ------ ------------------ ------------
 0* at91rm9200.cpu     arm920t    little at91rm9200.cpu     running
target state: halted
target halted in ARM state due to debug-request, current mode: System
cpsr: 0x8000005f pc: 0x00100a94
MMU: disabled, D-Cache: disabled, I-Cache: disabled
adapter speed: 6000 kHz
11224 bytes written at address 0x00200000
downloaded 11224 bytes in 0.414053s (26.472 KiB/s)

2nd command prompt

Open On-Chip Debugger
> targets
    TargetName         Type       Endian TapName            State
--  ------------------ ---------- ------ ------------------ ------------
 0* at91rm9200.cpu     arm920t    little at91rm9200.cpu     running
> halt
target state: halted
target halted in ARM state due to debug-request, current mode: System
cpsr: 0x8000005f pc: 0x00100a94
MMU: disabled, D-Cache: disabled, I-Cache: disabled
> at91_init
adapter speed: 6000 kHz
> load_image loader.bin 0x00200000
11224 bytes written at address 0x00200000
downloaded 11224 bytes in 0.414053s (26.472 KiB/s)
> resume 0x00200000
>

openocd config :

# Atmel AT91rm9200
# http://atmel.com/products/at91/

if { [info exists CHIPNAME] } {
   set _CHIPNAME $CHIPNAME
} else {
   set _CHIPNAME at91rm9200
}

if { [info exists ENDIAN] } {
   set _ENDIAN $ENDIAN
} else {
   set _ENDIAN little
}

if { [info exists CPUTAPID] } {
   set _CPUTAPID $CPUTAPID
} else {
   set _CPUTAPID 0x05b0203f
}

# Never allow the following!
if { $_CPUTAPID == 0x15b0203f } {
   echo "-------------------------------------------------------"
   echo "- ERROR:                                              -"
   echo "- ERROR: TapID 0x15b0203f is wrong for at91rm9200     -"
   echo "- ERROR: The chip/board has a JTAG select pin/jumper  -"
   echo "- ERROR:                                              -"
   echo "- ERROR: In one position (0x05b0203f) it selects the  -"
   echo "- ERROR: ARM CPU, in the other position (0x1b0203f)   -"
   echo "- ERROR: it selects boundry-scan not the ARM          -"
   echo "- ERROR:                                              -"
   echo "-------------------------------------------------------"
}

jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID

# Create the GDB Target.
set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME arm920t -endian $_ENDIAN -chain-position $_TARGETNAME

# AT91RM9200 has a 16K block of sram @ 0x0020.0000
$_TARGETNAME configure -work-area-phys 0x00200000 \
		-work-area-size 0x00050000 -work-area-backup 1

## flash bank <name> <driver> <base> <size> <chip_width> <bus_width> <target>
#set _FLASHNAME $_CHIPNAME.flash
#flash bank $_FLASHNAME cfi 0x10000000 0x00800000 2 2 $_TARGETNAME

# This chip has a DCC ... use it
arm7_9 dcc_downloads disable

# The chip may run @ 32khz, so set a really low JTAG speed
adapter_khz 8

# tambahan dewe

proc at91_init {} {
# disable all clocks but system clock
mww 0xfffffc64 0xffffffff
## disable all clocks but system clock
mww 0xfffffc04 0xfffffffe
## disable all clocks to pioa and piob
mww 0xfffffc14 0xffffffc3
## master clock = slow cpu = slow
## (means the CPU is running at 32khz!)
mww 0xfffffc30 0
## main osc enable
mww 0xfffffc20 0x0000ff01
## MC_PUP
mww 0xFFFFFF50 0x00000000
## MC_PUER: Memory controller protection unit disable
mww 0xFFFFFF54 0x00000000
## EBI_CFGR
mww 0xFFFFFF64 0x00000000
## SMC2_CSR[0]: 16bit, 2 TDF, 4 WS
mww 0xFFFFFF70 0x00003284

## Init Clocks
## CKGR_PLLAR
mww 0xFFFFFC28 0x2000BF05
## PLLAR: 179,712000 MHz for PCK
mww 0xFFFFFC28 0x20263E04
sleep 100
## PMC_MCKR
mww 0xFFFFFC30 0x00000100
sleep 100
## ;MCKR : PCK/3 = MCK Master Clock = 59,904000MHz from PLLA
mww 0xFFFFFC30 0x00000202
sleep 100

#========================================
# CPU now runs at 180mhz
# SYS runs at 60mhz.
adapter_khz 40000
#========================================

	## Init SDRAM
	## PIOC_ASR: Configure PIOC as peripheral (D16/D31)
	mww 0xFFFFF870 0xFFFF0000
	## PIOC_BSR:
	mww 0xFFFFF874 0x00000000
	## PIOC_PDR:
	mww 0xFFFFF804 0xFFFF0000

	## EBI_CSA : CS1=SDRAM
	mww 0xFFFFFF60 0x00000002
	## EBI_CFGR:
	mww 0xFFFFFF64 0x00000000

	## SDRC_CR :
	mww 0xFFFFFF98 0x2188c159
	## SDRC_MR : Precharge All
	mww 0xFFFFFF90 0x00000012
	## access SDRAM
	mww 0x20000000 0x00000000
	## SDRC_MR : Refresh
	mww 0xFFFFFF90 0x00000014
	## access SDRAM
	mww 0x20000000 0x00000000
	## access SDRAM
	mww 0x20000000 0x00000000
	## access SDRAM
	mww 0x20000000 0x00000000
	## access SDRAM
	mww 0x20000000 0x00000000
	## access SDRAM
	mww 0x20000000 0x00000000
	## access SDRAM
	mww 0x20000000 0x00000000
	## access SDRAM
	mww 0x20000000 0x00000000
	## access SDRAM
	mww 0x20000000 0x00000000
	## SDRC_MR : Load Mode Register
	mww 0xFFFFFF90 0x00000013
	## access SDRAM
	mww 0x20000080 0x00000000
	## SDRC_TR : Write refresh rate
	mww 0xFFFFFF94 0x000002E0
	## access SDRAM
	mww 0x20000000 0x00000000
	## SDRC_MR : Normal Mode
	mww 0xFFFFFF90 0x00000010
	## access SDRAM
	mww 0x20000000 0x00000000
}

turtelizer 2 config

#
# egnite Turtelizer 2
#
# http://www.ethernut.de/en/hardware/turtelizer/index.html
#

interface ft2232
ft2232_device_desc "Turtelizer JTAG/RS232 Adapter"
ft2232_layout turtelizer2
ft2232_vid_pid 0x0403 0xbdc8

Thanks for your attention

Best regards,

Andi

All looks ok to me, resume does not return anything unless an error occurred.

Whether the loader actually works is another thing.

Spen

ok… i will try to compile the loader again… just to make sure…

i’ll try to download u-boot (not the loader) to SDRAM and run the board from it…

any other thoughts :?:

Thanks for your reply

Andi

i’ve tried to load u-boot.bin to SDRAM with the same configuration

this is what i got

1st cmd prompt

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\ReQuieM>cd /

C:\>cd openocd-0.6.1

C:\openocd-0.6.1>openocd

C:\openocd-0.6.1>C:\openocd-0.6.1\bin-x64\openocd-x64-0.6.1.exe -s C:/openocd-0.
6.1 \ -c "source [find scripts/interface/turtelizer2.cfg]" \ -c "source [find sc
ripts/target/at91rm9200.cfg]"
Open On-Chip Debugger 0.6.1 (2012-10-07-10:39)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
dcc downloads are disabled
adapter speed: 8 kHz
at91_init
Info : clock speed 8 kHz
Info : JTAG tap: at91rm9200.cpu tap/device found: 0x05b0203f (mfg: 0x01f, part:
0x5b02, ver: 0x0)
Info : Embedded ICE version 2
Info : at91rm9200.cpu: hardware has 2 breakpoint/watchpoint units
Info : accepting 'telnet' connection from 4444
    TargetName         Type       Endian TapName            State
--  ------------------ ---------- ------ ------------------ ------------
 0* at91rm9200.cpu     arm920t    little at91rm9200.cpu     running
Warn : target not halted
Runtime Error: scripts/target/at91rm9200.cfg:60:
in procedure 'at91_init'
in procedure 'mww' called at file "scripts/target/at91rm9200.cfg", line 60
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0xf00000d3 pc: 0x0007e3d4
MMU: disabled, D-Cache: disabled, I-Cache: disabled
adapter speed: 6000 kHz
0x20000000: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000
000
0x20000020: 00000000 00000000
162268 bytes written at address 0x20000000
downloaded 162268 bytes in 5.796331s (27.339 KiB/s)
0x20000000: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000
000
0x20000020: 00000000 00000000

2nd cmd prompt

Open On-Chip Debugger
> targets
    TargetName         Type       Endian TapName            State
--  ------------------ ---------- ------ ------------------ ------------
 0* at91rm9200.cpu     arm920t    little at91rm9200.cpu     running
> at91_init
target not halted
Runtime Error: scripts/target/at91rm9200.cfg:60:
in procedure 'at91_init'
in procedure 'mww' called at file "scripts/target/at91rm9200.cfg", line 60
> halt
target state: halted
target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0xf00000d3 pc: 0x0007e3d4
MMU: disabled, D-Cache: disabled, I-Cache: disabled
> at91_init
adapter speed: 6000 kHz
> mdw 0x20000000 10
0x20000000: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000
000
0x20000020: 00000000 00000000
> load_image u-boot.bin 0x20000000
162268 bytes written at address 0x20000000
downloaded 162268 bytes in 5.796331s (27.339 KiB/s)
> mdw 0x20000000 10
0x20000000: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000
000
0x20000020: 00000000 00000000
>

the download process was a success but when i read the SDRAM memory at 0x20000000 it seems that there is nothing…

my configuration file is the same as at91rm9200ek configuration files with exception at SDRAM size, so i changed that configuration… i’ve tried to change the work area to 0x20000000 and no backup, but still no success…

the schematic was the same as the at91rm9200 app note…

now i’m still having a problem to cross compiling the darrel loader…

anyone can help ?

any thoughts ? :pray:

Best regards,

Andi