spanion flash program error

Hi, we have a problem writing to our flash ( Spansion’s S29GL256 ) using the AT91SAM9261 with a ARM926EJ-S core. We’re using the Olimex ARM-USB-OCD with OpenOCD.

We use the following configuration file:

#daemon configuration
telnet_port 4444
gdb_port 3333

#interface
interface ft2232
ft2232_layout "olimex-jtag"
ft2232_vid_pid 0x15ba 0x0003
#jtag_speed 1
#jtag_speed 0
jtag_speed 2000

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

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

#target configuration
daemon_startup reset
#target <type> <endianess> <reset mode>
target arm926ejs little reset_halt 0 arm926ejs
working_area 0 0x200000 0x4000 backup
run_and_halt_time 0 5000

[driver_options ...]
flash bank cfi 0x10000000 0x1000000 2 2 0

We get the following error:

> flash probe 0
flash 'cfi' found at 0x10000000
> flash erase_sector 0 0 127
erased sectors 0 through 127 on flash bank 0 in 796s 851013us
> flash write_binary 0 /u-boot.img 0 
failed writing file /u-boot.img to flash bank 0 at offset 0x00000000
flash program error
wrote  393216 byte from file /u-boot.img to flash bank 0 at offset 0x00000000 in 314s 352411us (1.221559 kb/s)

Is the Spansion S29GL256 not supported? Any other idea? Any help appreciated.

Many thanks in advance, Stefan

Hopefully you’ve figured this out by now, but it looks like you’re trying to write to address 0 when your flash is mapped to x10000000. If you try:

flash write_binary 0 /u-boot.img 0x10000000

it should work for you.