linux gdb死循环,求助!GDB设置硬件断点后continue,系统进入类似死循环?(OpenOCD + AT91SAM7S)【恢复】...

在J-Link+GDB Server能够正常调试的前提下。用OpenOCD r717, Windows XP+Cygwin :

-------my-openocd-config-file.cfg----------

#daemon configuration

telnet_port 4444

gdb_port 3333

daemon_startup reset

#interface

interface ft2232

ft2232_device_desc "USB<=>JTAG&RS232 A"

#ft2232_device_desc "Amontec JTAGkey A"

ft2232_layout jtagkey

ft2232_vid_pid 0x1457 0x5118

#ft2232_vid_pid 0x0403 0xcff8

jtag_speed 0 #改为1-5降低速度也不行

#use combined on interfaces or targets that can't set TRST/SRST separately

#reset_config trst_and_srst srst_pulls_trst

reset_config srst_only

#jtag scan chain

#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)

jtag_device 4 0x1 0xf 0xe

#target configuration

#target arm7tdmi <reset mode> <chainpos> <endianness> <variant>

target arm7tdmi little run_and_init 0

run_and_halt_time 0 30

#flash configuration

#working_area 0 0x00200000 0x4000 nobackup

flash bank at91sam7 0 0 0 0 0

gdb_memory_map enable

gdb_flash_program enable

arm7_9 force_hw_bkpts enable    # program resides in flash

arm7_9 dbgrq disable  # 如果enable, 程序也一样无法到达硬件断点

#target_script 0 reset openocd_at91sam7s_flash.script #把这一行解除注释就刷flash。

-------end of my-openocd-config-file.cfg----------

----------------------------my-gdb-init-file.gdb----------------------------

target remote localhost:3333

monitor arm7_9 force_hw_bkpts enable

monitor jtag_speed 1

monitor halt

monitor sleep 10

# Disable watchdog

monitor mww 0xFFFFFD44  0x00008000

monitor sleep 10

# Enable user reset

monitor mww 0xFFFFFD08  0xA5000001

monitor sleep 10

# Initialize PLL

monitor mww 0xFFFFFC20  0x00000601

monitor sleep 10

monitor mww 0xFFFFFC2C  0x005F1C10

monitor sleep 10

monitor mww 0xFFFFFC30  0x00000007

monitor sleep 10

monitor mww 0xFFFFFF60  0x003C0100

monitor sleep 100

monitor arm7_9 fast_memory_access enable

monitor arm7_9 dcc_downloads enable

monitor sleep 100

monitor poll

monitor flash probe 0

#这一句是通过GDB来刷Flash吗?当然这样可以成功刷Flash,但是好像通过GDB刷Flash并不是这一句。

#因为这好像并不是把本地的elf传到远程的openocd来刷,如果谁知道请告诉我,谢谢!

monitor flash write_image at91sam7s_getting_started_flash.elf 0x0 elf

monitor jtag_speed 0

break main

load

continue

---------------------end of my-gdb-init-file.gdb-------------------------

用法:

在Cygwin下启动: $openocd-ft2xx.exe -f my-openocd-config-file.cfg

另外开一终端启动:$arm-elf-insight.exe -x my-gdb-init-file.gdb at91sam7s_getting_started_flash.elf 

症状:

调试一个最简单的LED循环点灭例子,设置3个断点,一个main,一个在灯亮时,一个在灯熄灭时。

下面是用J-Link调试的截图(GDB-Server+arm-elf-insight.exe,断点工作正常。所以,应该不是程序的问题。)

thread-2178129-1-1.html

 (原文件名:Screenshot - 2009-1-18 , 1_19_58.png) 

然而,在用OpenOCD调试时,如果按"c",则程序如同进入死循环。OpenOCD也没有任何错误输出,GDB(insight)也没有任何错误输出,只是单纯地如同死循环一般。LED也不会亮,也不会灭,处于半亮半灭的状态。

如果谁有成功地调试硬件断点的例子,不论什么CPU,请贴在这里。谢谢!! 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值