OpenOCD not full support AT91SAM7SE serial's Internal Flash?

OpenOCD is an excellent tool, but I found some issues:

OpenOCD may not fully support Flash the ATMEL AT91SAM7SE series of on-chip Flash. I try write the data to AT91SAM7SE512’s Internal Flash, But actually system not work properly.

I change the other software (H-Flasher, from http://www.jtag.com) to write Internal flash, it works ! So I thank all hardware is ok.

And then I try to use the H-Flasher re-read AT91SAM7SE512’s Internal Flash, found some data that reading from AT91SAM7SE512 is different. When writing 20K bytes of data, will found about 10 bytes is mistakes.

OS: Windows XP & Windows 2003 Server

JTAG Interface: Wiggler

OOCD ver: v141, v423

hello

r592 should support the internal flash of at91sam7se512.

you can download binaries from:

www.yagarto.de

regards

gerhard

OpenOCD works fine for the AT91SAM7SE512. I know because I’m using one in a project and programming it with Yagarto/OpenOCD. Maybe you need a new version of OpenOCD. Are you sure there isn’t a problem with your config files?

And to fix some of those download errors, you could try lowering the JTAG speed. The only downside is that it would take a little longer to download the code.

OpenOCD r592 not support Wiggler Interface anymore.

I try r520.


at91sam7_pp.cfg

#
# at91sam7_pp.cfg
# For ATMEL AT91sam7 Series Flash Programming with wiggler JTAGKey
#

#define our ports
telnet_port 4444
gdb_port 3333

# tell gdb our flash memory map
# and enable flash programming
gdb_memory_map enable
gdb_flash_program enable

#commands specific to the wiggler JTAGKey
interface parport
parport_port 0x378
parport_cable wiggler
jtag_speed 0
jtag_nsrst_delay 200
jtag_ntrst_delay 200

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

#jtag scan chain
#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
jtag_device 4 0x1 0xf 0xe

#daemon_startup <'attach'!''reset'>
daemon_startup reset

#target <type> <endianess> <reset_mode> <jtag#> [variant]
target arm7tdmi little run_and_init 0 arm7tdmi

#run_and_halt_time <target#> <time_in_ms>
run_and_halt_time 0 30

# commands below are specific to AT91sam7 Flash Programming
# ---------------------------------------------------------
#target_script specifies the flash programming script file
target_script 0 reset at91sam7_pp.script

#working_area <target#> <address> <size> 'backup' , or 
#working_area <target#> <address> <size> 'nobackup'
working_area 0 0x00200000 0x4000 nobackup

#flash bank at91sam7 0 0 0 0 <target#>
flash bank at91sam7 0 0 0 0 0

# For more information about the configuration files, take a look at:
# http://openfacts.berlios.de/index-en.phtml?title=Open+On-Chip+Debugger

at91sam7_pp.script:

mww 0xffffff60 0x00310200	# set 2 wait states on Flash banks0 for operation at 48 MHz
mww 0xffffff70 0x00310200	# set 2 wait states on Flash banks1 for operation at 48 MHz

sleep 10

wait_halt

flash erase_sector 0 0 31
flash write_bank 0 c:/tmp/oocdfsh.bin 0x0

reset run
shutdown

Execute:

D:\Program Files\openocd-r520\bin>openocd-pp.exe -d3 -f at91sam7_pp.cfg
Open On-Chip Debugger (2008-03-22 12:00 CET) svn: r520
URL: http://svn.berlios.de/svnroot/repos/openocd/trunk/
Debug:   5 0 command.c:375 command_run_line(): script at91sam7_pp.cfg
Debug:   6 0 configuration.c:87 open_file_from_path(): opened at91sam7_pp.cfg
Debug:   7 0 command.c:375 command_run_line(): telnet_port 4444
Debug:   8 0 command.c:375 command_run_line(): gdb_port 3333
Debug:   9 0 command.c:375 command_run_line(): gdb_memory_map enable
Debug:   10 0 command.c:375 command_run_line(): gdb_flash_program enable
Debug:   11 0 command.c:375 command_run_line(): interface parport
Debug:   12 0 command.c:375 command_run_line(): parport_port 0x378
Debug:   13 0 command.c:375 command_run_line(): parport_cable wiggler
Debug:   14 0 command.c:375 command_run_line(): jtag_speed 0
Debug:   15 0 command.c:375 command_run_line(): jtag_nsrst_delay 200
Debug:   16 0 command.c:375 command_run_line(): jtag_ntrst_delay 200
Debug:   17 0 command.c:375 command_run_line(): reset_config srst_only srst_pull
s_trst
Debug:   18 0 command.c:375 command_run_line(): jtag_device 4 0x1 0xf 0xe
Debug:   19 0 command.c:375 command_run_line(): daemon_startup reset
Debug:   20 0 command.c:375 command_run_line(): target arm7tdmi little run_and_i
nit 0 arm7tdmi
Debug:   21 0 command.c:375 command_run_line(): run_and_halt_time 0 30
Debug:   22 0 command.c:375 command_run_line(): target_script 0 reset at91sam7_p
p.script
Debug:   23 0 command.c:375 command_run_line(): working_area 0 0x00200000 0x4000
 nobackup
Debug:   24 0 command.c:375 command_run_line(): flash bank at91sam7 0 0 0 0 0
Debug:   25 0 jtag.c:1466 jtag_init(): -
Debug:   26 0 parport.c:401 parport_init(): requesting privileges for parallel p
ort 0x378...
Debug:   27 0 parport.c:411 parport_init(): ...privileges granted
Debug:   28 0 parport.c:234 parport_reset(): trst: 0, srst: 0
Debug:   29 16 jtag.c:305 jtag_call_event_callbacks(): jtag event: JTAG controll
er reset(tms or TRST)
Debug:   30 16 jtag.c:1235 jtag_reset_callback(): -
Debug:   31 16 jtag.c:305 jtag_call_event_callbacks(): jtag event: JTAG controll
er reset(tms or TRST)
Debug:   32 16 jtag.c:1235 jtag_reset_callback(): -
Info:    33 16 jtag.c:1329 jtag_examine_chain(): JTAG device found: 0x3f0f0f0f (
Manufacturer: 0x787, Part: 0xf0f0, Version: 0x3)
Debug:   34 16 jtag.c:305 jtag_call_event_callbacks(): jtag event: JTAG controll
er reset(tms or TRST)
Debug:   35 16 jtag.c:1235 jtag_reset_callback(): -
Debug:   36 16 openocd.c:114 main(): jtag init complete
Debug:   37 16 openocd.c:118 main(): target init complete
Debug:   38 16 openocd.c:122 main(): flash init complete
Debug:   39 16 openocd.c:126 main(): NAND init complete
Debug:   40 16 openocd.c:130 main(): pld init complete
Debug:   41 16 gdb_server.c:1965 gdb_init(): gdb service for target arm7tdmi at
port 3333
Debug:   42 16 arm7_9_common.c:740 arm7_9_assert_reset(): target->state: unknown

Debug:   43 16 jtag.c:937 jtag_add_reset(): SRST line asserted
Debug:   44 16 jtag.c:948 jtag_add_reset(): JTAG reset with tms instead of TRST
Debug:   45 16 jtag.c:305 jtag_call_event_callbacks(): jtag event: JTAG controll
er reset(tms or TRST)
Debug:   46 16 jtag.c:1235 jtag_reset_callback(): -
Debug:   47 16 jtag.c:305 jtag_call_event_callbacks(): jtag event: JTAG controll
er reset(tms or TRST)
Debug:   48 16 jtag.c:1235 jtag_reset_callback(): -
Warning: 49 32 jtag.c:902 jtag_add_reset(): requested reset would assert trst
Debug:   50 32 jtag.c:937 jtag_add_reset(): SRST line asserted
Debug:   51 32 jtag.c:948 jtag_add_reset(): JTAG reset with tms instead of TRST
Debug:   52 32 jtag.c:305 jtag_call_event_callbacks(): jtag event: JTAG controll
er reset(tms or TRST)
Debug:   53 32 jtag.c:1235 jtag_reset_callback(): -
Debug:   54 32 jtag.c:305 jtag_call_event_callbacks(): jtag event: JTAG controll
er reset(tms or TRST)
Debug:   55 32 jtag.c:1235 jtag_reset_callback(): -
Debug:   56 32 parport.c:234 parport_reset(): trst: 0, srst: 1
Debug:   57 47 parport.c:234 parport_reset(): trst: 0, srst: 1
Debug:   58 110 arm7_9_common.c:802 arm7_9_deassert_reset(): target->state: rese
t
Debug:   59 110 jtag.c:941 jtag_add_reset(): SRST line released
Debug:   60 110 jtag.c:969 jtag_add_reset(): Now in TAP_TLR - Test-Logic-Reset(e
ither due to TRST line asserted or tms reset)
Debug:   61 110 parport.c:234 parport_reset(): trst: 0, srst: 0
Debug:   62 516 arm7_9_common.c:968 arm7_9_halt(): target->state: running
Debug:   63 516 embeddedice.c:376 embeddedice_write_reg(): 9: 0xffffffff
Debug:   64 516 embeddedice.c:376 embeddedice_write_reg(): 11: 0xffffffff
Debug:   65 516 embeddedice.c:376 embeddedice_write_reg(): 12: 0x00000100
Debug:   66 516 embeddedice.c:376 embeddedice_write_reg(): 13: 0x000000f7
Debug:   67 516 arm7_9_common.c:700 arm7_9_poll(): DBGACK set, dbg_state->value:
 0x9
Debug:   68 516 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000005
Debug:   69 516 embeddedice.c:376 embeddedice_write_reg(): 12: 0x00000000
Debug:   70 516 arm7_9_common.c:1086 arm7_9_debug_entry(): target entered debug
from ARM state
Debug:   71 532 arm7_9_common.c:1118 arm7_9_debug_entry(): target entered debug
state in Supervisor mode
Debug:   72 532 arm7_9_common.c:1147 arm7_9_debug_entry(): r0: 0x10000000
Debug:   73 532 arm7_9_common.c:1147 arm7_9_debug_entry(): r1: 0x00000800
Debug:   74 532 arm7_9_common.c:1147 arm7_9_debug_entry(): r2: 0x00000800
Debug:   75 532 arm7_9_common.c:1147 arm7_9_debug_entry(): r3: 0x00000800
Debug:   76 532 arm7_9_common.c:1147 arm7_9_debug_entry(): r4: 0x00000000
Debug:   77 547 arm7_9_common.c:1147 arm7_9_debug_entry(): r5: 0x00000100
Debug:   78 547 arm7_9_common.c:1147 arm7_9_debug_entry(): r6: 0x2d4a03a5
Debug:   79 547 arm7_9_common.c:1147 arm7_9_debug_entry(): r7: 0xd61000e1
Debug:   80 547 arm7_9_common.c:1147 arm7_9_debug_entry(): r8: 0x47cec6bc
Debug:   81 547 arm7_9_common.c:1147 arm7_9_debug_entry(): r9: 0xf72bfa59
Debug:   82 547 arm7_9_common.c:1147 arm7_9_debug_entry(): r10: 0x47daeeb2
Debug:   83 547 arm7_9_common.c:1147 arm7_9_debug_entry(): r11: 0xff3dfa2f
Debug:   84 547 arm7_9_common.c:1147 arm7_9_debug_entry(): r12: 0x0001d4c0
Debug:   85 547 arm7_9_common.c:1147 arm7_9_debug_entry(): r13: 0x00200ff0
Debug:   86 547 arm7_9_common.c:1147 arm7_9_debug_entry(): r14: 0x00200418
Debug:   87 547 arm7_9_common.c:1147 arm7_9_debug_entry(): r15: 0x0000b0c4
Debug:   88 563 arm7_9_common.c:1153 arm7_9_debug_entry(): entered debug state a
t PC 0xb0c4
Debug:   89 563 target.c:566 target_call_event_callbacks(): target event 0
Debug:   90 563 configuration.c:87 open_file_from_path(): opened at91sam7_pp.scr
ipt
Info:    91 563 target.c:240 target_init_handler(): executing reset script 'at91
sam7_pp.script'
Debug:   92 563 command.c:375 command_run_line(): mww 0xffffff60 0x00310200
Debug:   93 563 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000004
Debug:   94 578 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000005
Debug:   95 578 command.c:375 command_run_line(): mww 0xffffff70 0x00310200
Debug:   96 578 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000004
Debug:   97 578 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000005
Debug:   98 578 command.c:375 command_run_line(): sleep 10
Debug:   99 594 command.c:375 command_run_line(): wait_halt
Debug:   100 594 arm7_9_common.c:700 arm7_9_poll(): DBGACK set, dbg_state->value
: 0x9
Debug:   101 594 command.c:375 command_run_line(): flash erase_sector 0 0 31
Debug:   102 594 arm7_9_common.c:1821 arm7_9_read_memory(): address: 0xfffff240,
 size: 0x00000004, count: 0x00000001
Debug:   103 703 target.c:960 target_read_u32(): address: 0xfffff240, value: 0x2
72a0a40
Debug:   104 703 at91sam7.c:366 at91sam7_read_part_info(): nvptyp: 0x002, arch:
0x0072
Debug:   105 703 arm7_9_common.c:1821 arm7_9_read_memory(): address: 0xfffffc24,
 size: 0x00000004, count: 0x00000001
Debug:   106 813 target.c:960 target_read_u32(): address: 0xfffffc24, value: 0x0
0000000
Debug:   107 813 arm7_9_common.c:1821 arm7_9_read_memory(): address: 0xfffffc30,
 size: 0x00000004, count: 0x00000001
Debug:   108 813 target.c:960 target_read_u32(): address: 0xfffffc30, value: 0x0
0000000
Debug:   109 813 arm7_9_common.c:1821 arm7_9_read_memory(): address: 0xfffffc2c,
 size: 0x00000004, count: 0x00000001
Debug:   110 938 target.c:960 target_read_u32(): address: 0xfffffc2c, value: 0x0
0003f00
Debug:   111 938 arm7_9_common.c:1821 arm7_9_read_memory(): address: 0xffffff68,
 size: 0x00000004, count: 0x00000001
Debug:   112 1047 target.c:960 target_read_u32(): address: 0xffffff68, value: 0x
00000401
Debug:   113 1047 arm7_9_common.c:1821 arm7_9_read_memory(): address: 0xffffff68
, size: 0x00000004, count: 0x00000001
Debug:   114 1157 target.c:960 target_read_u32(): address: 0xffffff68, value: 0x
00000401
Warning: 115 1157 at91sam7.c:646 at91sam7_erase(): Sector numbers based on lockb
it count, probably a deprecated script
Debug:   116 1157 arm7_9_common.c:1821 arm7_9_read_memory(): address: 0xfffffc24
, size: 0x00000004, count: 0x00000001
Debug:   117 1266 target.c:960 target_read_u32(): address: 0xfffffc24, value: 0x
00000000
Debug:   118 1266 arm7_9_common.c:1821 arm7_9_read_memory(): address: 0xfffffc30
, size: 0x00000004, count: 0x00000001
Debug:   119 1375 target.c:960 target_read_u32(): address: 0xfffffc30, value: 0x
00000000
Debug:   120 1375 arm7_9_common.c:1821 arm7_9_read_memory(): address: 0xfffffc2c
, size: 0x00000004, count: 0x00000001
Debug:   121 1485 target.c:960 target_read_u32(): address: 0xfffffc2c, value: 0x
00003f00
Debug:   122 1485 at91sam7.c:246 at91sam7_set_flash_mode(): fmcn[0]: 0
Debug:   123 1485 target.c:1013 target_write_u32(): address: 0xffffff60, value:
0x00000000
Debug:   124 1485 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000004
Debug:   125 1485 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000005
Debug:   126 1500 target.c:1013 target_write_u32(): address: 0xffffff64, value:
0x5a000008
Debug:   127 1500 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000004
Debug:   128 1500 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000005
Debug:   129 1500 at91sam7.c:290 at91sam7_flash_command(): Flash command: 0x5a00
0008, flashplane: 0, pagenumber:0
Debug:   130 1500 arm7_9_common.c:1821 arm7_9_read_memory(): address: 0xffffff68
, size: 0x00000004, count: 0x00000001
Debug:   131 1516 target.c:960 target_read_u32(): address: 0xffffff68, value: 0x
00000400
Debug:   132 1516 at91sam7.c:260 at91sam7_wait_status_busy(): status[0]: 0x400
Debug:   133 1532 arm7_9_common.c:1821 arm7_9_read_memory(): address: 0xffffff68
, size: 0x00000004, count: 0x00000001
Debug:   134 1532 target.c:960 target_read_u32(): address: 0xffffff68, value: 0x
00000401
Debug:   135 1532 at91sam7.c:264 at91sam7_wait_status_busy(): status[0]: 0x401
Debug:   136 1532 at91sam7.c:246 at91sam7_set_flash_mode(): fmcn[1]: 0
Debug:   137 1532 target.c:1013 target_write_u32(): address: 0xffffff70, value:
0x00000000
Debug:   138 1532 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000004
Debug:   139 1547 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000005
Debug:   140 1547 target.c:1013 target_write_u32(): address: 0xffffff74, value:
0x5a000008
Debug:   141 1547 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000004
Debug:   142 1547 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000005
Debug:   143 1563 at91sam7.c:290 at91sam7_flash_command(): Flash command: 0x5a00
0008, flashplane: 1, pagenumber:0
Debug:   144 1563 arm7_9_common.c:1821 arm7_9_read_memory(): address: 0xffffff78
, size: 0x00000004, count: 0x00000001
Debug:   145 1563 target.c:960 target_read_u32(): address: 0xffffff78, value: 0x
00000000
Debug:   146 1563 at91sam7.c:260 at91sam7_wait_status_busy(): status[1]: 0x0
Debug:   147 1578 arm7_9_common.c:1821 arm7_9_read_memory(): address: 0xffffff78
, size: 0x00000004, count: 0x00000001
Debug:   148 1578 target.c:960 target_read_u32(): address: 0xffffff78, value: 0x
00000001
Debug:   149 1578 at91sam7.c:264 at91sam7_wait_status_busy(): status[1]: 0x1
Info:    150 1578 options.c:50 configuration_output_handler(): erased sectors 0
through 31 on flash bank 0 in 0.421875s
Debug:   151 1578 command.c:375 command_run_line(): flash write_bank 0 c:/tmp/oo
cdfsh.bin 0x0
Debug:   152 1594 configuration.c:87 open_file_from_path(): opened c:/tmp/oocdfs
h.bin
Debug:   153 1594 at91sam7.c:751 at91sam7_write(): first_page: 0, last_page: 8,
count 2048
Debug:   154 1594 arm7_9_common.c:1821 arm7_9_read_memory(): address: 0xfffffc24
, size: 0x00000004, count: 0x00000001
Debug:   155 1594 target.c:960 target_read_u32(): address: 0xfffffc24, value: 0x
00000000
Debug:   156 1610 arm7_9_common.c:1821 arm7_9_read_memory(): address: 0xfffffc30
, size: 0x00000004, count: 0x00000001
Debug:   157 1610 target.c:960 target_read_u32(): address: 0xfffffc30, value: 0x
00000000
Debug:   158 1610 arm7_9_common.c:1821 arm7_9_read_memory(): address: 0xfffffc2c
, size: 0x00000004, count: 0x00000001
Debug:   159 1610 target.c:960 target_read_u32(): address: 0xfffffc2c, value: 0x
00003f00
Debug:   160 1625 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000004
Debug:   161 2172 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000005
Debug:   162 2172 at91sam7.c:246 at91sam7_set_flash_mode(): fmcn[0]: 0
Debug:   163 2172 target.c:1013 target_write_u32(): address: 0xffffff60, value:
0x00000000
Debug:   164 2172 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000004
Debug:   165 2172 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000005
Debug:   166 2172 target.c:1013 target_write_u32(): address: 0xffffff64, value:
0x5a000001
Debug:   167 2188 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000004
Debug:   168 2188 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000005
Debug:   169 2188 at91sam7.c:290 at91sam7_flash_command(): Flash command: 0x5a00
0001, flashplane: 0, pagenumber:0
Debug:   170 2188 arm7_9_common.c:1821 arm7_9_read_memory(): address: 0xffffff68
, size: 0x00000004, count: 0x00000001
Debug:   171 2203 target.c:960 target_read_u32(): address: 0xffffff68, value: 0x
00000401
Debug:   172 2203 at91sam7.c:264 at91sam7_wait_status_busy(): status[0]: 0x401
Debug:   173 2203 at91sam7.c:776 at91sam7_write(): Write flash plane:0 page numb
er:0
Debug:   174 2203 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000004
Debug:   175 2750 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000005
Debug:   176 2750 target.c:1013 target_write_u32(): address: 0xffffff64, value:
0x5a000101
Debug:   177 2750 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000004
Debug:   178 2750 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000005
Debug:   179 2750 at91sam7.c:290 at91sam7_flash_command(): Flash command: 0x5a00
0101, flashplane: 0, pagenumber:1
Debug:   180 2750 arm7_9_common.c:1821 arm7_9_read_memory(): address: 0xffffff68
, size: 0x00000004, count: 0x00000001
Debug:   181 2766 target.c:960 target_read_u32(): address: 0xffffff68, value: 0x
00000401
Debug:   182 2766 at91sam7.c:264 at91sam7_wait_status_busy(): status[0]: 0x401
Debug:   183 2766 at91sam7.c:776 at91sam7_write(): Write flash plane:0 page numb
er:1
Debug:   184 2766 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000004
Debug:   185 3328 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000005
Debug:   186 3328 target.c:1013 target_write_u32(): address: 0xffffff64, value:
0x5a000201
Debug:   187 3328 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000004
Debug:   188 3328 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000005
Debug:   189 3328 at91sam7.c:290 at91sam7_flash_command(): Flash command: 0x5a00
0201, flashplane: 0, pagenumber:2
Debug:   190 3328 arm7_9_common.c:1821 arm7_9_read_memory(): address: 0xffffff68
, size: 0x00000004, count: 0x00000001
Debug:   191 3344 target.c:960 target_read_u32(): address: 0xffffff68, value: 0x
00000401
Debug:   192 3344 at91sam7.c:264 at91sam7_wait_status_busy(): status[0]: 0x401
Debug:   193 3344 at91sam7.c:776 at91sam7_write(): Write flash plane:0 page numb
er:2
Debug:   194 3344 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000004
Debug:   195 3907 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000005
Debug:   196 3907 target.c:1013 target_write_u32(): address: 0xffffff64, value:
0x5a000301
Debug:   197 3907 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000004
Debug:   198 3907 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000005
Debug:   199 3907 at91sam7.c:290 at91sam7_flash_command(): Flash command: 0x5a00
0301, flashplane: 0, pagenumber:3
Debug:   200 3907 arm7_9_common.c:1821 arm7_9_read_memory(): address: 0xffffff68
, size: 0x00000004, count: 0x00000001
Debug:   201 3922 target.c:960 target_read_u32(): address: 0xffffff68, value: 0x
00000401
Debug:   202 3922 at91sam7.c:264 at91sam7_wait_status_busy(): status[0]: 0x401
Debug:   203 3922 at91sam7.c:776 at91sam7_write(): Write flash plane:0 page numb
er:3
Debug:   204 3922 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000004
Debug:   205 4485 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000005
Debug:   206 4485 target.c:1013 target_write_u32(): address: 0xffffff64, value:
0x5a000401
Debug:   207 4485 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000004
Debug:   208 4485 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000005
Debug:   209 4485 at91sam7.c:290 at91sam7_flash_command(): Flash command: 0x5a00
0401, flashplane: 0, pagenumber:4
Debug:   210 4485 arm7_9_common.c:1821 arm7_9_read_memory(): address: 0xffffff68
, size: 0x00000004, count: 0x00000001
Debug:   211 4500 target.c:960 target_read_u32(): address: 0xffffff68, value: 0x
00000401
Debug:   212 4500 at91sam7.c:264 at91sam7_wait_status_busy(): status[0]: 0x401
Debug:   213 4500 at91sam7.c:776 at91sam7_write(): Write flash plane:0 page numb
er:4
Debug:   214 4500 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000004
Debug:   215 5063 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000005
Debug:   216 5063 target.c:1013 target_write_u32(): address: 0xffffff64, value:
0x5a000501
Debug:   217 5063 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000004
Debug:   218 5063 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000005
Debug:   219 5078 at91sam7.c:290 at91sam7_flash_command(): Flash command: 0x5a00
0501, flashplane: 0, pagenumber:5
Debug:   220 5078 arm7_9_common.c:1821 arm7_9_read_memory(): address: 0xffffff68
, size: 0x00000004, count: 0x00000001
Debug:   221 5078 target.c:960 target_read_u32(): address: 0xffffff68, value: 0x
00000401
Debug:   222 5078 at91sam7.c:264 at91sam7_wait_status_busy(): status[0]: 0x401
Debug:   223 5078 at91sam7.c:776 at91sam7_write(): Write flash plane:0 page numb
er:5
Debug:   224 5094 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000004
Debug:   225 5641 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000005
Debug:   226 5641 target.c:1013 target_write_u32(): address: 0xffffff64, value:
0x5a000601
Debug:   227 5641 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000004
Debug:   228 5641 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000005
Debug:   229 5641 at91sam7.c:290 at91sam7_flash_command(): Flash command: 0x5a00
0601, flashplane: 0, pagenumber:6
Debug:   230 5657 arm7_9_common.c:1821 arm7_9_read_memory(): address: 0xffffff68
, size: 0x00000004, count: 0x00000001
Debug:   231 5657 target.c:960 target_read_u32(): address: 0xffffff68, value: 0x
00000401
Debug:   232 5657 at91sam7.c:264 at91sam7_wait_status_busy(): status[0]: 0x401
Debug:   233 5657 at91sam7.c:776 at91sam7_write(): Write flash plane:0 page numb
er:6
Debug:   234 5657 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000004
Debug:   235 6219 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000005
Debug:   236 6219 target.c:1013 target_write_u32(): address: 0xffffff64, value:
0x5a000701
Debug:   237 6219 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000004
Debug:   238 6219 embeddedice.c:376 embeddedice_write_reg(): 0: 0x00000005
Debug:   239 6219 at91sam7.c:290 at91sam7_flash_command(): Flash command: 0x5a00
0701, flashplane: 0, pagenumber:7
Debug:   240 6219 arm7_9_common.c:1821 arm7_9_read_memory(): address: 0xffffff68
, size: 0x00000004, count: 0x00000001
Debug:   241 6235 target.c:960 target_read_u32(): address: 0xffffff68, value: 0x
00000401
Debug:   242 6235 at91sam7.c:264 at91sam7_wait_status_busy(): status[0]: 0x401
Debug:   243 6235 at91sam7.c:776 at91sam7_write(): Write flash plane:0 page numb
er:7
Debug:   244 6235 command.c:375 command_run_line(): reset run
Debug:   245 6235 target.c:1640 handle_reset_command(): -
Debug:   246 6250 arm7_9_common.c:740 arm7_9_assert_reset(): target->state: halt
ed
Debug:   247 6250 jtag.c:937 jtag_add_reset(): SRST line asserted
Debug:   248 6250 jtag.c:948 jtag_add_reset(): JTAG reset with tms instead of TR
ST
Debug:   249 6250 jtag.c:305 jtag_call_event_callbacks(): jtag event: JTAG contr
oller reset(tms or TRST)
Debug:   250 6250 jtag.c:1235 jtag_reset_callback(): -
Debug:   251 6250 jtag.c:305 jtag_call_event_callbacks(): jtag event: JTAG contr
oller reset(tms or TRST)
Debug:   252 6250 jtag.c:1235 jtag_reset_callback(): -
Warning: 253 6250 jtag.c:902 jtag_add_reset(): requested reset would assert trst

Debug:   254 6266 jtag.c:937 jtag_add_reset(): SRST line asserted
Debug:   255 6266 jtag.c:948 jtag_add_reset(): JTAG reset with tms instead of TR
ST
Debug:   256 6266 jtag.c:305 jtag_call_event_callbacks(): jtag event: JTAG contr
oller reset(tms or TRST)
Debug:   257 6266 jtag.c:1235 jtag_reset_callback(): -
Debug:   258 6266 jtag.c:305 jtag_call_event_callbacks(): jtag event: JTAG contr
oller reset(tms or TRST)
Debug:   259 6266 jtag.c:1235 jtag_reset_callback(): -
Debug:   260 6266 parport.c:234 parport_reset(): trst: 0, srst: 1
Debug:   261 6297 parport.c:234 parport_reset(): trst: 0, srst: 1
Debug:   262 6360 arm7_9_common.c:802 arm7_9_deassert_reset(): target->state: re
set
Debug:   263 6360 jtag.c:941 jtag_add_reset(): SRST line released
Debug:   264 6360 jtag.c:969 jtag_add_reset(): Now in TAP_TLR - Test-Logic-Reset
(either due to TRST line asserted or tms reset)
Debug:   265 6360 parport.c:234 parport_reset(): trst: 0, srst: 0
Debug:   266 6766 command.c:375 command_run_line(): shutdown
Warning: 267 6766 arm7_9_common.c:724 arm7_9_poll(): DBGACK set, but the target
did not end up in the halted stated 1
User:    269 7266 target.c:365 target_process_reset(): Timed out waiting for res
et
Debug:   270 7266 openocd.c:142 main(): target init reset complete

D:\Program Files\openocd-r520\bin>

Use FC.EXE to compare source file (oocdfsh.bin) and target file (rr.bin read from SAM7SE512 with H-Flasher)

C:\tmp>fc /b oocdfsh.bin rr.bin
Comparing files oocdfsh.bin and RR.BIN
00000188: 40 00
000001E8: E0 C0
00000208: C6 C0
0000020B: C3 43
00000210: 0D 0C
00000233: DD CD
00000273: F6 F4
00000288: 16 14
000002D3: D3 13
000002D7: 1A 12
000002EA: 33 23
000002F0: 1A 02
000002F3: 6A 42
000002F7: D4 C4
0000030B: 9B 99
00000313: 50 10
00000317: 9D 1D
0000038B: F7 D7
000003AB: 56 54
0000040B: 1C 14
00000410: 44 40
00000428: D3 D0
0000042B: 39 38
0000044A: AB 2B
0000044B: 66 64
0000046B: FB DB
00000472: CD 4D
00000493: 6A 62
00000497: 34 24
000004A8: 31 11
000004C8: 66 64
0000050B: 39 31
00000553: 68 48
00000597: FF F7
000005E8: A4 84
0000060B: AA 2A
00000613: 62 60
00000648: 93 83
00000653: EF AF
0000066A: 2D 0D
00000676: EB 6B
0000068B: 7A 5A
000006F3: 9B 99
00000748: 68 60
00000750: 90 10
00000753: C8 88
0000076B: 6E 6A
000007B0: 6D 65
000007EB: 26 06

alex.forencich:
OpenOCD works fine for the AT91SAM7SE512. I know because I’m using one in a project and programming it with Yagarto/OpenOCD. Maybe you need a new version of OpenOCD. Are you sure there isn’t a problem with your config files?

And to fix some of those download errors, you could try lowering the JTAG speed. The only downside is that it would take a little longer to download the code.

I had try to lowering the JTAG speed, but not different.

I use oscillograph to check the pins, it’s ok.

Would you try re-read data from your AT91SAM7SE512 and use ‘FC.EXE /b’ to compare data? I have another board (AT91SAM7S64), and it work fine with OpenOCD.

I found not all data error with AT91SAM7SE512, but some data error.

:shock: