I also have problems programming a CFI flash device. I am using a self made board with STR720, Intel 28F640J3 flash and 32 MB SDRAM. Downloading and debugging programs into the 16 KByte internal RAM of the STR720 works well. But I have to program larger programs into flash. This works in principal but is dramatically slow.
If I don’t use a workspace programming succeeds but it lasts 630 s to program 78 KByte. It is not very funny to wait more than 10 minutes to find out that the program is still buggy.
When I define a workspace either in internal RAM or in the SDRAM after initialization it by a script, OpenOCD fails at the first byte. A status register value of 0xff is reported.
This is the end of the logfile, after 32 KByte has been transferred into the workspace at 0xA0000000:
Debug: embeddedice.c:253 embeddedice_write_reg(): 5: 0xe3550007
Debug: embeddedice.c:253 embeddedice_write_reg(): 5: 0xe0866004
Debug: embeddedice.c:253 embeddedice_write_reg(): 5: 0xe5828000
Debug: embeddedice.c:253 embeddedice_write_reg(): 5: 0xe5824004
Debug: embeddedice.c:253 embeddedice_write_reg(): 5: 0xe58d6680
Debug: embeddedice.c:253 embeddedice_write_reg(): 5: 0xe58d567c
Debug: embeddedice.c:253 embeddedice_write_reg(): 5: 0xd282c008
Debug: embeddedice.c:253 embeddedice_write_reg(): 5: 0xdafffbd3
Debug: arm7_9_common.c:838 arm7_9_halt(): target->state: debug_running
Debug: embeddedice.c:253 embeddedice_write_reg(): 9: 0xffffffff
Debug: embeddedice.c:253 embeddedice_write_reg(): 11: 0xffffffff
Debug: embeddedice.c:253 embeddedice_write_reg(): 12: 0x00000100
Debug: embeddedice.c:253 embeddedice_write_reg(): 13: 0x000000f7
Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug: ft2232.c:915 ft2232_execute_queue(): ftd2xx buffer size reached, sending queued commands (first_unsent: c30020, cmd: d9ffe4)
Debug: arm7_9_common.c:620 arm7_9_poll(): DBGACK set, dbg_state->value: 0x9
Debug: embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000005
Debug: embeddedice.c:253 embeddedice_write_reg(): 12: 0x00000000
Debug: arm7_9_common.c:944 arm7_9_debug_entry(): target entered debug from ARM state
Debug: arm7_9_common.c:976 arm7_9_debug_entry(): target entered debug state in Undefined mode
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r0: 0xa0008000
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r1: 0x10000000
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r2: 0x00004000
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r3: 0x00220040
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r4: 0x003d8010
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r5: 0x00000308
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r6: 0xff4bff9f
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r7: 0xbb7ffb37
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r8: 0xfaffdfff
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r9: 0xbf7fffdf
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r10: 0xee7fef77
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r11: 0x60003f18
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r12: 0x60003f1c
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r13: 0x60003ffc
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r14: 0x00080028
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r15: 0xa0008000
Debug: arm7_9_common.c:1011 arm7_9_debug_entry(): entered debug state at PC 0xa0008000
Debug: target.c:442 target_call_event_callbacks(): target event 3
Debug: arm7tdmi.c:506 arm7tdmi_write_xpsr_im8(): xpsr_im: d3, rot: 0, spsr: 0
Debug: arm7tdmi.c:506 arm7tdmi_write_xpsr_im8(): xpsr_im: db, rot: 0, spsr: 0
Debug: arm7tdmi.c:506 arm7tdmi_write_xpsr_im8(): xpsr_im: d3, rot: 0, spsr: 0
Debug: arm7tdmi.c:506 arm7tdmi_write_xpsr_im8(): xpsr_im: db, rot: 0, spsr: 0
Debug: arm7tdmi.c:506 arm7tdmi_write_xpsr_im8(): xpsr_im: d3, rot: 0, spsr: 0
Debug: arm7tdmi.c:506 arm7tdmi_write_xpsr_im8(): xpsr_im: db, rot: 0, spsr: 0
Debug: armv4_5.c:563 armv4_5_run_algorithm(): setting core_mode: 0x13
Debug: breakpoints.c:93 breakpoint_add(): added hardware breakpoint at 0x003d0230 of length 0x00000004
Debug: arm7_9_common.c:1328 arm7_9_resume():
Debug: embeddedice.c:253 embeddedice_write_reg(): 8: 0x003d0230
Debug: embeddedice.c:253 embeddedice_write_reg(): 9: 0x00000003
Debug: embeddedice.c:253 embeddedice_write_reg(): 11: 0xffffffff
Debug: embeddedice.c:253 embeddedice_write_reg(): 13: 0x000000f7
Debug: embeddedice.c:253 embeddedice_write_reg(): 12: 0x00000100
Debug: arm7_9_common.c:1127 arm7_9_restore_context():
Debug: arm7_9_common.c:1143 arm7_9_restore_context(): examining User mode
Debug: arm7_9_common.c:1157 arm7_9_restore_context(): examining dirty reg: r0
Debug: arm7_9_common.c:1157 arm7_9_restore_context(): examining dirty reg: r1
Debug: arm7_9_common.c:1157 arm7_9_restore_context(): examining dirty reg: r2
Debug: arm7_9_common.c:1157 arm7_9_restore_context(): examining dirty reg: r3
Debug: arm7_9_common.c:1157 arm7_9_restore_context(): examining dirty reg: r4
Debug: arm7_9_common.c:1157 arm7_9_restore_context(): examining dirty reg: pc
Debug: arm7_9_common.c:1157 arm7_9_restore_context(): examining dirty reg: cpsr
Debug: arm7_9_common.c:1206 arm7_9_restore_context(): writing register 0 of mode User with value 0xa0000000
Debug: arm7_9_common.c:1206 arm7_9_restore_context(): writing register 1 of mode User with value 0x40000000
Debug: arm7_9_common.c:1206 arm7_9_restore_context(): writing register 2 of mode User with value 0x00004000
Debug: arm7_9_common.c:1206 arm7_9_restore_context(): writing register 3 of mode User with value 0x00220040
Debug: arm7_9_common.c:1206 arm7_9_restore_context(): writing register 4 of mode User with value 0x003d0550
Debug: arm7_9_common.c:1143 arm7_9_restore_context(): examining FIQ mode
Debug: arm7_9_common.c:1157 arm7_9_restore_context(): examining dirty reg: pc
Debug: arm7_9_common.c:1143 arm7_9_restore_context(): examining IRQ mode
Debug: arm7_9_common.c:1157 arm7_9_restore_context(): examining dirty reg: pc
Debug: arm7_9_common.c:1143 arm7_9_restore_context(): examining Supervisor mode
Debug: arm7_9_common.c:1157 arm7_9_restore_context(): examining dirty reg: pc
Debug: arm7_9_common.c:1143 arm7_9_restore_context(): examining Abort mode
Debug: arm7_9_common.c:1157 arm7_9_restore_context(): examining dirty reg: pc
Debug: arm7_9_common.c:1143 arm7_9_restore_context(): examining Undefined mode
Debug: arm7_9_common.c:1157 arm7_9_restore_context(): examining dirty reg: pc
Debug: arm7_9_common.c:1239 arm7_9_restore_context(): writing cpsr with value 0x400000d3
Debug: arm7tdmi.c:475 arm7tdmi_write_xpsr(): xpsr: 400000d3, spsr: 0
Debug: arm7_9_common.c:1246 arm7_9_restore_context(): writing PC with value 0x003d0200
Debug: embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000004
Debug: target.c:442 target_call_event_callbacks(): target event 4
Debug: arm7_9_common.c:1431 arm7_9_resume(): target resumed
Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug: arm7_9_common.c:620 arm7_9_poll(): DBGACK set, dbg_state->value: 0x9
Debug: embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000005
Debug: embeddedice.c:253 embeddedice_write_reg(): 9: 0x00000003
Debug: embeddedice.c:253 embeddedice_write_reg(): 11: 0xffffffff
Debug: embeddedice.c:253 embeddedice_write_reg(): 13: 0x000000f7
Debug: embeddedice.c:253 embeddedice_write_reg(): 12: 0x00000100
Debug: arm7_9_common.c:944 arm7_9_debug_entry(): target entered debug from ARM state
Debug: arm7_9_common.c:976 arm7_9_debug_entry(): target entered debug state in Supervisor mode
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r0: 0x40000000
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r1: 0x40000000
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r2: 0x00004000
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r3: 0x00220040
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r4: 0x003d0550
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r5: 0x00000308
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r6: 0xff4bff9f
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r7: 0xbb7ffb37
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r8: 0xfaffdfff
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r9: 0xbf7fffdf
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r10: 0xee7fef77
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r11: 0x60003f18
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r12: 0x60003f1c
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r13: 0x60003f5c
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r14: 0x00055af0
Debug: arm7_9_common.c:1005 arm7_9_debug_entry(): r15: 0x003d0230
Debug: arm7_9_common.c:1011 arm7_9_debug_entry(): entered debug state at PC 0x3d0230
Debug: target.c:442 target_call_event_callbacks(): target event 3
Debug: embeddedice.c:253 embeddedice_write_reg(): 12: 0x00000000
Debug: armv4_5.c:633 armv4_5_run_algorithm(): restoring register r0 with value 0x40000000
Debug: armv4_5.c:633 armv4_5_run_algorithm(): restoring register r1 with value 0x40000000
Debug: armv4_5.c:633 armv4_5_run_algorithm(): restoring register r2 with value 0x00004000
Debug: armv4_5.c:633 armv4_5_run_algorithm(): restoring register r3 with value 0x00220040
Debug: armv4_5.c:633 armv4_5_run_algorithm(): restoring register r4 with value 0x003d0550
Debug: armv4_5.c:633 armv4_5_run_algorithm(): restoring register r5 with value 0x00000308
Debug: armv4_5.c:633 armv4_5_run_algorithm(): restoring register r6 with value 0xff4bff9f
Debug: armv4_5.c:633 armv4_5_run_algorithm(): restoring register r7 with value 0xbb7ffb37
Debug: armv4_5.c:633 armv4_5_run_algorithm(): restoring register r8 with value 0xfaffdfff
Debug: armv4_5.c:633 armv4_5_run_algorithm(): restoring register r9 with value 0xbf7fffdf
Debug: armv4_5.c:633 armv4_5_run_algorithm(): restoring register r10 with value 0xee7fef77
Debug: armv4_5.c:633 armv4_5_run_algorithm(): restoring register r11 with value 0x60003f18
Debug: armv4_5.c:633 armv4_5_run_algorithm(): restoring register r12 with value 0x60003f1c
Debug: armv4_5.c:633 armv4_5_run_algorithm(): restoring register r13_svc with value 0x60003f5c
Debug: armv4_5.c:633 armv4_5_run_algorithm(): restoring register lr_svc with value 0x00055af0
Debug: armv4_5.c:633 armv4_5_run_algorithm(): restoring register pc with value 0x003d0230
Debug: armv4_5.c:633 armv4_5_run_algorithm(): restoring register spsr_svc with value 0x400000d3
Debug: arm7_9_common.c:1676 arm7_9_read_memory(): address: 0x40000000, size: 0x00000002, count: 0x00000001
Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug: cfi.c:210 cfi_intel_wait_status_busy(): status: 0xff
Error: cfi.c:214 cfi_intel_wait_status_busy(): status register: 0xff
Error: cfi.c:216 cfi_intel_wait_status_busy(): Block Lock-Bit Detected, Operation Abort
Error: cfi.c:218 cfi_intel_wait_status_busy(): Program suspended
Error: cfi.c:220 cfi_intel_wait_status_busy(): Low Programming Voltage Detected, Operation Aborted
Error: cfi.c:222 cfi_intel_wait_status_busy(): Program Error / Error in Setting Lock-Bit
Error: cfi.c:224 cfi_intel_wait_status_busy(): Error in Block Erasure or Clear Lock-Bits
Error: cfi.c:226 cfi_intel_wait_status_busy(): Block Erase Suspended
Debug: arm7_9_common.c:1822 arm7_9_write_memory(): address: 0x40000000, size: 0x00000002, count: 0x00000001
Debug: embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000004
Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug: embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000005
Debug: arm7_9_common.c:1822 arm7_9_write_memory(): address: 0x40000000, size: 0x00000002, count: 0x00000001
Debug: embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000004
Debug: embeddedice.c:157 embeddedice_read_reg_w_check(): 1
Debug: embeddedice.c:253 embeddedice_write_reg(): 0: 0x00000005
Debug: target.c:1328 handle_reset_command():
Debug: arm7_9_common.c:656 arm7_9_assert_reset(): target->state: halted
Debug: jtag.c:247 jtag_call_event_callbacks(): jtag event: 0
Debug: jtag.c:1096 jtag_reset_callback():
Debug: jtag.c:247 jtag_call_event_callbacks(): jtag event: 1
Debug: jtag.c:1096 jtag_reset_callback():
Warning: arm7_9_common.c:683 arm7_9_assert_reset(): srst resets test logic, too
Debug: jtag.c:247 jtag_call_event_callbacks(): jtag event: 0
Debug: jtag.c:1096 jtag_reset_callback():
Debug: jtag.c:247 jtag_call_event_callbacks(): jtag event: 1
Debug: jtag.c:1096 jtag_reset_callback():
Debug: ft2232.c:738 olimex_jtag_reset(): trst: 1, srst: 1, high_output: 0x0a, high_direction: 0x0f
Debug: ft2232.c:738 olimex_jtag_reset(): trst: 1, srst: 1, high_output: 0x0a, high_direction: 0x0f
Debug: arm7_9_common.c:722 arm7_9_deassert_reset(): target->state: reset
Debug: jtag.c:247 jtag_call_event_callbacks(): jtag event: 2
Debug: jtag.c:1096 jtag_reset_callback():
Debug: ft2232.c:738 olimex_jtag_reset(): trst: 0, srst: 0, high_output: 0x01, high_direction: 0x0f