1. 启动gdbproxy,要使用配置了libbfemu的版本
# gdbproxy bfin
2. 启动gdb
# bfin-uclinux-gdb
(gdb)target remote : 2000
3. 使用gdb命令查看寄存器值
1)PLL Divide register
(gdb) p /x *0xffc00004
=> 0x0003 SSEL=3 CSEL=0
2)PLL Control register
(gdb) p /x *0xffc00000
=> 0x5000 DF=0 MSEL=40
计算频率:
if(!MSEL)
VCO = CLKIN/(DF+1) * MSEL
else
VCO = CLKIN/(DF+1)
CCLK = VCO/(2^CSEL) (core clock)
SCLK = VCO/SSEL (system clock)
所以:
输入晶阵10MHz,
VCO = 10M/1 * 40 = 400MHz
CCLK = 400M/(2^0) = 400MHz
SCLK = 400M/3 = 133MHz
3)SDRAM Memory Global Control Register
(gdb) p /x *0xffc00a10
=> 0x801111cd
CDDBG 0 - continue driving SDRAM
controls during bus grant
TCSR 0 - 45 degrees C
FBBRW 0 - Disabled
EBUFE 0 - External buffering timing disabled
SRFS 0 - Disable self-refresh
PSSE 0 - No effect
PSM 0 - Precharge, 8 CBR refresh cycles,
mode register set
PUPSD 0 - No extra delay added before first
Precharge command
TWR 10 - 2 cycles
TRCD 010 - 2 cycles
TRP 010 - 2 cycles
TRAS 0111 - 7 cycles
PASR 00 - All 4 banks refreshed
CL 11 - 3 cycles
SCTE 1 - Enabled
4)SDRAM Memory Bank Control register
(gdb) p /x *0xffc00a14
=> 0x13
EBE 1 - Enabled
EBSZ 01 - 32Mbyte
EBCAW 01 - 9bits
5)SDRAM Control Status Register
(gdb) p /x *0xffc00a1c
=> 0x0001
BGSTAT 0 - Bus not granted
SDEASE - W1C 0 - No error detected
SDRS 0 - SDRAM already powered up
SDPUA 0 - SDC not in power up sequence
SDSRA 0 - SDRAMs not in self-refresh mode
SDCL 1 - SDC is idle
6)SDRAM Refresh Rate Control Register
(gdb) p /x *0xffc00a18
=> 0x0408
4. 查看Memory内容
例如查看0x01ef0000开始的128字节的内容
(gdb) x /128xh 0x01ef0000
设置memory值
(gdb) set *0x01ef0000 = 0x1168
(gdb) p /x *0x01ef0000
# gdbproxy bfin
2. 启动gdb
# bfin-uclinux-gdb
(gdb)target remote : 2000
3. 使用gdb命令查看寄存器值
1)PLL Divide register
(gdb) p /x *0xffc00004
=> 0x0003 SSEL=3 CSEL=0
2)PLL Control register
(gdb) p /x *0xffc00000
=> 0x5000 DF=0 MSEL=40
计算频率:
if(!MSEL)
VCO = CLKIN/(DF+1) * MSEL
else
VCO = CLKIN/(DF+1)
CCLK = VCO/(2^CSEL) (core clock)
SCLK = VCO/SSEL (system clock)
所以:
输入晶阵10MHz,
VCO = 10M/1 * 40 = 400MHz
CCLK = 400M/(2^0) = 400MHz
SCLK = 400M/3 = 133MHz
3)SDRAM Memory Global Control Register
(gdb) p /x *0xffc00a10
=> 0x801111cd
CDDBG 0 - continue driving SDRAM
controls during bus grant
TCSR 0 - 45 degrees C
FBBRW 0 - Disabled
EBUFE 0 - External buffering timing disabled
SRFS 0 - Disable self-refresh
PSSE 0 - No effect
PSM 0 - Precharge, 8 CBR refresh cycles,
mode register set
PUPSD 0 - No extra delay added before first
Precharge command
TWR 10 - 2 cycles
TRCD 010 - 2 cycles
TRP 010 - 2 cycles
TRAS 0111 - 7 cycles
PASR 00 - All 4 banks refreshed
CL 11 - 3 cycles
SCTE 1 - Enabled
4)SDRAM Memory Bank Control register
(gdb) p /x *0xffc00a14
=> 0x13
EBE 1 - Enabled
EBSZ 01 - 32Mbyte
EBCAW 01 - 9bits
5)SDRAM Control Status Register
(gdb) p /x *0xffc00a1c
=> 0x0001
BGSTAT 0 - Bus not granted
SDEASE - W1C 0 - No error detected
SDRS 0 - SDRAM already powered up
SDPUA 0 - SDC not in power up sequence
SDSRA 0 - SDRAMs not in self-refresh mode
SDCL 1 - SDC is idle
6)SDRAM Refresh Rate Control Register
(gdb) p /x *0xffc00a18
=> 0x0408
4. 查看Memory内容
例如查看0x01ef0000开始的128字节的内容
(gdb) x /128xh 0x01ef0000
设置memory值
(gdb) set *0x01ef0000 = 0x1168
(gdb) p /x *0x01ef0000
没有评论:
发表评论