Øyvind Harboe ha scritto:
1. try to reproduce this using the dummy driver
I tried to use it as described here:
http://www.mail-archive.com/openocd-development@lists.berlios.de/msg06815.html
but I can't issue the continue command when connecting with gdb.
When I tried the dummy driver it gave errors:
$ ~/src/openocd-0.2.0/src/openocd -f dummy.cfg -f
openocd-0.2.0_at91sam7_gdb.cfg
$URL:
http://svn.berlios.de/svnroot/repos/openocd/tags/openocd-0.2.0/src/openocd.c
$
For bug reports, read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS
Warn : Interface already configured, ignoring
Unknown command: ft2232_device_desc {Amontec JTAGkey}
So I commented the interface section in my configuration file; however
it seems there's something wrong with my configuration. Command line was:
$ ~/src/openocd-0.2.0/src/openocd -f dummy.cfg -f
openocd-0.2.0_at91sam7_gdb.cfg
Log is:
Open On-Chip Debugger 0.2.0 (2009-07-27-14:00) Release
$URL:
http://svn.berlios.de/svnroot/repos/openocd/tags/openocd-0.2.0/src/openocd.c
$
For bug reports, read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS
Warn : Tap/Device does not have IDCODE
Error: JTAG tap: sam7.cpu got: 0x00000000 (mfg: 0x000,
part: 0x0000, ver: 0x0)
Error: JTAG tap: sam7.cpu expected 1 of 1: 0x3f0f0f0f (mfg: 0x787,
part: 0xf0f0, ver: 0x3)
Error: trying to validate configured JTAG chain anyway...
Error: Could not validate JTAG scan chain, IR mismatch, scan returned
0x3F. tap=sam7.cpu pos=0 expected 0x1 got 3
Warn : Could not validate JTAG chain, continuing anyway...
Error: unknown EmbeddedICE version (comms ctrl: 0xffffffff)
target state: halted
target halted in Thumb state due to watchpoint, current mode: System
cpsr: 0xffffffff pc: 0xffffffef
Info : accepting 'gdb' connection from 0
Warn : acknowledgment received, but no packet pending
Error: Target autodetection failed! Please specify target parameters in
configuration file
Error: auto_probe failed -902
**EVENT: gdb-end
**EVENT: gdb-end
2. see if you can get a stack trace:
In the attachment you will find both the output with -d 3 and the
backtrace, as well as my configuration file (the only one I'm using).
Best regards,
--
Ing. Luca Ottaviano - lottavi...@develer.com
Develer S.r.l. - http://www.develer.com/
.hardware . software .innovation
Tel.: +39 055 3986627 - ext.: 218
Starting program: /home/lottaviano/src/openocd-0.2.0/src/openocd -f openocd-0.2.0_at91sam7_gdb.cfg -d 3
Open On-Chip Debugger 0.2.0 (2009-07-27-14:00) Release
$URL: http://svn.berlios.de/svnroot/repos/openocd/tags/openocd-0.2.0/src/openocd.c $
For bug reports, read http://svn.berlios.de/svnroot/repos/openocd/trunk/BUGS
User : 5 0 command.c:396 command_print(): debug_level: 3
Debug: 6 3 configuration.c:83 find_file(): found openocd-0.2.0_at91sam7_gdb.cfg
Debug: 8 4 command.c:68 script_debug(): command - telnet_port
Debug: 9 4 command.c:77 script_debug(): telnet_port - argv[0]=ocd_telnet_port
Debug: 10 4 command.c:77 script_debug(): telnet_port - argv[1]=4444
Debug: 12 4 command.c:68 script_debug(): command - tcl_port
Debug: 13 4 command.c:77 script_debug(): tcl_port - argv[0]=ocd_tcl_port
Debug: 14 4 command.c:77 script_debug(): tcl_port - argv[1]=6666
Debug: 16 4 command.c:68 script_debug(): command - gdb_port
Debug: 17 4 command.c:77 script_debug(): gdb_port - argv[0]=ocd_gdb_port
Debug: 18 4 command.c:77 script_debug(): gdb_port - argv[1]=3333
Debug: 20 4 command.c:68 script_debug(): command - gdb_memory_map
Debug: 21 4 command.c:77 script_debug(): gdb_memory_map - argv[0]=ocd_gdb_memory_map
Debug: 22 4 command.c:77 script_debug(): gdb_memory_map - argv[1]=enable
Debug: 24 4 command.c:68 script_debug(): command - interface
Debug: 25 4 command.c:77 script_debug(): interface - argv[0]=ocd_interface
Debug: 26 4 command.c:77 script_debug(): interface - argv[1]=ft2232
Debug: 28 5 command.c:68 script_debug(): command - ft2232_device_desc
Debug: 29 5 command.c:77 script_debug(): ft2232_device_desc - argv[0]=ocd_ft2232_device_desc
Debug: 30 5 command.c:77 script_debug(): ft2232_device_desc - argv[1]=Amontec JTAGkey
Debug: 32 5 command.c:68 script_debug(): command - ft2232_layout
Debug: 33 5 command.c:77 script_debug(): ft2232_layout - argv[0]=ocd_ft2232_layout
Debug: 34 5 command.c:77 script_debug(): ft2232_layout - argv[1]=jtagkey
Debug: 36 5 command.c:68 script_debug(): command - ft2232_vid_pid
Debug: 37 5 command.c:77 script_debug(): ft2232_vid_pid - argv[0]=ocd_ft2232_vid_pid
Debug: 38 5 command.c:77 script_debug(): ft2232_vid_pid - argv[1]=0x0403
Debug: 39 5 command.c:77 script_debug(): ft2232_vid_pid - argv[2]=0xcff8
Debug: 41 5 command.c:68 script_debug(): command - reset_config
Debug: 42 5 command.c:77 script_debug(): reset_config - argv[0]=ocd_reset_config
Debug: 43 5 command.c:77 script_debug(): reset_config - argv[1]=srst_only
Debug: 44 5 command.c:77 script_debug(): reset_config - argv[2]=srst_pulls_trst
Debug: 45 5 tcl.c:237 jim_newtap_cmd(): Creating New Tap, Chip: sam7, Tap: cpu, Dotted: sam7.cpu, 8 params
Debug: 46 5 tcl.c:253 jim_newtap_cmd(): Processing option: -irlen
Debug: 47 5 tcl.c:253 jim_newtap_cmd(): Processing option: -ircapture
Debug: 48 5 tcl.c:253 jim_newtap_cmd(): Processing option: -irmask
Debug: 49 5 tcl.c:253 jim_newtap_cmd(): Processing option: -expected-id
Debug: 50 5 core.c:1116 jtag_tap_init(): Created Tap: sam7.cpu @ abs position 0, irlen 4, capture: 0x1 mask: 0xf
Debug: 51 5 target.c:4295 jim_target(): Target command params:
Debug: 52 5 target.c:4296 jim_target(): target create sam7.cpu arm7tdmi -endian little -chain-position sam7.cpu -variant arm7tdmi
Debug: 54 6 command.c:68 script_debug(): command - bank
Debug: 55 6 command.c:77 script_debug(): bank - argv[0]=ocd_flash_bank
Debug: 56 6 command.c:77 script_debug(): bank - argv[1]=at91sam7
Debug: 57 6 command.c:77 script_debug(): bank - argv[2]=0
Debug: 58 6 command.c:77 script_debug(): bank - argv[3]=0
Debug: 59 6 command.c:77 script_debug(): bank - argv[4]=0
Debug: 60 6 command.c:77 script_debug(): bank - argv[5]=0
Debug: 61 6 command.c:77 script_debug(): bank - argv[6]=0
Debug: 63 6 command.c:68 script_debug(): command - init
Debug: 64 6 command.c:77 script_debug(): init - argv[0]=ocd_init
Debug: 65 7 openocd.c:129 handle_init_command(): target init complete
Debug: 66 7 ft2232.c:2059 ft2232_init(): ft2232 interface using shortest path jtag state transitions
Debug: 67 7 ft2232.c:1978 ft2232_init_libftdi(): 'ft2232' interface using libftdi with 'jtagkey' layout (0403:cff8)
Debug: 68 11 ft2232.c:2022 ft2232_init_libftdi(): current latency timer: 2
Debug: 69 12 ft2232.c:2304 jtagkey_init(): 80 08 1b
Debug: 70 12 ft2232.c:2363 jtagkey_init(): 82 09 0f
Debug: 71 12 ft2232.c:477 ft2232_speed(): 86 00 00
Debug: 72 13 openocd.c:136 handle_init_command(): jtag interface init complete
Debug: 73 13 core.c:1161 jtag_init_inner(): Init JTAG chain
Debug: 74 13 core.c:291 jtag_call_event_callbacks(): jtag event: JTAG controller reset (RESET or TRST)
Debug: 75 13 core.c:807 jtag_reset_callback(): -
Info : 76 15 core.c:874 jtag_examine_chain_display(): JTAG tap: sam7.cpu tap/device found: 0x3f0f0f0f (mfg: 0x787, part: 0xf0f0, ver: 0x3)
Info : 77 15 core.c:933 jtag_examine_chain_match_tap(): JTAG Tap/device matched
Debug: 78 17 openocd.c:142 handle_init_command(): jtag init complete
Debug: 79 19 arm7_9_common.c:61 arm7_9_clear_watchpoints(): -
Debug: 80 19 embeddedice.c:370 embeddedice_write_reg(): 12: 0x00000000
Debug: 81 19 embeddedice.c:370 embeddedice_write_reg(): 20: 0x00000000
Debug: 82 19 openocd.c:145 handle_init_command(): jtag examine complete
Debug: 83 19 openocd.c:151 handle_init_command(): flash init complete
Debug: 84 19 openocd.c:155 handle_init_command(): mflash init complete
Debug: 85 19 openocd.c:159 handle_init_command(): NAND init complete
Debug: 86 19 openocd.c:163 handle_init_command(): pld init complete
Debug: 87 20 gdb_server.c:2236 gdb_init(): gdb service for target arm7tdmi at port 3333
Info : 88 18769 server.c:79 add_connection(): accepting 'gdb' connection from 0
Debug: 89 18769 breakpoints.c:160 breakpoint_clear_target(): Delete all breakpoints for target: arm7tdmi
Debug: 90 18769 breakpoints.c:287 watchpoint_clear_target(): Delete all watchpoints for target: arm7tdmi
Debug: 91 18770 arm7_9_common.c:1279 arm7_9_halt(): target->state: running
Debug: 92 18770 embeddedice.c:370 embeddedice_write_reg(): 9: 0xffffffff
Debug: 93 18770 embeddedice.c:370 embeddedice_write_reg(): 11: 0xffffffff
Debug: 94 18770 embeddedice.c:370 embeddedice_write_reg(): 12: 0x00000100
Debug: 95 18770 embeddedice.c:370 embeddedice_write_reg(): 13: 0x000000f7
Debug: 96 18773 embeddedice.c:370 embeddedice_write_reg(): 0: 0x00000005
Debug: 97 18773 embeddedice.c:370 embeddedice_write_reg(): 12: 0x00000000
Debug: 98 18773 arm7_9_common.c:1389 arm7_9_debug_entry(): target entered debug from ARM state
Debug: 99 18775 arm7_9_common.c:1421 arm7_9_debug_entry(): target entered debug state in Supervisor mode
Debug: 100 18775 arm7_9_common.c:1444 arm7_9_debug_entry(): r0: 0x800000d3
Debug: 101 18775 arm7_9_common.c:1444 arm7_9_debug_entry(): r1: 0x002001a0
Debug: 102 18775 arm7_9_common.c:1444 arm7_9_debug_entry(): r2: 0x00000192
Debug: 103 18775 arm7_9_common.c:1444 arm7_9_debug_entry(): r3: 0x00200198
Debug: 104 18775 arm7_9_common.c:1444 arm7_9_debug_entry(): r4: 0x00080100
Debug: 105 18775 arm7_9_common.c:1444 arm7_9_debug_entry(): r5: 0x10008000
Debug: 106 18775 arm7_9_common.c:1444 arm7_9_debug_entry(): r6: 0x00000000
Debug: 107 18775 arm7_9_common.c:1444 arm7_9_debug_entry(): r7: 0x88000000
Debug: 108 18775 arm7_9_common.c:1444 arm7_9_debug_entry(): r8: 0x01000040
Debug: 109 18775 arm7_9_common.c:1444 arm7_9_debug_entry(): r9: 0x0200ac00
Debug: 110 18775 arm7_9_common.c:1444 arm7_9_debug_entry(): r10: 0x00084000
Debug: 111 18775 arm7_9_common.c:1444 arm7_9_debug_entry(): r11: 0x002009e0
Debug: 112 18775 arm7_9_common.c:1444 arm7_9_debug_entry(): r12: 0x002009dc
Debug: 113 18775 arm7_9_common.c:1444 arm7_9_debug_entry(): r13: 0x002009bc
Debug: 114 18775 arm7_9_common.c:1444 arm7_9_debug_entry(): r14: 0x00103f54
Debug: 115 18775 arm7_9_common.c:1444 arm7_9_debug_entry(): r15: 0x00103910
Debug: 116 18775 arm7_9_common.c:1450 arm7_9_debug_entry(): entered debug state at PC 0x103910
Debug: 117 18777 target.c:838 target_call_event_callbacks(): target event 4 (early-halted)
Debug: 118 18777 target.c:3414 target_handle_event(): event: 4 early-halted - no action
Debug: 119 18777 target.c:3414 target_handle_event(): event: 4 early-halted - no action
Debug: 120 18777 target.c:838 target_call_event_callbacks(): target event 5 (halted)
Debug: 121 18777 target.c:3414 target_handle_event(): event: 5 halted - no action
User : 122 18777 target.c:1100 target_arch_state(): target state: halted
User : 123 18777 armv4_5.c:305 armv4_5_arch_state(): target halted in ARM state due to debug-request, current mode: Supervisor
cpsr: 0x800000d3 pc: 0x00103910
Debug: 124 18777 target.c:3414 target_handle_event(): event: 5 halted - no action
Debug: 125 18777 target.c:838 target_call_event_callbacks(): target event 10 (gdb-end)
Debug: 126 18777 target.c:3403 target_handle_event(): target: (0) sam7.cpu (arm7tdmi) event: 10 (gdb-end) action: echo "**EVENT: gdb-end"
User : 127 18777 command.c:575 jim_echo(): **EVENT: gdb-end
Debug: 128 18777 target.c:3403 target_handle_event(): target: (0) sam7.cpu (arm7tdmi) event: 10 (gdb-end) action: echo "**EVENT: gdb-end"
User : 129 18777 command.c:575 jim_echo(): **EVENT: gdb-end
Debug: 130 18777 target.c:838 target_call_event_callbacks(): target event 26 (gdb-attach)
Debug: 131 18777 target.c:3414 target_handle_event(): event: 26 gdb-attach - no action
Debug: 132 18777 target.c:3414 target_handle_event(): event: 26 gdb-attach - no action
Debug: 133 18777 gdb_server.c:809 gdb_new_connection(): New GDB Connection: 1, Target sam7.cpu, state: halted
Debug: 134 18777 gdb_server.c:2058 gdb_input_inner(): received packet: 'qSupported'
Debug: 135 18778 gdb_server.c:2058 gdb_input_inner(): received packet: 'QStartNoAckMode'
Warn : 136 18778 gdb_server.c:580 gdb_get_packet_inner(): acknowledgment received, but no packet pending
Debug: 137 18778 gdb_server.c:2058 gdb_input_inner(): received packet: '?'
Debug: 138 18778 gdb_server.c:2058 gdb_input_inner(): received packet: 'Hc-1'
Debug: 139 18778 gdb_server.c:2058 gdb_input_inner(): received packet: 'qC'
Debug: 140 18778 gdb_server.c:2058 gdb_input_inner(): received packet: 'Hg0'
Debug: 141 18778 gdb_server.c:2058 gdb_input_inner(): received packet: 'g'
Debug: 142 18779 gdb_server.c:2058 gdb_input_inner(): received packet: 'qXfer:memory-map:read::0,fff'
Debug: 143 18779 arm7_9_common.c:2235 arm7_9_read_memory(): address: 0xfffff240, size: 0x00000004, count: 0x00000001
Debug: 144 18783 target.c:1342 target_read_u32(): address: 0xfffff240, value: 0x275b0940
Debug: 145 18783 arm7_9_common.c:2235 arm7_9_read_memory(): address: 0xfffffc20, size: 0x00000004, count: 0x00000001
Debug: 146 18787 target.c:1342 target_read_u32(): address: 0xfffffc20, value: 0x00000601
Debug: 147 18787 arm7_9_common.c:2235 arm7_9_read_memory(): address: 0xfffffc24, size: 0x00000004, count: 0x00000001
Debug: 148 18791 target.c:1342 target_read_u32(): address: 0xfffffc24, value: 0x000123c6
Debug: 149 18791 arm7_9_common.c:2235 arm7_9_read_memory(): address: 0xfffffc30, size: 0x00000004, count: 0x00000001
Debug: 150 18795 target.c:1342 target_read_u32(): address: 0xfffffc30, value: 0x00000007
Debug: 151 18795 arm7_9_common.c:2235 arm7_9_read_memory(): address: 0xfffffc2c, size: 0x00000004, count: 0x00000001
Debug: 152 18799 target.c:1342 target_read_u32(): address: 0xfffffc2c, value: 0x00481c0e
Debug: 153 18799 arm7_9_common.c:2235 arm7_9_read_memory(): address: 0xfffffc2c, size: 0x00000004, count: 0x00000001
Debug: 154 18803 target.c:1342 target_read_u32(): address: 0xfffffc2c, value: 0x00481c0e
Debug: 155 18803 arm7_9_common.c:2235 arm7_9_read_memory(): address: 0xffffff68, size: 0x00000004, count: 0x00000001
Debug: 156 18807 target.c:1342 target_read_u32(): address: 0xffffff68, value: 0x00000401
Debug: 157 18807 arm7_9_common.c:2235 arm7_9_read_memory(): address: 0xffffff68, size: 0x00000004, count: 0x00000001
Debug: 158 18811 target.c:1342 target_read_u32(): address: 0xffffff68, value: 0x00000401
Debug: 159 18811 at91sam7.c:616 at91sam7_read_part_info(): nvptyp: 0x002, arch: 0x0075
Debug: 160 18812 gdb_server.c:2058 gdb_input_inner(): received packet: 'm103910,4'
Debug: 161 18812 gdb_server.c:1197 gdb_read_memory_packet(): addr: 0x00103910, len: 0x00000004
Debug: 162 18812 target.c:1199 target_read_buffer(): reading buffer of 4 byte at 0x00103910
Debug: 163 18812 arm7_9_common.c:2235 arm7_9_read_memory(): address: 0x00103910, size: 0x00000004, count: 0x00000001
Debug: 164 19824 gdb_server.c:2058 gdb_input_inner(): received packet: 'vCont?'
Debug: 165 19824 gdb_server.c:2058 gdb_input_inner(): received packet: 'Hc0'
Debug: 166 19824 gdb_server.c:2058 gdb_input_inner(): received packet: 'c'
Debug: 167 19824 target.c:838 target_call_event_callbacks(): target event 9 (gdb-start)
Debug: 168 19824 target.c:3414 target_handle_event(): event: 9 gdb-start - no action
Debug: 169 19824 target.c:3414 target_handle_event(): event: 9 gdb-start - no action
Debug: 170 19824 gdb_server.c:1356 gdb_step_continue_packet(): -
Debug: 171 19824 gdb_server.c:1370 gdb_step_continue_packet(): continue
Debug: 172 19824 target.c:3414 target_handle_event(): event: 3 old-pre_resume - no action
Debug: 173 19824 arm7_9_common.c:1796 arm7_9_resume(): -
Debug: 174 19824 arm7_9_common.c:1595 arm7_9_restore_context(): -
Debug: 175 19824 arm7_9_common.c:1614 arm7_9_restore_context(): examining User mode
Debug: 176 19824 arm7_9_common.c:1628 arm7_9_restore_context(): examining dirty reg: r0
Debug: 177 19824 arm7_9_common.c:1628 arm7_9_restore_context(): examining dirty reg: r1
Debug: 178 19824 arm7_9_common.c:1628 arm7_9_restore_context(): examining dirty reg: pc
Debug: 179 19824 arm7_9_common.c:1676 arm7_9_restore_context(): writing register 0 of mode User with value 0x800000d3
Debug: 180 19824 arm7_9_common.c:1676 arm7_9_restore_context(): writing register 1 of mode User with value 0x002001a0
Debug: 181 19824 arm7_9_common.c:1614 arm7_9_restore_context(): examining FIQ mode
Debug: 182 19824 arm7_9_common.c:1628 arm7_9_restore_context(): examining dirty reg: pc
Debug: 183 19824 arm7_9_common.c:1614 arm7_9_restore_context(): examining IRQ mode
Debug: 184 19824 arm7_9_common.c:1628 arm7_9_restore_context(): examining dirty reg: pc
Debug: 185 19824 arm7_9_common.c:1614 arm7_9_restore_context(): examining Supervisor mode
Debug: 186 19824 arm7_9_common.c:1628 arm7_9_restore_context(): examining dirty reg: pc
Debug: 187 19824 arm7_9_common.c:1614 arm7_9_restore_context(): examining Abort mode
Debug: 188 19824 arm7_9_common.c:1628 arm7_9_restore_context(): examining dirty reg: pc
Debug: 189 19824 arm7_9_common.c:1614 arm7_9_restore_context(): examining Undefined mode
Debug: 190 19824 arm7_9_common.c:1628 arm7_9_restore_context(): examining dirty reg: pc
Debug: 191 19824 arm7_9_common.c:1716 arm7_9_restore_context(): writing PC with value 0x00103910
Debug: 192 19824 embeddedice.c:370 embeddedice_write_reg(): 0: 0x00000000
Debug: 193 19825 target.c:838 target_call_event_callbacks(): target event 6 (resumed)
Debug: 194 19825 target.c:3414 target_handle_event(): event: 6 resumed - no action
Debug: 195 19825 target.c:3414 target_handle_event(): event: 6 resumed - no action
Debug: 196 19825 arm7_9_common.c:1943 arm7_9_resume(): target resumed
Debug: 197 28425 gdb_server.c:2058 gdb_input_inner(): received packet: 'k'
Debug: 198 28425 gdb_server.c:823 gdb_connection_closed(): GDB Close, Target: sam7.cpu, state: running, gdb_actual_connections=0
Debug: 199 28425 target.c:838 target_call_event_callbacks(): target event 10 (gdb-end)
Debug: 200 28425 target.c:3403 target_handle_event(): target: (0) sam7.cpu (arm7tdmi) event: 10 (gdb-end) action: echo "**EVENT: gdb-end"
User : 201 28425 command.c:575 jim_echo(): **EVENT: gdb-end
Program received signal SIGSEGV, Segmentation fault.
#0 0x08082e3c in gdb_log_callback (priv=0x9385e50, file=0x81038ba "command.c", line=575, function=0x810452e "jim_echo",
string=0x938edc8 "**EVENT: gdb-end\n") at gdb_server.c:2005
#1 0x08084fd9 in log_puts (level=<value optimized out>, file=0x81038ba "command.c", line=575, function=0x810452e "jim_echo",
string=0x938edc8 "**EVENT: gdb-end\n") at log.c:140
#2 0x080850f5 in log_printf_lf (level=LOG_LVL_USER, file=0x81038ba "command.c", line=575, function=0x810452e "jim_echo", format=0x80f7099 "%s")
at log.c:182
#3 0x08085b6f in jim_echo (interp=0x936b020, argc=2, argv=0xbf8e1240) at command.c:575
#4 0x08095d82 in Jim_EvalObj (interp=0x936b020, scriptObjPtr=0x9386908) at jim.c:8708
#5 0x080726f0 in target_handle_event (target=0x93865a0, e=TARGET_EVENT_GDB_END) at target.c:3404
#6 0x08073513 in target_call_event_callbacks (target=0x93865a0, event=TARGET_EVENT_GDB_END) at target.c:840
#7 0x080805e0 in gdb_connection_closed (connection=0x9385e50) at gdb_server.c:847
#8 0x0807f06e in remove_connection (service=0x9398830, connection=0x9385e50) at server.c:123
#9 0x0807f559 in server_loop (command_context=0x936b008) at server.c:441
#10 0x0804a26c in openocd_main (argc=3, argv=0xbf8e1504) at openocd.c:283
#11 0x08049fc2 in main (argc=1447373354, argv=0x3a544e45) at main.c:39
# Change the default telnet port...
telnet_port 4444
# Port for TCL connection.
tcl_port 6666
# GDB connects here
gdb_port 3333
gdb_memory_map enable
interface ft2232
ft2232_device_desc "Amontec JTAGkey"
ft2232_layout jtagkey
ft2232_vid_pid 0x0403 0xcff8
#use combined on interfaces or targets that can't set TRST/SRST separately
reset_config srst_only srst_pulls_trst
if { [info exists CHIPNAME] } {
set _CHIPNAME $CHIPNAME
} else {
set _CHIPNAME sam7
}
if { [info exists ENDIAN] } {
set _ENDIAN $ENDIAN
} else {
set _ENDIAN little
}
if { [info exists CPUTAPID ] } {
set _CPUTAPID $CPUTAPID
} else {
set _CPUTAPID 0x3f0f0f0f
}
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id
$_CPUTAPID
set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position
$_TARGETNAME -variant arm7tdmi
$_TARGETNAME configure -event reset-start {
# disable watchdog
mww 0xfffffd44 0x00008000
# enable user reset
mww 0xfffffd08 0xa5000001
# CKGR_MOR : enable the main oscillator
mww 0xfffffc20 0x00000601
sleep 10
# CKGR_PLLR: 96.1097 MHz
mww 0xfffffc2c 0x00481c0e
sleep 10
# PMC_MCKR : MCK = PLL / 2 ~= 48 MHz
mww 0xfffffc30 0x00000007
sleep 10
# MC_FMR: flash mode (FWS=1,FMCN=60)
mww 0xffffff60 0x003c0100
sleep 10
# reset PC
reg pc 00000000
}
$_TARGETNAME configure -event gdb-end { echo "**EVENT: gdb-end" }
$_TARGETNAME configure -event gdb-detach {
shutdown
}
$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x00200000
-work-area-size 0x4000 -work-area-backup 0
#flash bank <driver> <base> <size> <chip_width> <bus_width>
flash bank at91sam7 0 0 0 0 0
_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development