OpenOCD-USB Problems

i recently bought the openocd-usb with FTD2232D chip and having being trying to get two dev boards Olimex LPC2124 and Keil LPC2129 working with it.

For the briefest of time it all worked on the Olimex board and i managed to flash the board twice but since then no joy with the same config and bin file :?

Previously and since I am getting the following error when trying to write image files and other commands:

Error:  FT_Write returned: 4
Error:  couldn't write MPSSE commands to FT2232

i am using OpenOCD svn1098 but was using svn1083 when it worked.

any help would be appreciated :slight_smile:

# daemon configuration
telnet_port 4444
gdb_port 3333

#interface
interface ft2232
ft2232_vid_pid 0x0403 0x6010
ft2232_device_desc "Dual RS232 A"
ft2232_layout "oocdlink"
ft2232_latency 5

# slow and verbose during init:
debug_level 2
fast disable
jtag_speed 3

# delays on reset lines
jtag_nsrst_delay 200
jtag_ntrst_delay 200


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

# jtag scan chain
jtag_device 4 0x1 0xf 0xe

# target settings
#target arm7tdmi little 0 arm7tdmi-s_r4
target create target0 arm7tdmi -endian little -chain-position 0 -variant arm7tdmi-s_r4
#
# scipts/macros/user commands - this is TCL (variant JIM):
#
proc mt_internal_rc {} {
	 jtag_khz 100
	 reset run
	 sleep 100
	 reset halt
	 wait_halt 2
	 # PLL disconnect PLLCON
	 mww 0xE01FC080 0x01 
	 mww 0xE01FC08C 0xAA 
	 mww 0xE01FC08C 0x55 
	 # PLL disable PLLCON
	 mww 0xE01FC080 0x00 
	 mww 0xE01FC08C 0xAA 
	 mww 0xE01FC08C 0x55 
	 # no prescaler CCLKCFG
	 mww 0xE01FC104 0x00
	 #  internal RC CLKSRCSEL
	 mww 0xE01FC10C 0x00 
	 #### main oscil. CLKSRCSEL
	 #### mww 0xE01FC10C 0x01
	 # remap to internal flash
	 mww 0xE01FC040 0x01 
	 sleep 100 
	 jtag_khz 500
	 flash probe 0 
}

proc mt_flash_bin {IMGFILE OFFSET} {
	 mt_internal_rc
	 flash write_image erase $IMGFILE $OFFSET
	 sleep 100 
	 verify_image $IMGFILE $OFFSET
	 sleep 100 
}

proc mt_flash {IMGFILE} {
	 mt_internal_rc
	 flash write_image erase $IMGFILE
	 sleep 100 
	 verify_image $IMGFILE
	 sleep 100 
}

# mthomas - note taken from the lpc2148 file in the OpenOCD target library:
# NOTE!!! LPCs need reset pulled while RTCK is low. 0 to activate 
# JTAG, power-on reset is not enough, i.e. you need to perform a
# reset before being able to talk to the LPC2148, attach is not
# possible.
proc target_0_post_reset {} {
	# Force target into ARM state
	soft_reset_halt
	# do not remap 0x0000-0x0020 to anything but the flash
	mwb 0xE01FC040 0x01
}


# working area in RAM
working_area 0 0x40000000 0x4000 nobackup

#flash bank lpc2000 <base> <size> 0 0    [calc_checksum]
flash bank lpc2000 0x0 0x40000 0 0 0 lpc2000_v1 14746 calc_checksum


gdb_flash_program enable

init

fast enable
jtag_khz 500
debug_level 1

could you post a debug_level 3 log please?

Cheers

Spen

Debug:   14 0 command.c:82 script_command(): script_command - fast
Debug:   15 0 command.c:99 script_command(): script_command - fast, argv[0]=ocd_fast
Debug:   16 0 command.c:99 script_command(): script_command - fast, argv[1]=disable
Debug:   18 0 command.c:82 script_command(): script_command - jtag_speed
Debug:   19 0 command.c:99 script_command(): script_command - jtag_speed, argv[0]=ocd_jtag_speed
Debug:   20 0 command.c:99 script_command(): script_command - jtag_speed, argv[1]=3
Debug:   21 0 jtag.c:1940 handle_jtag_speed_command(): handle jtag speed
User:    22 0 command.c:363 command_print(): jtag_speed: 3
Debug:   24 0 command.c:82 script_command(): script_command - jtag_nsrst_delay
Debug:   25 0 command.c:99 script_command(): script_command - jtag_nsrst_delay, argv[0]=ocd_jtag_nsrst_delay
Debug:   26 0 command.c:99 script_command(): script_command - jtag_nsrst_delay, argv[1]=200
Debug:   28 0 command.c:82 script_command(): script_command - jtag_ntrst_delay
Debug:   29 0 command.c:99 script_command(): script_command - jtag_ntrst_delay, argv[0]=ocd_jtag_ntrst_delay
Debug:   30 0 command.c:99 script_command(): script_command - jtag_ntrst_delay, argv[1]=200
Debug:   32 0 command.c:82 script_command(): script_command - reset_config
Debug:   33 0 command.c:99 script_command(): script_command - reset_config, argv[0]=ocd_reset_config
Debug:   34 0 command.c:99 script_command(): script_command - reset_config, argv[1]=trst_and_srst
Debug:   35 0 command.c:99 script_command(): script_command - reset_config, argv[2]=srst_pulls_trst
Debug:   37 0 command.c:82 script_command(): script_command - jtag_device
Debug:   38 0 command.c:99 script_command(): script_command - jtag_device, argv[0]=ocd_jtag_device
Debug:   39 0 command.c:99 script_command(): script_command - jtag_device, argv[1]=4
Debug:   40 0 command.c:99 script_command(): script_command - jtag_device, argv[2]=0x1
Debug:   41 0 command.c:99 script_command(): script_command - jtag_device, argv[3]=0xf
Debug:   42 0 command.c:99 script_command(): script_command - jtag_device, argv[4]=0xe
Debug:   43 0 target.c:3859 jim_target(): Target command params:
Debug:   44 0 target.c:3860 jim_target(): target create target0 arm7tdmi -endian little -chain-position 0 -variant arm7tdmi-s_r4 
Debug:   46 0 command.c:82 script_command(): script_command - working_area
Debug:   47 0 command.c:99 script_command(): script_command - working_area, argv[0]=ocd_working_area
Debug:   48 0 command.c:99 script_command(): script_command - working_area, argv[1]=0
Debug:   49 0 command.c:99 script_command(): script_command - working_area, argv[2]=0x40000000
Debug:   50 0 command.c:99 script_command(): script_command - working_area, argv[3]=0x4000
Debug:   51 0 command.c:99 script_command(): script_command - working_area, argv[4]=nobackup
Debug:   53 0 command.c:82 script_command(): script_command - bank
Debug:   54 0 command.c:99 script_command(): script_command - bank, argv[0]=ocd_flash_bank
Debug:   55 0 command.c:99 script_command(): script_command - bank, argv[1]=lpc2000
Debug:   56 0 command.c:99 script_command(): script_command - bank, argv[2]=0x0
Debug:   57 0 command.c:99 script_command(): script_command - bank, argv[3]=0x40000
Debug:   58 0 command.c:99 script_command(): script_command - bank, argv[4]=0
Debug:   59 0 command.c:99 script_command(): script_command - bank, argv[5]=0
Debug:   60 0 command.c:99 script_command(): script_command - bank, argv[6]=0
Debug:   61 0 command.c:99 script_command(): script_command - bank, argv[7]=lpc2000_v1
Debug:   62 0 command.c:99 script_command(): script_command - bank, argv[8]=14746
Debug:   63 0 command.c:99 script_command(): script_command - bank, argv[9]=calc_checksum
Debug:   65 0 command.c:82 script_command(): script_command - gdb_flash_program
Debug:   66 0 command.c:99 script_command(): script_command - gdb_flash_program, argv[0]=ocd_gdb_flash_program
Debug:   67 0 command.c:99 script_command(): script_command - gdb_flash_program, argv[1]=enable
Debug:   69 0 command.c:82 script_command(): script_command - init
Debug:   70 0 command.c:99 script_command(): script_command - init, argv[0]=ocd_init
Debug:   71 0 openocd.c:133 handle_init_command(): target init complete
Debug:   72 0 ft2232.c:1382 ft2232_init_ftd2xx(): 'ft2232' interface using FTD2XX with 'oocdlink' layout (0403:6010)
Debug:   73 31 ft2232.c:1471 ft2232_init_ftd2xx(): current latency timer: 2
Debug:   74 31 ft2232.c:1737 jtagkey_init(): 80 08 1b
Debug:   75 31 ft2232.c:1795 jtagkey_init(): 82 06 0f
Debug:   76 31 ft2232.c:256 ft2232_speed(): 86 03 00
Debug:   77 31 openocd.c:140 handle_init_command(): jtag interface init complete
Debug:   78 31 jtag.c:1621 jtag_init_inner(): Init JTAG chain
Debug:   79 31 jtag.c:327 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST)
Debug:   80 31 jtag.c:1301 jtag_reset_callback(): -
Debug:   81 31 jtag.c:327 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST)
Debug:   82 31 jtag.c:1301 jtag_reset_callback(): -
Info:    83 31 jtag.c:1410 jtag_examine_chain(): JTAG device found: 0x4f1f0f0f (Manufacturer: 0x787, Part: 0xf1f0, Version: 0x4)
Debug:   84 31 jtag.c:327 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST)
Debug:   85 31 jtag.c:1301 jtag_reset_callback(): -
Debug:   86 31 openocd.c:146 handle_init_command(): jtag init complete
Debug:   87 31 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000000
Debug:   88 31 embeddedice.c:401 embeddedice_write_reg(): 12: 0x00000000
Debug:   89 31 embeddedice.c:401 embeddedice_write_reg(): 20: 0x00000000
Debug:   90 31 openocd.c:149 handle_init_command(): jtag examine complete
Debug:   91 31 openocd.c:155 handle_init_command(): flash init complete
Debug:   92 31 openocd.c:159 handle_init_command(): mflash init complete
Debug:   93 31 openocd.c:163 handle_init_command(): NAND init complete
Debug:   94 31 openocd.c:167 handle_init_command(): pld init complete
Debug:   95 47 gdb_server.c:2168 gdb_init(): gdb service for target arm7tdmi at port 3333
Warning: 96 47 tcl_server.c:178 tcl_init(): no tcl port specified, using default port 6666
Debug:   98 47 command.c:82 script_command(): script_command - fast
Debug:   99 47 command.c:99 script_command(): script_command - fast, argv[0]=ocd_fast
Debug:   100 47 command.c:99 script_command(): script_command - fast, argv[1]=enable
Debug:   102 47 command.c:82 script_command(): script_command - jtag_khz
Debug:   103 47 command.c:99 script_command(): script_command - jtag_khz, argv[0]=ocd_jtag_khz
Debug:   104 47 command.c:99 script_command(): script_command - jtag_khz, argv[1]=500
Debug:   105 47 jtag.c:1965 handle_jtag_khz_command(): handle jtag khz
Debug:   106 47 jtag.c:1973 handle_jtag_khz_command(): have interface set up
Debug:   107 47 ft2232.c:256 ft2232_speed(): 86 0b 00
User:    108 47 command.c:363 command_print(): jtag_khz: 500
Debug:   110 47 command.c:82 script_command(): script_command - debug_level
Debug:   111 47 command.c:99 script_command(): script_command - debug_level, argv[0]=ocd_debug_level
Debug:   112 47 command.c:99 script_command(): script_command - debug_level, argv[1]=3
Debug:   114 47 command.c:82 script_command(): script_command - init
Debug:   115 47 command.c:99 script_command(): script_command - init, argv[0]=ocd_init
Info:    116 5250 server.c:84 add_connection(): accepting 'telnet' connection from 0
Debug:   118 22141 command.c:82 script_command(): script_command - jtag_khz
Debug:   119 22141 command.c:99 script_command(): script_command - jtag_khz, argv[0]=ocd_jtag_khz
Debug:   120 22141 command.c:99 script_command(): script_command - jtag_khz, argv[1]=100
Debug:   121 22141 jtag.c:1965 handle_jtag_khz_command(): handle jtag khz
Debug:   122 22141 jtag.c:1973 handle_jtag_khz_command(): have interface set up
Debug:   123 22141 ft2232.c:256 ft2232_speed(): 86 3b 00
User:    124 22141 command.c:363 command_print(): jtag_khz: 100
Debug:   126 22141 command.c:82 script_command(): script_command - reset
Debug:   127 22141 command.c:99 script_command(): script_command - reset, argv[0]=ocd_reset
Debug:   128 22141 command.c:99 script_command(): script_command - reset, argv[1]=run
Debug:   129 22141 target.c:3859 jim_target(): Target command params:
Debug:   130 22141 target.c:3860 jim_target(): target names 
Debug:   131 22141 target.c:2995 target_handle_event(): event: 9 reset-start - no action
Debug:   132 22141 jtag.c:1658 jtag_init_reset(): Trying to bring the JTAG controller to life by asserting TRST / TLR
Debug:   133 22141 jtag.c:1003 jtag_add_reset(): SRST line released
Debug:   134 22141 jtag.c:1022 jtag_add_reset(): TRST line asserted
Debug:   135 22141 jtag.c:327 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST)
Debug:   136 22141 jtag.c:1301 jtag_reset_callback(): -
Debug:   137 22141 jtag.c:999 jtag_add_reset(): SRST line asserted
Debug:   138 22141 jtag.c:1022 jtag_add_reset(): TRST line asserted
Debug:   139 22141 jtag.c:327 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST)
Debug:   140 22141 jtag.c:1301 jtag_reset_callback(): -
Debug:   141 22141 jtag.c:1003 jtag_add_reset(): SRST line released
Debug:   142 22141 ft2232.c:1012 jtagkey_reset(): trst: 1, srst: 0, high_output: 0x04, high_direction: 0x0f
Debug:   143 22375 ft2232.c:1012 jtagkey_reset(): trst: 1, srst: 1, high_output: 0x00, high_direction: 0x0f
Debug:   144 22375 ft2232.c:1012 jtagkey_reset(): trst: 0, srst: 0, high_output: 0x06, high_direction: 0x0f
Debug:   146 22891 jtag.c:1621 jtag_init_inner(): Init JTAG chain
Debug:   147 22891 jtag.c:327 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST)
Debug:   148 22891 jtag.c:1301 jtag_reset_callback(): -
Info:    149 22906 jtag.c:1410 jtag_examine_chain(): JTAG device found: 0x4f1f0f0f (Manufacturer: 0x787, Part: 0xf1f0, Version: 0x4)
Debug:   150 22906 jtag.c:327 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST)
Debug:   151 22906 jtag.c:1301 jtag_reset_callback(): -
Debug:   152 22906 target.c:3859 jim_target(): Target command params:
Debug:   153 22906 target.c:3860 jim_target(): target names 
Debug:   154 22906 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000000
Debug:   155 22906 embeddedice.c:401 embeddedice_write_reg(): 12: 0x00000000
Debug:   156 22906 embeddedice.c:401 embeddedice_write_reg(): 20: 0x00000000
Debug:   157 22906 target.c:3859 jim_target(): Target command params:
Debug:   158 22906 target.c:3860 jim_target(): target names 
Debug:   159 22906 target.c:2995 target_handle_event(): event: 10 reset-assert-pre - no action
Debug:   160 22906 arm7_9_common.c:814 arm7_9_assert_reset(): target->state: running
Debug:   161 22906 jtag.c:999 jtag_add_reset(): SRST line asserted
Debug:   162 22906 jtag.c:1022 jtag_add_reset(): TRST line asserted
Debug:   163 22906 jtag.c:327 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST)
Debug:   164 22906 jtag.c:1301 jtag_reset_callback(): -
Debug:   165 22906 target.c:2995 target_handle_event(): event: 11 reset-assert-post - no action
Debug:   166 22906 target.c:3859 jim_target(): Target command params:
Debug:   167 22906 target.c:3860 jim_target(): target names 
Debug:   168 22906 target.c:2995 target_handle_event(): event: 12 reset-deassert-pre - no action
Debug:   169 22906 arm7_9_common.c:876 arm7_9_deassert_reset(): target->state: reset
Debug:   170 22906 jtag.c:1003 jtag_add_reset(): SRST line released
Debug:   171 22906 target.c:2995 target_handle_event(): event: 13 reset-deassert-post - no action
Debug:   172 22906 target.c:3859 jim_target(): Target command params:
Debug:   173 22906 target.c:3860 jim_target(): target names 
Debug:   174 22906 target.c:2995 target_handle_event(): event: 19 reset-end - no action
Debug:   175 22906 ft2232.c:1012 jtagkey_reset(): trst: 1, srst: 1, high_output: 0x00, high_direction: 0x0f
Debug:   176 22969 ft2232.c:1012 jtagkey_reset(): trst: 0, srst: 0, high_output: 0x06, high_direction: 0x0f
Debug:   179 23406 command.c:82 script_command(): script_command - sleep
Debug:   180 23406 command.c:99 script_command(): script_command - sleep, argv[0]=ocd_sleep
Debug:   181 23406 command.c:99 script_command(): script_command - sleep, argv[1]=100
Debug:   183 23516 command.c:82 script_command(): script_command - reset
Debug:   184 23516 command.c:99 script_command(): script_command - reset, argv[0]=ocd_reset
Debug:   185 23516 command.c:99 script_command(): script_command - reset, argv[1]=halt
Debug:   186 23516 target.c:3859 jim_target(): Target command params:
Debug:   187 23516 target.c:3860 jim_target(): target names 
Debug:   188 23516 target.c:2995 target_handle_event(): event: 9 reset-start - no action
Debug:   189 23516 jtag.c:1658 jtag_init_reset(): Trying to bring the JTAG controller to life by asserting TRST / TLR
Debug:   190 23516 jtag.c:1003 jtag_add_reset(): SRST line released
Debug:   191 23516 jtag.c:1022 jtag_add_reset(): TRST line asserted
Debug:   192 23516 jtag.c:327 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST)
Debug:   193 23516 jtag.c:1301 jtag_reset_callback(): -
Debug:   194 23516 jtag.c:999 jtag_add_reset(): SRST line asserted
Debug:   195 23516 jtag.c:1022 jtag_add_reset(): TRST line asserted
Debug:   196 23516 jtag.c:327 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST)
Debug:   197 23516 jtag.c:1301 jtag_reset_callback(): -
Debug:   198 23516 jtag.c:1003 jtag_add_reset(): SRST line released
Debug:   199 23516 ft2232.c:1012 jtagkey_reset(): trst: 1, srst: 0, high_output: 0x04, high_direction: 0x0f
Debug:   201 23797 ft2232.c:1012 jtagkey_reset(): trst: 1, srst: 1, high_output: 0x00, high_direction: 0x0f
Debug:   202 23797 ft2232.c:1012 jtagkey_reset(): trst: 0, srst: 0, high_output: 0x06, high_direction: 0x0f
Debug:   203 24219 jtag.c:1621 jtag_init_inner(): Init JTAG chain
Debug:   204 24219 jtag.c:327 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST)
Debug:   205 24219 jtag.c:1301 jtag_reset_callback(): -
Info:    206 24234 jtag.c:1410 jtag_examine_chain(): JTAG device found: 0x4f1f0f0f (Manufacturer: 0x787, Part: 0xf1f0, Version: 0x4)
Debug:   207 24234 jtag.c:327 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST)
Debug:   208 24234 jtag.c:1301 jtag_reset_callback(): -
Debug:   209 24234 target.c:3859 jim_target(): Target command params:
Debug:   210 24234 target.c:3860 jim_target(): target names 
Debug:   211 24234 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000000
Debug:   212 24234 embeddedice.c:401 embeddedice_write_reg(): 12: 0x00000000
Debug:   213 24234 embeddedice.c:401 embeddedice_write_reg(): 20: 0x00000000
Debug:   214 24234 target.c:3859 jim_target(): Target command params:
Debug:   215 24234 target.c:3860 jim_target(): target names 
Debug:   216 24234 target.c:2995 target_handle_event(): event: 10 reset-assert-pre - no action
Debug:   217 24234 arm7_9_common.c:814 arm7_9_assert_reset(): target->state: running
Debug:   218 24234 embeddedice.c:401 embeddedice_write_reg(): 8: 0x00000000
Debug:   219 24234 embeddedice.c:401 embeddedice_write_reg(): 9: 0x00000003
Debug:   220 24234 embeddedice.c:401 embeddedice_write_reg(): 11: 0xffffffff
Debug:   221 24234 embeddedice.c:401 embeddedice_write_reg(): 12: 0x00000100
Debug:   222 24234 embeddedice.c:401 embeddedice_write_reg(): 13: 0x000000f7
Debug:   223 24234 jtag.c:999 jtag_add_reset(): SRST line asserted
Debug:   224 24234 jtag.c:1022 jtag_add_reset(): TRST line asserted
Debug:   225 24234 jtag.c:327 jtag_call_event_callbacks(): jtag event: JTAG controller reset (TLR or TRST)
Debug:   226 24234 jtag.c:1301 jtag_reset_callback(): -
Debug:   227 24234 target.c:2995 target_handle_event(): event: 11 reset-assert-post - no action
Debug:   228 24234 target.c:3859 jim_target(): Target command params:
Debug:   229 24234 target.c:3860 jim_target(): target names 
Debug:   230 24234 target.c:2995 target_handle_event(): event: 12 reset-deassert-pre - no action
Debug:   231 24234 arm7_9_common.c:876 arm7_9_deassert_reset(): target->state: reset
Debug:   232 24234 jtag.c:1003 jtag_add_reset(): SRST line released
Warning: 233 24234 arm7_9_common.c:884 arm7_9_deassert_reset(): srst pulls trst - can not reset into halted mode. Issuing halt after reset.
Debug:   234 24234 ft2232.c:1012 jtagkey_reset(): trst: 1, srst: 1, high_output: 0x00, high_direction: 0x0f
Debug:   236 24297 ft2232.c:1012 jtagkey_reset(): trst: 0, srst: 0, high_output: 0x06, high_direction: 0x0f
Debug:   238 24812 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000000
Debug:   239 24812 embeddedice.c:401 embeddedice_write_reg(): 12: 0x00000000
Debug:   240 24812 embeddedice.c:401 embeddedice_write_reg(): 20: 0x00000000
Debug:   241 24812 arm7_9_common.c:1061 arm7_9_halt(): target->state: running
Debug:   242 24812 embeddedice.c:401 embeddedice_write_reg(): 9: 0xffffffff
Debug:   243 24812 embeddedice.c:401 embeddedice_write_reg(): 11: 0xffffffff
Debug:   244 24812 embeddedice.c:401 embeddedice_write_reg(): 12: 0x00000100
Debug:   245 24812 embeddedice.c:401 embeddedice_write_reg(): 13: 0x000000f7
Debug:   246 24812 target.c:2995 target_handle_event(): event: 13 reset-deassert-post - no action
Debug:   247 24812 target.c:3859 jim_target(): Target command params:
Debug:   248 24812 target.c:3860 jim_target(): target names 
Debug:   249 24812 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000005
Debug:   250 24812 embeddedice.c:401 embeddedice_write_reg(): 12: 0x00000000
Debug:   251 24812 arm7_9_common.c:1160 arm7_9_debug_entry(): target entered debug from ARM state
Debug:   252 24828 arm7_9_common.c:1192 arm7_9_debug_entry(): target entered debug state in Abort mode
Debug:   253 24828 arm7_9_common.c:1223 arm7_9_debug_entry(): r0: 0x942802b4
Debug:   254 24828 arm7_9_common.c:1223 arm7_9_debug_entry(): r1: 0x40000200
Debug:   255 24828 arm7_9_common.c:1223 arm7_9_debug_entry(): r2: 0x00000023
Debug:   256 24828 arm7_9_common.c:1223 arm7_9_debug_entry(): r3: 0x0aaa0848
Debug:   257 24828 arm7_9_common.c:1223 arm7_9_debug_entry(): r4: 0x00000000
Debug:   258 24828 arm7_9_common.c:1223 arm7_9_debug_entry(): r5: 0xe01fc040
Debug:   259 24828 arm7_9_common.c:1223 arm7_9_debug_entry(): r6: 0x4c23a692
Debug:   260 24828 arm7_9_common.c:1223 arm7_9_debug_entry(): r7: 0x2a477c24
Debug:   261 24828 arm7_9_common.c:1223 arm7_9_debug_entry(): r8: 0xa0a29338
Debug:   262 24828 arm7_9_common.c:1223 arm7_9_debug_entry(): r9: 0x9201c562
Debug:   263 24828 arm7_9_common.c:1223 arm7_9_debug_entry(): r10: 0x100ec418
Debug:   264 24828 arm7_9_common.c:1223 arm7_9_debug_entry(): r11: 0x40003eb0
Debug:   265 24828 arm7_9_common.c:1223 arm7_9_debug_entry(): r12: 0x40003eb4
Debug:   266 24828 arm7_9_common.c:1223 arm7_9_debug_entry(): r13: 0x40003ed8
Debug:   267 24828 arm7_9_common.c:1223 arm7_9_debug_entry(): r14: 0x0000201c
Debug:   268 24828 arm7_9_common.c:1223 arm7_9_debug_entry(): r15: 0x0000061c
Debug:   269 24828 arm7_9_common.c:1229 arm7_9_debug_entry(): entered debug state at PC 0x61c
Debug:   270 24844 target.c:709 target_call_event_callbacks(): target event 4 (early-halted)
Debug:   271 24844 target.c:2995 target_handle_event(): event: 4 early-halted - no action
Debug:   272 24844 target.c:709 target_call_event_callbacks(): target event 5 (halted)
Debug:   273 24844 target.c:2995 target_handle_event(): event: 5 halted - no action
User:    274 24844 target.c:965 target_arch_state(): target state: halted
User:    275 24844 armv4_5.c:317 armv4_5_arch_state(): target halted in ARM state due to debug-request, current mode: Abort
cpsr: 0x200000d7 pc: 0x0000061c
Debug:   276 24844 target.c:3859 jim_target(): Target command params:
Debug:   277 24844 target.c:3860 jim_target(): target names 
Debug:   278 24844 target.c:2995 target_handle_event(): event: 19 reset-end - no action
Debug:   280 24844 command.c:82 script_command(): script_command - wait_halt
Debug:   281 24844 command.c:99 script_command(): script_command - wait_halt, argv[0]=ocd_wait_halt
Debug:   282 24844 command.c:99 script_command(): script_command - wait_halt, argv[1]=2
Debug:   284 24844 command.c:82 script_command(): script_command - mww
Debug:   285 24844 command.c:99 script_command(): script_command - mww, argv[0]=ocd_mww
Debug:   286 24844 command.c:99 script_command(): script_command - mww, argv[1]=0xE01FC080
Debug:   287 24844 command.c:99 script_command(): script_command - mww, argv[2]=0x01
Debug:   288 24844 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000004
Debug:   289 24859 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000005
Debug:   291 24875 command.c:82 script_command(): script_command - mww
Debug:   292 24875 command.c:99 script_command(): script_command - mww, argv[0]=ocd_mww
Debug:   293 24875 command.c:99 script_command(): script_command - mww, argv[1]=0xE01FC08C
Debug:   294 24875 command.c:99 script_command(): script_command - mww, argv[2]=0xAA
Debug:   295 24875 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000004
Debug:   296 24891 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000005
Debug:   298 24891 command.c:82 script_command(): script_command - mww
Debug:   299 24891 command.c:99 script_command(): script_command - mww, argv[0]=ocd_mww
Debug:   300 24891 command.c:99 script_command(): script_command - mww, argv[1]=0xE01FC08C
Debug:   301 24891 command.c:99 script_command(): script_command - mww, argv[2]=0x55
Debug:   302 24891 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000004
Debug:   303 24906 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000005
Debug:   305 24922 command.c:82 script_command(): script_command - mww
Debug:   306 24922 command.c:99 script_command(): script_command - mww, argv[0]=ocd_mww
Debug:   307 24922 command.c:99 script_command(): script_command - mww, argv[1]=0xE01FC080
Debug:   308 24922 command.c:99 script_command(): script_command - mww, argv[2]=0x00
Debug:   309 24922 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000004
Debug:   310 24937 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000005
Debug:   312 24937 command.c:82 script_command(): script_command - mww
Debug:   313 24937 command.c:99 script_command(): script_command - mww, argv[0]=ocd_mww
Debug:   314 24937 command.c:99 script_command(): script_command - mww, argv[1]=0xE01FC08C
Debug:   315 24937 command.c:99 script_command(): script_command - mww, argv[2]=0xAA
Debug:   316 24937 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000004
Debug:   317 24953 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000005
Debug:   319 24969 command.c:82 script_command(): script_command - mww
Debug:   320 24969 command.c:99 script_command(): script_command - mww, argv[0]=ocd_mww
Debug:   321 24969 command.c:99 script_command(): script_command - mww, argv[1]=0xE01FC08C
Debug:   322 24969 command.c:99 script_command(): script_command - mww, argv[2]=0x55
Debug:   323 24969 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000004
Debug:   324 24984 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000005
Debug:   326 24984 command.c:82 script_command(): script_command - mww
Debug:   327 24984 command.c:99 script_command(): script_command - mww, argv[0]=ocd_mww
Debug:   328 24984 command.c:99 script_command(): script_command - mww, argv[1]=0xE01FC104
Debug:   329 24984 command.c:99 script_command(): script_command - mww, argv[2]=0x00
Debug:   330 24984 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000004
Debug:   331 25000 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000005
Debug:   333 25016 command.c:82 script_command(): script_command - mww
Debug:   334 25016 command.c:99 script_command(): script_command - mww, argv[0]=ocd_mww
Debug:   335 25016 command.c:99 script_command(): script_command - mww, argv[1]=0xE01FC10C
Debug:   336 25016 command.c:99 script_command(): script_command - mww, argv[2]=0x00
Debug:   337 25016 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000004
Debug:   338 25031 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000005
Debug:   340 25031 command.c:82 script_command(): script_command - mww
Debug:   341 25031 command.c:99 script_command(): script_command - mww, argv[0]=ocd_mww
Debug:   342 25031 command.c:99 script_command(): script_command - mww, argv[1]=0xE01FC040
Debug:   343 25031 command.c:99 script_command(): script_command - mww, argv[2]=0x01
Debug:   344 25031 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000004
Debug:   345 25047 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000005
Debug:   347 25062 command.c:82 script_command(): script_command - sleep
Debug:   348 25062 command.c:99 script_command(): script_command - sleep, argv[0]=ocd_sleep
Debug:   349 25062 command.c:99 script_command(): script_command - sleep, argv[1]=100
Debug:   351 25172 command.c:82 script_command(): script_command - jtag_khz
Debug:   352 25172 command.c:99 script_command(): script_command - jtag_khz, argv[0]=ocd_jtag_khz
Debug:   353 25172 command.c:99 script_command(): script_command - jtag_khz, argv[1]=500
Debug:   354 25172 jtag.c:1965 handle_jtag_khz_command(): handle jtag khz
Debug:   355 25172 jtag.c:1973 handle_jtag_khz_command(): have interface set up
Debug:   356 25172 ft2232.c:256 ft2232_speed(): 86 0b 00
User:    357 25172 command.c:363 command_print(): jtag_khz: 500
Debug:   359 25172 command.c:82 script_command(): script_command - probe
Debug:   360 25172 command.c:99 script_command(): script_command - probe, argv[0]=ocd_flash_probe
Debug:   361 25172 command.c:99 script_command(): script_command - probe, argv[1]=0
User:    362 25172 command.c:363 command_print(): flash 'lpc2000' found at 0x00000000
Debug:   364 25172 command.c:82 script_command(): script_command - write_image
Debug:   365 25172 command.c:99 script_command(): script_command - write_image, argv[0]=ocd_flash_write_image
Debug:   366 25172 command.c:99 script_command(): script_command - write_image, argv[1]=erase
Debug:   367 25172 command.c:99 script_command(): script_command - write_image, argv[2]=main.bin
Debug:   368 25172 command.c:99 script_command(): script_command - write_image, argv[3]=0x00
User:    369 25172 command.c:363 command_print(): auto erase enabled
Debug:   370 25172 configuration.c:88 find_file(): found main.bin
Debug:   371 25172 configuration.c:88 find_file(): found main.bin
Debug:   372 25172 target.c:832 target_alloc_working_area(): allocating new working area
Debug:   373 25172 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000004
Debug:   374 25172 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000005
Debug:   375 25172 armv4_5.c:527 armv4_5_run_algorithm_inner(): Running algorithm
Debug:   376 25172 arm7tdmi.c:500 arm7tdmi_write_xpsr_im8(): xpsr_im: d3, rot: 0, spsr: 0
Debug:   377 25187 arm7tdmi.c:500 arm7tdmi_write_xpsr_im8(): xpsr_im: d7, rot: 0, spsr: 0
Debug:   378 25187 arm7tdmi.c:500 arm7tdmi_write_xpsr_im8(): xpsr_im: d3, rot: 0, spsr: 0
Debug:   379 25187 arm7tdmi.c:500 arm7tdmi_write_xpsr_im8(): xpsr_im: d7, rot: 0, spsr: 0
Debug:   380 25187 arm7tdmi.c:500 arm7tdmi_write_xpsr_im8(): xpsr_im: d3, rot: 0, spsr: 0
Debug:   381 25187 arm7tdmi.c:500 arm7tdmi_write_xpsr_im8(): xpsr_im: d7, rot: 0, spsr: 0
Debug:   382 25187 target.c:981 target_write_buffer(): writing buffer of 24 byte at 0x40000008
Debug:   383 25187 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000004
Debug:   384 25187 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000005
Debug:   385 25203 target.c:981 target_write_buffer(): writing buffer of 12 byte at 0x40000020
Debug:   386 25203 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000004
Debug:   387 25203 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000005
Debug:   388 25203 armv4_5.c:594 armv4_5_run_algorithm_inner(): setting core_mode: 0x13
Debug:   389 25203 embeddedice.c:401 embeddedice_write_reg(): 12: 0x00000000
Debug:   390 25203 embeddedice.c:401 embeddedice_write_reg(): 20: 0x00000000
Debug:   391 25203 embeddedice.c:401 embeddedice_write_reg(): 8: 0x40000004
Debug:   392 25203 embeddedice.c:401 embeddedice_write_reg(): 9: 0x00000003
Debug:   393 25203 embeddedice.c:401 embeddedice_write_reg(): 11: 0xffffffff
Debug:   394 25203 embeddedice.c:401 embeddedice_write_reg(): 13: 0x000000f7
Debug:   395 25203 embeddedice.c:401 embeddedice_write_reg(): 12: 0x00000100
Debug:   396 25203 breakpoints.c:93 breakpoint_add(): added hardware breakpoint at 0x40000004 of length 0x00000004
Debug:   397 25203 arm7_9_common.c:1535 arm7_9_resume(): -
Debug:   398 25203 embeddedice.c:401 embeddedice_write_reg(): 8: 0x40000004
Debug:   399 25203 embeddedice.c:401 embeddedice_write_reg(): 9: 0x00000003
Debug:   400 25203 embeddedice.c:401 embeddedice_write_reg(): 11: 0xffffffff
Debug:   401 25203 embeddedice.c:401 embeddedice_write_reg(): 13: 0x000000f7
Debug:   402 25203 embeddedice.c:401 embeddedice_write_reg(): 12: 0x00000100
Debug:   403 25203 arm7_9_common.c:1353 arm7_9_restore_context(): -
Debug:   404 25203 arm7_9_common.c:1372 arm7_9_restore_context(): examining User mode
Debug:   405 25203 arm7_9_common.c:1386 arm7_9_restore_context(): examining dirty reg: r0
Debug:   406 25203 arm7_9_common.c:1386 arm7_9_restore_context(): examining dirty reg: r1
Debug:   407 25203 arm7_9_common.c:1386 arm7_9_restore_context(): examining dirty reg: r2
Debug:   408 25203 arm7_9_common.c:1386 arm7_9_restore_context(): examining dirty reg: r3
Debug:   409 25203 arm7_9_common.c:1386 arm7_9_restore_context(): examining dirty reg: r4
Debug:   410 25203 arm7_9_common.c:1386 arm7_9_restore_context(): examining dirty reg: r5
Debug:   411 25203 arm7_9_common.c:1386 arm7_9_restore_context(): examining dirty reg: r6
Debug:   412 25203 arm7_9_common.c:1386 arm7_9_restore_context(): examining dirty reg: r12
Debug:   413 25203 arm7_9_common.c:1386 arm7_9_restore_context(): examining dirty reg: pc
Debug:   414 25203 arm7_9_common.c:1386 arm7_9_restore_context(): examining dirty reg: cpsr
Debug:   415 25203 arm7_9_common.c:1434 arm7_9_restore_context(): writing register 0 of mode User with value 0x40000008
Debug:   416 25203 arm7_9_common.c:1434 arm7_9_restore_context(): writing register 1 of mode User with value 0x40000020
Debug:   417 25203 arm7_9_common.c:1434 arm7_9_restore_context(): writing register 2 of mode User with value 0x00000023
Debug:   418 25203 arm7_9_common.c:1434 arm7_9_restore_context(): writing register 3 of mode User with value 0x0aaa0848
Debug:   419 25203 arm7_9_common.c:1434 arm7_9_restore_context(): writing register 4 of mode User with value 0x00000000
Debug:   420 25203 arm7_9_common.c:1434 arm7_9_restore_context(): writing register 5 of mode User with value 0xe01fc040
Debug:   421 25203 arm7_9_common.c:1434 arm7_9_restore_context(): writing register 6 of mode User with value 0x4c23a692
Debug:   422 25203 arm7_9_common.c:1434 arm7_9_restore_context(): writing register 12 of mode User with value 0x7ffffff1
Debug:   423 25203 arm7_9_common.c:1372 arm7_9_restore_context(): examining FIQ mode
Debug:   424 25203 arm7_9_common.c:1386 arm7_9_restore_context(): examining dirty reg: pc
Debug:   425 25203 arm7_9_common.c:1372 arm7_9_restore_context(): examining IRQ mode
Debug:   426 25203 arm7_9_common.c:1386 arm7_9_restore_context(): examining dirty reg: pc
Debug:   427 25203 arm7_9_common.c:1372 arm7_9_restore_context(): examining Supervisor mode
Debug:   428 25203 arm7_9_common.c:1386 arm7_9_restore_context(): examining dirty reg: r13_svc
Debug:   429 25203 arm7_9_common.c:1393 arm7_9_restore_context(): require mode change
Debug:   430 25203 arm7_9_common.c:1386 arm7_9_restore_context(): examining dirty reg: lr_svc
Debug:   431 25203 arm7_9_common.c:1393 arm7_9_restore_context(): require mode change
Debug:   432 25203 arm7_9_common.c:1386 arm7_9_restore_context(): examining dirty reg: pc
Debug:   433 25203 arm7tdmi.c:500 arm7tdmi_write_xpsr_im8(): xpsr_im: d3, rot: 0, spsr: 0
Debug:   434 25203 arm7_9_common.c:1434 arm7_9_restore_context(): writing register 13 of mode Supervisor with value 0x400000ac
Debug:   435 25203 arm7_9_common.c:1434 arm7_9_restore_context(): writing register 14 of mode Supervisor with value 0x40000004
Debug:   436 25203 arm7_9_common.c:1372 arm7_9_restore_context(): examining Abort mode
Debug:   437 25203 arm7_9_common.c:1386 arm7_9_restore_context(): examining dirty reg: pc
Debug:   438 25203 arm7_9_common.c:1372 arm7_9_restore_context(): examining Undefined mode
Debug:   439 25203 arm7_9_common.c:1386 arm7_9_restore_context(): examining dirty reg: pc
Debug:   440 25203 arm7_9_common.c:1467 arm7_9_restore_context(): writing cpsr with value 0x200000d3
Debug:   441 25203 arm7tdmi.c:469 arm7tdmi_write_xpsr(): xpsr: 200000d3, spsr: 0
Debug:   442 25203 arm7_9_common.c:1474 arm7_9_restore_context(): writing PC with value 0x40000000
Debug:   443 25203 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000004
Error:   444 25203 ft2232.c:177 ft2232_write(): FT_Write returned: 4
Error:   445 25203 ft2232.c:412 ft2232_send_and_recv(): couldn't write MPSSE commands to FT2232
Debug:   446 25219 armv4_5.c:527 armv4_5_run_algorithm_inner(): Running algorithm
Debug:   447 25219 target.c:981 target_write_buffer(): writing buffer of 24 byte at 0x40000008
Debug:   448 25219 embeddedice.c:401 embeddedice_write_reg(): 0: 0x00000004
Warning: 449 25219 jtag.c:1217 jtag_check_value(): value captured during scan didn't pass the requested check: captured: 0x0f check_value: 0x01 check_mask: 0x0f
Warning: 450 25219 jtag.c:1177 jtag_read_buffer(): in_handler reported a failed check
Warning: 451 25219 lpc2000.c:461 lpc2000_erase(): lpc2000 erase sectors returned 15645168
Error:   452 25219 flash.c:124 flash_driver_erase(): failed erasing sectors 0 to 0 (-902)
Debug:   453 25219 command.c:407 run_command(): Command failed with error code -902
User:    454 25219 command.c:607 openocd_jim_vfprintf(): Runtime error, file "?", line 1:
User:    455 25219 command.c:607 openocd_jim_vfprintf():     
User:    456 25219 command.c:607 openocd_jim_vfprintf(): In procedure 'mt_flash_bin' called at file "command.c", line 436
User:    457 25219 command.c:607 openocd_jim_vfprintf(): In procedure 'flash' called at file ".\oocd_cfg\lpc2124.cfg", line 62
User:    458 25219 command.c:607 openocd_jim_vfprintf(): In procedure 'unknown' called at file "?", line 1
Debug:   459 39187 telnet_server.c:406 telnet_input(): unhandled nonprintable: 03

I have found an FAQ that has a similar error message except for reading instead of writing. It relates to a USB power supply issue or other usb error:

http://openfacts.berlios.de/index-en.ph … penOCD_FAQ

so i bought a usb hub and it actually seems to have helped me flash the code at least but still it is not very stable and still get the errors. :roll: