#
# J-LINK GDB SERVER initialization
#
# This connects to a GDB Server listening
# for commands on localhost at tcp port 2331
target remote 192.168.2.100:2331 #首先连接主机的GDB Server,端口都是2331。
#注意主机的GDB Server勾掉"Localhost only"选项,否则连接不上
# Set JTAG speed to 30 kHz
monitor speed 30
# Set GDBServer to little endian
monitor endian little
#end
# Reset the chip to get to a known state.
monitor reset
#
# CPU core initialization
#
# Set the processor mode
monitor reg cpsr = 0xd3
#disable watchdog
monitor MemU32 0x53000000 = 0x00000000
#disable interrupt
monitor MemU32 0x4A000008 = 0xFFFFFFFF #INTMSK
monitor MemU32 0x4A00000C = 0x00007FFF #INTSUBMSK
#
#set clock
#
#FCLK= 300 MHz, HCLK = 100 MHz, PCLK = 50 MHz @12M cystall external
#lock time
monitor MemU32 0x4C000000 = 0x0FFF0FFF
#CLKDIVN
monitor MemU32 0x4C000014 = 0x0000000F
#MPLLCON s=1,p=1,m=67
monitor MemU32 0x4C000004 = 0x00043011
#UPLLCON s=1,p=2,m=56, CLK_UPLL=96MHz,so CLKDIVN[3]=1
monitor MemU32 0x4C000008 = 0x00038021
#CLKCON enable all peripheral clock
monitor MemU32 0x4C00000C = 0x001FFFF0
#
#config sdram
#
#BWSCON not using UB/LB,WAIT, 32bit data width
monitor MemU32 0x48000000 = 0x22000000
#BANKCON6 bank6 setSDRAM type
monitor MemU32 0x4800001C = 0x00018005
monitor MemU32 0x48000024 = 0x008404F3 #vREFRESH
monitor MemU32 0x48000028 = 0x00000031 #vBANKSIZE -- 32M/32M --- should
monitor MemU32 0x4800002c = 0x00000020 #vMRSRB6
#GPACON: Enable Address lines for SDRAM
monitor MemU32 0x56000000 = 0x000003FF
# Set auto JTAG speed
monitor speed auto
# Setup GDB FOR FASTER DOWNLOADS
set remote memory-write-packet-size 1024
set remote memory-write-packet-size fixed
# Load the program executable called "image.elf"
# load image.elf
b _start
load
continue
文章评论(0条评论)
登录后参与讨论