Hi Duane, Thanks a lot for your detailed reply. I have answered your questions below.
===================== > > Did *YOU* build this, GDB, or did somebody else build it. > Where did you get it form? (I build my own from the gdb ftp site) > I built this GDB myself on a Ubuntu 8.04 machine using the build instructions given on www.gnuarm.com. > > ===================== > > Rahul> [SNIP: OpenOcd.cfg file] > > Seems fine with me :-) > > FYI - in this email, I refer to the *NEW* version of OpenOCD. > There was a recent large change - one thing was a better user manual :-) Thanks a lot for the new manual! :-) It will be a big help. > ===================== > > Rahul > [SNIP: ".gdbinit"] > > You did not say host development system. > based on the OpenOCD.cfg and the .GDBINIT file. > > My hunch is: Linux Dev Host + with usb jtag. > Please confirm. > Yes, you are right. I am using a Ubuntu 8.04 host + usb jtag. > > ===================== > > > Item #1 - "JTAG SPEED 0" - means: Try to use "RTCK" method. > > Your JTAG Dongle does not support this. > > Does your target actually support the RTCK? > Is it actually wired on the board? > (Some board vendors think you do not need it) > RTCK is not wired on the board. It is just pulled to ground. From the manual, it seems like jtag_speed 0 only uses RTCK for J-Link, but for ft2232, speed 0 means maximum frequency of 6 Mhz. Thanks for pointing me to this! I am using 1000 khz now. > > ===================== > > Rahul> [errors when loading to ram] > > You are loading to SDRAM correct? > What is initializing the SDRAM controller? > And the CPU osccilators? > > I presume, based on your OPENOCD script the following: > > (A) You RESET and let the board run, ie: "reset run" > Yes, this is the only option that works. I am not able to use "reset halt" or "reset init" to halt the target immediately after reset. The new manual says that these only work on some configurations, so nothing surprising here. Is this a hardware limitation or software (openocd) limitation? I have attached the complete log file for the case when I tried to issue a "init" followed by "reset halt" at the end of the openocd.cfg script. The snippet is shown below: Debug: 166 1763 arm926ejs.c:324 arm926ejs_examine_debug_reason(): vector catch breakpoint Debug: 167 1763 arm7_9_common.c:1156 arm7_9_debug_entry(): target entered debug from Thumb state Debug: 168 1765 arm7_9_common.c:1160 arm7_9_debug_entry(): r0_thumb: 0x00000000, pc_thumb: 0xfffffff4 Error: 169 1769 armv4_5.h:117 armv4_5_mode_to_number(): invalid mode value encountered Error: 170 1769 arm7_9_common.c:1192 arm7_9_debug_entry(): cpsr contains invalid mode value - communication failure User: 171 1769 command.c:619 openocd_jim_vfprintf(): Runtime error, file "embedded:startup.tcl", line 242: User: 172 1769 command.c:619 openocd_jim_vfprintf(): expected return code but got 'TARGET: target0 - Not halted' Why do we get this "invalid mode value - communication failure"? > (B) Some program runs perhaps a flash rom on your board? > Is it a boot loader? Yes, at reset, the uMon bootloader runs from the flash rom (64 MB). Since, I have to let the target run for some time before halting it, I might as well let it do some useful work by initializing the PLL's and SDRAM. (C) Does that flash rom initialize the SDRAM? > Yes, thats the first thing it does before jumping to its C start routine. SDRAM is connected to CS2 while the flash rom is connected to CS0. > (D) Does that flash rom configure the MMU > Or turn the CACHE on? (which requires the MMU) > The bootloader disables the MMU and cache. > > (E) If the MMU is enabled - are you writing to locations that are > "disabled" via the MMU? > > ===================== > > Rahul> [snip] This is trying to load the program at RAM address 0xC0100000. > Rahul> [snip] This is the 64 MB external SDRAM mapped at 0xC0000000. > > Hmm - You say mapped? - I point back to my MMU question (E). > > Or is the memory just there? I just meant to say that the SDRAM memory can be accessed at physical addresses starting from 0xC0000000 and the flash rom can be accessed from 0xC8000000. ===================== > > rahul> It is possible that the first line in X-packet protocol ... > > First: GDB is fine. I know it is - I use this version. > Second: OpenOCD is fine, I know it is, I used versions before & after that > version and many others. > I still have the same error. This time I tried a few simple commands in gdb. Here is their output: (gdb) mon halt target state: halted target halted in ARM state due to debug-request, current mode: Supervisor cpsr: 0x600000d3 pc: 0xc8008fd8 MMU: disabled, D-Cache: disabled, I-Cache: enabled (gdb) set *(0xC0200000)=5 Cannot access memory at address 0xc0200000 (gdb) info mem Using memory regions provided by the target. Num Enb Low Addr High Addr Attrs 0 y 0x00000000 0xc8000000 rw nocache 1 y 0xc8000000 0xcc000000 flash blocksize 0x20000 nocache 2 y 0xcc000000 0x100000000 rw nocache In target halt state, you can see that the MMU and caches are disabled. I tried to set a RAM address 0xC0200000. This address is also used in uMon to download programs to RAM using xmodem or tftp. I have also shown the memory map information that gdb got from openocd. > =================== > > When you are done = and it works = would you like to submit a complete > target configuration for > > I will definitely submit the complete working configuration. :-) Thanks again, Rahul. > > =================== > END > =================== > > -Duane > >
Debug: 9 0 configuration.c:88 find_file(): found imx21_flash_cfi_ftdi.cfg Debug: 11 1 command.c:91 script_command(): script_command - telnet_port Debug: 12 1 command.c:108 script_command(): script_command - telnet_port, argv[0]=ocd_telnet_port Debug: 13 1 command.c:108 script_command(): script_command - telnet_port, argv[1]=4444 Debug: 15 1 command.c:91 script_command(): script_command - gdb_port Debug: 16 1 command.c:108 script_command(): script_command - gdb_port, argv[0]=ocd_gdb_port Debug: 17 1 command.c:108 script_command(): script_command - gdb_port, argv[1]=3333 Debug: 19 1 command.c:91 script_command(): script_command - gdb_memory_map Debug: 20 1 command.c:108 script_command(): script_command - gdb_memory_map, argv[0]=ocd_gdb_memory_map Debug: 21 1 command.c:108 script_command(): script_command - gdb_memory_map, argv[1]=enable Debug: 23 1 command.c:91 script_command(): script_command - interface Debug: 24 1 command.c:108 script_command(): script_command - interface, argv[0]=ocd_interface Debug: 25 1 command.c:108 script_command(): script_command - interface, argv[1]=ft2232 Debug: 27 1 command.c:91 script_command(): script_command - ft2232_device_desc Debug: 28 1 command.c:108 script_command(): script_command - ft2232_device_desc, argv[0]=ocd_ft2232_device_desc Debug: 29 1 command.c:108 script_command(): script_command - ft2232_device_desc, argv[1]=Olimex OpenOCD JTAG Debug: 31 1 command.c:91 script_command(): script_command - ft2232_layout Debug: 32 1 command.c:108 script_command(): script_command - ft2232_layout, argv[0]=ocd_ft2232_layout Debug: 33 1 command.c:108 script_command(): script_command - ft2232_layout, argv[1]=olimex-jtag Debug: 35 1 command.c:91 script_command(): script_command - ft2232_vid_pid Debug: 36 1 command.c:108 script_command(): script_command - ft2232_vid_pid, argv[0]=ocd_ft2232_vid_pid Debug: 37 1 command.c:108 script_command(): script_command - ft2232_vid_pid, argv[1]=0x15ba Debug: 38 1 command.c:108 script_command(): script_command - ft2232_vid_pid, argv[2]=0x0003 Debug: 40 1 command.c:91 script_command(): script_command - jtag_khz Debug: 41 1 command.c:108 script_command(): script_command - jtag_khz, argv[0]=ocd_jtag_khz Debug: 42 1 command.c:108 script_command(): script_command - jtag_khz, argv[1]=1000 Debug: 43 1 jtag.c:1990 handle_jtag_khz_command(): handle jtag khz User: 44 1 command.c:375 command_print(): 1000 kHz Debug: 46 1 command.c:91 script_command(): script_command - reset_config Debug: 47 1 command.c:108 script_command(): script_command - reset_config, argv[0]=ocd_reset_config Debug: 48 1 command.c:108 script_command(): script_command - reset_config, argv[1]=trst_and_srst Debug: 50 2 command.c:91 script_command(): script_command - jtag_device Debug: 51 2 command.c:108 script_command(): script_command - jtag_device, argv[0]=ocd_jtag_device Debug: 52 2 command.c:108 script_command(): script_command - jtag_device, argv[1]=4 Debug: 53 2 command.c:108 script_command(): script_command - jtag_device, argv[2]=0x1 Debug: 54 2 command.c:108 script_command(): script_command - jtag_device, argv[3]=0x1 Debug: 55 2 command.c:108 script_command(): script_command - jtag_device, argv[4]=0xe Debug: 57 2 command.c:91 script_command(): script_command - jtag_nsrst_delay Debug: 58 2 command.c:108 script_command(): script_command - jtag_nsrst_delay, argv[0]=ocd_jtag_nsrst_delay Debug: 59 2 command.c:108 script_command(): script_command - jtag_nsrst_delay, argv[1]=200 Debug: 61 2 command.c:91 script_command(): script_command - jtag_ntrst_delay Debug: 62 2 command.c:108 script_command(): script_command - jtag_ntrst_delay, argv[0]=ocd_jtag_ntrst_delay Debug: 63 2 command.c:108 script_command(): script_command - jtag_ntrst_delay, argv[1]=200 Debug: 64 2 target.c:3994 jim_target(): Target command params: Debug: 65 2 target.c:3995 jim_target(): target create target0 arm926ejs -endian little -chain-position 0 -variant arm926ejs Debug: 67 2 command.c:91 script_command(): script_command - working_area Debug: 68 2 command.c:108 script_command(): script_command - working_area, argv[0]=ocd_working_area Debug: 69 2 command.c:108 script_command(): script_command - working_area, argv[1]=0 Debug: 70 2 command.c:108 script_command(): script_command - working_area, argv[2]=0xC0800000 Debug: 71 2 command.c:108 script_command(): script_command - working_area, argv[3]=0x8000 Debug: 72 2 command.c:108 script_command(): script_command - working_area, argv[4]=nobackup Debug: 74 2 command.c:91 script_command(): script_command - bank Debug: 75 2 command.c:108 script_command(): script_command - bank, argv[0]=ocd_flash_bank Debug: 76 2 command.c:108 script_command(): script_command - bank, argv[1]=cfi Debug: 77 2 command.c:108 script_command(): script_command - bank, argv[2]=0xC8000000 Debug: 78 3 command.c:108 script_command(): script_command - bank, argv[3]=0x4000000 Debug: 79 3 command.c:108 script_command(): script_command - bank, argv[4]=2 Debug: 80 3 command.c:108 script_command(): script_command - bank, argv[5]=2 Debug: 81 3 command.c:108 script_command(): script_command - bank, argv[6]=0 Debug: 83 3 command.c:91 script_command(): script_command - init Debug: 84 3 command.c:108 script_command(): script_command - init, argv[0]=ocd_init Debug: 85 3 openocd.c:143 handle_init_command(): target init complete Debug: 86 3 ft2232.c:1382 ft2232_init_ftd2xx(): 'ft2232' interface using FTD2XX with 'olimex-jtag' layout (15ba:0003) Debug: 87 269 ft2232.c:1471 ft2232_init_ftd2xx(): current latency timer: 2 Debug: 88 270 ft2232.c:1818 olimex_jtag_init(): 80 08 1b Debug: 89 271 ft2232.c:1861 olimex_jtag_init(): 82 09 0f Debug: 90 272 ft2232.c:256 ft2232_speed(): 86 05 00 Debug: 91 281 openocd.c:150 handle_init_command(): jtag interface init complete Debug: 92 281 jtag.c:1625 jtag_init_inner(): Init JTAG chain Debug: 93 281 jtag.c:327 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST) Debug: 94 281 jtag.c:1305 jtag_reset_callback(): - Debug: 95 282 jtag.c:327 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST) Debug: 96 282 jtag.c:1305 jtag_reset_callback(): - Info: 97 285 jtag.c:1414 jtag_examine_chain(): JTAG device found: 0x0792611f (Manufacturer: 0x08f, Part: 0x7926, Version: 0x0) Debug: 98 285 jtag.c:327 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST) Debug: 99 285 jtag.c:1305 jtag_reset_callback(): - Debug: 100 287 openocd.c:156 handle_init_command(): jtag init complete Debug: 101 291 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000000 Debug: 102 292 embeddedice.c:401 embeddedice_write_reg(): 12: 0x00000000 Debug: 103 292 embeddedice.c:401 embeddedice_write_reg(): 20: 0x00000000 Debug: 104 293 openocd.c:159 handle_init_command(): jtag examine complete Debug: 105 293 openocd.c:165 handle_init_command(): flash init complete Debug: 106 293 openocd.c:169 handle_init_command(): mflash init complete Debug: 107 293 openocd.c:173 handle_init_command(): NAND init complete Debug: 108 294 openocd.c:177 handle_init_command(): pld init complete Debug: 109 294 gdb_server.c:2205 gdb_init(): gdb service for target arm926ejs at port 3333 Warning: 110 294 tcl_server.c:178 tcl_init(): no tcl port specified, using default port 6666 Warning: 111 295 arm7_9_common.c:744 arm7_9_poll(): DBGACK set while target was in unknown state. Reset or initialize target. Debug: 112 295 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000005 Debug: 113 295 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000005 Error: 114 297 arm926ejs.c:352 arm926ejs_examine_debug_reason(): BUG: debug re-entry from system speed access shouldn't be handled here Debug: 115 297 arm7_9_common.c:1164 arm7_9_debug_entry(): target entered debug from ARM state Debug: 116 301 arm7_9_common.c:1196 arm7_9_debug_entry(): target entered debug state in Supervisor mode Error: 117 301 arm7_9_common.c:1219 arm7_9_debug_entry(): unknown debug reason: 6 Debug: 118 301 arm7_9_common.c:1227 arm7_9_debug_entry(): r0: 0x600000d7 Debug: 119 301 arm7_9_common.c:1227 arm7_9_debug_entry(): r1: 0x00000005 Debug: 120 301 arm7_9_common.c:1227 arm7_9_debug_entry(): r2: 0x00000008 Debug: 121 301 arm7_9_common.c:1227 arm7_9_debug_entry(): r3: 0xc000104c Debug: 122 301 arm7_9_common.c:1227 arm7_9_debug_entry(): r4: 0x00000000 Debug: 123 301 arm7_9_common.c:1227 arm7_9_debug_entry(): r5: 0xc0018e28 Debug: 124 301 arm7_9_common.c:1227 arm7_9_debug_entry(): r6: 0x00000000 Debug: 125 301 arm7_9_common.c:1227 arm7_9_debug_entry(): r7: 0xc000310c Debug: 126 301 arm7_9_common.c:1227 arm7_9_debug_entry(): r8: 0x000000ff Debug: 127 301 arm7_9_common.c:1227 arm7_9_debug_entry(): r9: 0x00000000 Debug: 128 301 arm7_9_common.c:1227 arm7_9_debug_entry(): r10: 0x00000000 Debug: 129 301 arm7_9_common.c:1227 arm7_9_debug_entry(): r11: 0x00000001 Debug: 130 301 arm7_9_common.c:1227 arm7_9_debug_entry(): r12: 0x00000001 Debug: 131 301 arm7_9_common.c:1227 arm7_9_debug_entry(): r13: 0xc001d088 Debug: 132 301 arm7_9_common.c:1227 arm7_9_debug_entry(): r14: 0xc800d7dc Debug: 133 301 arm7_9_common.c:1227 arm7_9_debug_entry(): r15: 0x00000048 Debug: 134 301 arm7_9_common.c:1233 arm7_9_debug_entry(): entered debug state at PC 0x48 Debug: 135 305 arm926ejs.c:478 arm926ejs_post_debug_entry(): cp15_control_reg: 00051078 Debug: 136 313 arm926ejs.c:499 arm926ejs_post_debug_entry(): D FSR: 0x00000008, D FAR: 0x00000000, I FSR: 0x00000008 Debug: 137 317 target.c:717 target_call_event_callbacks(): target event 4 (early-halted) Debug: 138 317 target.c:3126 target_handle_event(): event: 4 early-halted - no action Debug: 139 317 target.c:717 target_call_event_callbacks(): target event 5 (halted) Debug: 140 317 target.c:3126 target_handle_event(): event: 5 halted - no action User: 141 317 target.c:973 target_arch_state(): target state: halted User: 142 317 arm926ejs.c:599 arm926ejs_arch_state(): target halted in ARM state due to undefined, current mode: Supervisor cpsr: 0x600000d3 pc: 0x00000048 MMU: disabled, D-Cache: disabled, I-Cache: enabled Debug: 144 317 command.c:91 script_command(): script_command - reset Debug: 145 317 command.c:108 script_command(): script_command - reset, argv[0]=ocd_reset Debug: 146 317 command.c:108 script_command(): script_command - reset, argv[1]=halt Debug: 147 318 target.c:3994 jim_target(): Target command params: Debug: 148 318 target.c:3995 jim_target(): target names Debug: 149 318 target.c:3126 target_handle_event(): event: 11 reset-start - no action Debug: 150 318 jtag.c:1662 jtag_init_reset(): Trying to bring the JTAG controller to life by asserting TRST / TLR Debug: 151 318 jtag.c:1007 jtag_add_reset(): SRST line released Debug: 152 318 jtag.c:1026 jtag_add_reset(): TRST line asserted Debug: 153 318 jtag.c:327 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST) Debug: 154 318 jtag.c:1305 jtag_reset_callback(): - Debug: 155 318 jtag.c:1003 jtag_add_reset(): SRST line asserted Debug: 156 318 jtag.c:1026 jtag_add_reset(): TRST line asserted Debug: 157 319 jtag.c:327 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST) Debug: 158 319 jtag.c:1305 jtag_reset_callback(): - Debug: 159 319 jtag.c:1003 jtag_add_reset(): SRST line asserted Debug: 160 319 jtag.c:1007 jtag_add_reset(): SRST line released Debug: 161 319 ft2232.c:1045 olimex_jtag_reset(): trst: 1, srst: 0, high_output: 0x08, high_direction: 0x0f Debug: 162 321 arm926ejs.c:113 arm926ejs_catch_broken_irscan(): caught ARM926EJ-S invalid Capture-IR result after CP15 access Debug: 164 521 ft2232.c:1045 olimex_jtag_reset(): trst: 1, srst: 1, high_output: 0x0a, high_direction: 0x0f Debug: 165 521 ft2232.c:1045 olimex_jtag_reset(): trst: 0, srst: 1, high_output: 0x0b, high_direction: 0x0f Debug: 166 722 ft2232.c:1045 olimex_jtag_reset(): trst: 0, srst: 0, high_output: 0x09, high_direction: 0x0f Debug: 168 1123 jtag.c:1625 jtag_init_inner(): Init JTAG chain Debug: 169 1124 jtag.c:327 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST) Debug: 170 1124 jtag.c:1305 jtag_reset_callback(): - Info: 171 1127 jtag.c:1414 jtag_examine_chain(): JTAG device found: 0x0792611f (Manufacturer: 0x08f, Part: 0x7926, Version: 0x0) Debug: 172 1127 jtag.c:327 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST) Debug: 173 1127 jtag.c:1305 jtag_reset_callback(): - Debug: 174 1129 target.c:3994 jim_target(): Target command params: Debug: 175 1129 target.c:3995 jim_target(): target names Debug: 176 1131 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000000 Debug: 177 1132 embeddedice.c:401 embeddedice_write_reg(): 12: 0x00000000 Debug: 178 1132 embeddedice.c:401 embeddedice_write_reg(): 20: 0x00000000 Debug: 179 1133 target.c:3994 jim_target(): Target command params: Debug: 180 1133 target.c:3995 jim_target(): target names Debug: 181 1133 target.c:3126 target_handle_event(): event: 12 reset-assert-pre - no action Debug: 182 1133 arm7_9_common.c:818 arm7_9_assert_reset(): target->state: halted Debug: 183 1133 embeddedice.c:401 embeddedice_write_reg(): 2: 0x00000001 Debug: 184 1133 jtag.c:1003 jtag_add_reset(): SRST line asserted Debug: 185 1133 target.c:3126 target_handle_event(): event: 13 reset-assert-post - no action Debug: 186 1133 target.c:3994 jim_target(): Target command params: Debug: 187 1133 target.c:3995 jim_target(): target names Debug: 188 1133 target.c:3126 target_handle_event(): event: 14 reset-deassert-pre - no action Debug: 189 1133 arm7_9_common.c:880 arm7_9_deassert_reset(): target->state: reset Debug: 190 1133 jtag.c:1007 jtag_add_reset(): SRST line released Debug: 191 1133 target.c:3126 target_handle_event(): event: 15 reset-deassert-post - no action Debug: 192 1133 target.c:3994 jim_target(): Target command params: Debug: 193 1133 target.c:3995 jim_target(): target names Debug: 194 1133 ft2232.c:1045 olimex_jtag_reset(): trst: 0, srst: 1, high_output: 0x0b, high_direction: 0x0f Debug: 195 1396 ft2232.c:1045 olimex_jtag_reset(): trst: 0, srst: 0, high_output: 0x09, high_direction: 0x0f Debug: 197 1799 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000005 Debug: 198 1799 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000005 Debug: 199 1801 arm926ejs.c:324 arm926ejs_examine_debug_reason(): vector catch breakpoint Debug: 200 1801 arm7_9_common.c:1156 arm7_9_debug_entry(): target entered debug from Thumb state Debug: 201 1803 arm7_9_common.c:1160 arm7_9_debug_entry(): r0_thumb: 0x00000000, pc_thumb: 0xfffffff4 Error: 202 1807 armv4_5.h:117 armv4_5_mode_to_number(): invalid mode value encountered Error: 203 1807 arm7_9_common.c:1192 arm7_9_debug_entry(): cpsr contains invalid mode value - communication failure User: 204 1807 command.c:619 openocd_jim_vfprintf(): Runtime error, file "embedded:startup.tcl", line 242: User: 205 1807 command.c:619 openocd_jim_vfprintf(): expected return code but got 'TARGET: target0 - Not halted' User: 206 1807 command.c:619 openocd_jim_vfprintf(): In procedure 'ocd_process_reset' called at file "?", line 1 Debug: 207 1807 command.c:419 run_command(): Command failed with error code -4 User: 208 1807 command.c:619 openocd_jim_vfprintf(): Runtime error, file "imx21_flash_cfi_ftdi.cfg", line 57: User: 209 1807 command.c:619 openocd_jim_vfprintf(): User: 210 1807 command.c:619 openocd_jim_vfprintf(): In procedure 'script' called at file "command.c", line 448
_______________________________________________ Openocd-development mailing list [email protected] https://lists.berlios.de/mailman/listinfo/openocd-development
