Error while accessing iMote2 flash using OpenOCD

Hi,

I am trying to access the flash in my iMote2.

I am using a Olimex JTAG ARM-Tiny-USB interface with openocd in Ubuntu.

When I start the openocd, it gives the following error,

Open On-Chip Debugger 1.0 (2009-11-20-12:42) svn:516

$URL: http://svn.berlios.de/svnroot/repos/ope … /openocd.c $

Info: jtag.c:1329 jtag_examine_chain(): JTAG device found: 0x79265013 (Manufacturer: 0x009, Part: 0x9265, Version: 0x7)

Warning: jtag.c:1157 jtag_check_value(): value captured during scan didn’t pass the requested check: captured: 0x00 check_value: 0x02 check_mask: 0x07

Warning: jtag.c:1117 jtag_read_buffer(): in_handler reported a failed check

Error: xscale.c:804 xscale_write_dcsr(): JTAG error while writing DCSR

But I am able to telnet to localhost 4444 and I am able to get the flash info etc (flash erase_check, flash protect_check, flash info & all works fine!!!).

But when I tried to erase a sector/write into any erased sector, it gave the following error,

flash erase_sector 0 243 243

status register: 0xfe

Block Lock-Bit Detected, Operation Abort

Program suspended

Low Programming Voltage Detected, Operation Aborted

Program Error / Error in Setting Lock-Bit

Error in Block Erasure or Clear Lock-Bits

Block Erase Suspended

couldn’t erase block 243 of flash bank at base 0x0

failed erasing sectors 243 to 243 (-902)

Can Anybody tell me what could go wrong here ?

I am attaching the config file which I used for openocd. Please have a look.

Also, is there any version of JMMFlash which works with USB interface ?

Please advise …

Thanks in advance

Jithin Jose

The openocd config file i used is

telnet_port     3333
gdb_port        4444

#interface
interface ft2232
ft2232_layout olimex-jtag
ft2232_vid_pid 0x15BA 0x0004
ft2232_device_desc "Olimex OpenOCD JTAG TINY"
ft2232_latency 10
jtag_speed 0
#jtag_khz 17000 kHz
#jtag_khz 0 kHz
# set jtag_nsrst_delay to the delay introduced by your reset circuit
# the rest of the needed delays are built into the openocd program jtag_nsrst_delay 1000
# set the jtag_ntrst_delay to the delay introduced by a reset circuit
# the rest of the needed delays are built into the openocd program
jtag_ntrst_delay 0

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

#jtag scan chain
#format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
jtag_device 7 0x1 0x7f 0x7e

#target configuration
daemon_startup reset

target xscale little reset_halt 0 pxa27x

# maps to PXA internal RAM.  If you are using a PXA255
# you must initialize SDRAM or leave this option off
working_area 0 0x5c000000 0x10000 nobackup

run_and_halt_time 0 30

#flash bank <driver> <base> <size> <chip_width> <bus_width>
# works for StrataFlash on PXA271
flash bank cfi 0x00000000 0x2000000 2 2 0

flash auto_erase on

The OpenOCD log file with debug info can be found at

http://www.cse.ohio-state.edu/~jose/public/logfile.txt

Please help me … !!!

Thanks in advance

Jithin Jose

C’mon - you’re using r516 while SVN was succeeded by GIT around r3000… Your version is prehistoric… Compile / Get yourself a more recent version first.

4/3!!

Thanks for replying, Freddie.

I tried with the latest version. But I am getting some new errors this time!

For flash commands it gives the error, “Target not halted”

and for halt command, it gives the error, “Target not examined yet”.

While starting the openocd, I got a lot of errors,

Error: 96 5 command.c:278 register_command(): command 'xscale' is already registered in '<global>' context
Error: 97 5 command.c:278 register_command(): command 'debug_handler' is already registered in 'xscale' context
Error: 98 5 command.c:278 register_command(): command 'cache_clean_address' is already registered in 'xscale' context
Error: 99 5 command.c:278 register_command(): command 'cache_info' is already registered in 'xscale' context
Error: 100 5 command.c:278 register_command(): command 'mmu' is already registered in 'xscale' context
Error: 101 5 command.c:278 register_command(): command 'icache' is already registered in 'xscale' context
Error: 102 5 command.c:278 register_command(): command 'dcache' is already registered in 'xscale' context
Error: 103 5 command.c:278 register_command(): command 'vector_catch' is already registered in 'xscale' context
Error: 104 5 command.c:278 register_command(): command 'vector_table' is already registered in 'xscale' context
Error: 105 5 command.c:278 register_command(): command 'trace_buffer' is already registered in 'xscale' context
Error: 106 5 command.c:278 register_command(): command 'dump_trace' is already registered in 'xscale' context
Error: 107 6 command.c:278 register_command(): command 'analyze_trace' is already registered in 'xscale' context
Error: 108 6 command.c:278 register_command(): command 'trace_image' is already registered in 'xscale' context
Error: 109 6 command.c:278 register_command(): command 'cp15' is already registered in 'xscale' context
Error: 110 6 command.c:278 register_command(): command 'arm' is already registered in '<global>' context
Error: 111 6 command.c:278 register_command(): command 'reg' is already registered in 'arm' context
Error: 112 6 command.c:278 register_command(): command 'core_state' is already registered in 'arm' context
Error: 113 6 command.c:278 register_command(): command 'disassemble' is already registered in 'arm' context
Error: 119 6 target.c:822 target_init(): type 'xscale' is missing write_phys_memory
Error: 120 6 target.c:828 target_init(): type 'xscale' is missing read_phys_memory
Error: 121 6 target.c:822 target_init(): type 'xscale' is missing write_phys_memory
Error: 122 6 target.c:828 target_init(): type 'xscale' is missing read_phys_memory
Error: 147 686 core.c:954 jtag_examine_chain_display(): JTAG tap: pxa270.cpu  expected 1 of 2: 0x49265013 (mfg: 0x009, part: 0x9265, ver: 0x4)
Error: 148 687 core.c:954 jtag_examine_chain_display(): JTAG tap: pxa270.cpu  expected 2 of 2: 0x79265013 (mfg: 0x009, part: 0x9265, ver: 0x7)
Error: 149 687 core.c:1431 jtag_init_inner(): Trying to use configured scan chain anyway...
Error: 152 688 core.c:1265 jtag_validate_ircapture(): pxa270.cpu: IR capture error; saw 0x7f not 0x01
Error: 172 1222 core.c:954 jtag_examine_chain_display(): JTAG tap: pxa270.cpu  expected 1 of 2: 0x49265013 (mfg: 0x009, part: 0x9265, ver: 0x4)
Error: 173 1223 core.c:954 jtag_examine_chain_display(): JTAG tap: pxa270.cpu  expected 2 of 2: 0x79265013 (mfg: 0x009, part: 0x9265, ver: 0x7)
Error: 174 1223 core.c:1431 jtag_init_inner(): Trying to use configured scan chain anyway...

The config files i use are the ones which come with the installation, arm-usb-ocd.cfg (http://www.cse.ohio-state.edu/~jose/pub … sb-ocd.cfg)(I had to modify the description and ID in this), crossbow_tech_imote2.cfghttp://www.cse.ohio-state.edu/~jose/pub … imote2.cfg, pxa270.cfg http://www.cse.ohio-state.edu/~jose/public/pxa270.cfg.

I am attaching the debug log file also … http://www.cse.ohio-state.edu/~jose/public/logfile.log

Please help !!!

  1. Try a stable release - like 0.3.1 (0.3.0 is broken - don’t touch it). This way you’ll get rid of those “command_register” errors - that’s some new stuff they’re working on right now

  2. The connection to imote doesn’t seem to work well - the returned value (0xff) is completely wrong, and I cannot help you much here. Maybe try adding a jtag_khz option somewhere and adjust the speed? This should be about 1/8 of the core speed after reset and because you don’t have that option anywhere, FT2232 works with a 6MHz default clock (the core should run with at least 50MHz after reset). Maybe decreasing this to a lower value (1000 - for 1MHz or even less) will help?

4/3!!