Whats going on in openOCD SVN 977

recently i compiled openOCD on my ubuntu system.

it seams, that many commands have changed or deleted.

i just set up a config file by reading the whole page on the wiki

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

which is NOT up to date to the current SVN 977.

following errors occurred on startup of openocd:

# daemon_startup <'attach'|'reset'>
# ERROR:  Unknown command: daemon_startup_reset
#daemon_startup reset

# target <type> <endianess> <reset_mode> <jtag#> <variant>
# arm7tdmi options: variant is obsolete>
# IMPORTANT: reset_mode and jtag# exchanged because of oocd ERROR:
# expected integer but got "reset_init"
target arm7tdmi little 0 reset_init

# run_and_halt_time <target#> <time_in_ms>
# ERROR: unknown command run_and_halt_time_0_100
#run_and_halt_time 0 100

i am confused about that.

and what is the tcl-port for?

i added it because of a warning.

EDIT:

arm7_9 sw_bkpts enable and

arm7_9 force_hw_bkpts enable

also generate an error…

Some commands are changed and also script file is now diferently processed using Jim TcL. Take a look here:

http://svn.berlios.de/svnroot/repos/ope … OMMAND.txt

I known is painful to re-adapt your script, but let’s hope now it will be better. The main problem is the lack of documentation and some helpful working examples…

I spent one day to understand and re-adapt a script file … and I’m not sure everything is working correctly

Regards,

Atlas

@atlas: Could you please upload your new script-file as an example for us - I have the same problem like griffin27.

I hope this will help you, so here it is:

#daemon configuration
telnet_port 4444
gdb_port 3333

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

#interface
interface ft2232
ft2232_device_desc "Amontec JTAGkey A"
ft2232_layout jtagkey
ft2232_vid_pid 0x0403 0xcff8
jtag_khz 100

#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

#target create CMDNAME TYPE [configure-options]
target create AT91SAM7X arm7tdmi -endian little -chain-position 0 

AT91SAM7X configure -event old-pre_reset { jtag_khz 100 }

AT91SAM7X configure -event  old-post_reset {

	jtag_khz 6000
	
	# disable watchdog
	mww 0xfffffd44 0x00008000	

	# enable user reset
	mww 0xfffffd08 0xa5000001

	# CKGR_MOR : enable the main oscillator
	mww 0xfffffc20 0x00000002	

	... and others configs here ...
}

# Or if you want to use a script file:
#AT91SAM7X configure -event halted "script sam7x_reset.script"

flash bank at91sam7 0 0 0 0 0

working_area 0 0x00200000 0x4000 nobackup

# speed up memory downloads
#arm7_9 dbgrq enable
#arm7_9 fast_memory_access enable
#arm7_9 dcc_downloads enable

This is what I succeed to understand after reading some readme files from source code

Thank you very much, this might help me, but I have a few questions to the source:

jtag_khz 100 

I use the USBProg - where do I find this value?

AT91SAM7X configure -event old-pre_reset { jtag_khz 100 }

AT91SAM7X configure -event  old-post_reset {

   jtag_khz 6000
   
   # disable watchdog
   mww 0xfffffd44 0x00008000   

   # enable user reset
   mww 0xfffffd08 0xa5000001

   # CKGR_MOR : enable the main oscillator
   mww 0xfffffc20 0x00000002   

   ... and others configs here ...
}

What does this mean? In the past I used a script-file for flashing my STR71x µC.

Isn’t there any instruction manual - I can remember that there had been an *.pdf in older versions but now I use OOCD under Linux and haven’t found it yet.

jtag_khz represent the speed openocd communicate with your microcontroller and if USBProg is supported by openocd then openocd will be able to handle this.

The best way to understand some of the new openocd commands is to search in source code… I known is not easy but this will help you to understand a lot of things…

All the documentation for openocd is now in the openocd.texi

A pdf can be built by executing:

make pdf

Also included in the docs is a section on old and new commands.

Cheers

Spen

@ntfreak: Thank you - that works!

@atlas: USBProg is supported, but OOCD always prints

“Error: Translation from khz to jtag_speed not implemented”

@everybody:

Today I switched to version “Open On-Chip Debugger 1.0 (2008-10-09-19:39) svn:1037” hoping to solve some problems but that doesn’t really help (no change in error-messages).

This is what OOCD prints out after running the command: “openocd -f str711-usbprog.cfg”

jtag_speed: 12
usb_set_debug: Setting debugging level to 10 (on)
usb_os_init: Found USB VFS at /dev/bus/usb
usb_os_find_busses: Found 002
usb_os_find_busses: Found 001
usb_os_find_devices: Found 001 on 002
usb_os_find_devices: Found 003 on 001
skipped 1 class/vendor specific interface descriptors
usb_os_find_devices: Found 002 on 001
skipping descriptor 0x0
skipped 1 class/vendor specific endpoint descriptors
Descriptor data still left
usb_os_find_devices: Found 001 on 001
error obtaining child information: Inappropriate ioctl for device
error obtaining child information: Inappropriate ioctl for device
Info:   USB JTAG Interface ready!
Info:   JTAG device found: 0x3f0f0f0f (Manufacturer: 0x787, Part: 0xf0f0, Version: 0x3)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Error:  number of discovered devices in JTAG chain (20) doesn't match configuration (1)
Error:  check the config file and ensure proper JTAG communication (connections, speed, ...)
Error:  trying to validate configured JTAG chain anyway...
Warning:value captured during scan didn't pass the requested check: captured: 0x00 check_value: 0x01 check_mask: 0x0f
Warning:in_handler reported a failed check

This is my config-file:

telnet_port 4444

gdb_port 3333
tcl_port 6666

#interface
interface usbprog

#start slow, speed up after reset
jtag_speed 12

jtag_nsrst_delay 500

jtag_ntrst_delay 500

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

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

#target <type> <startup mode>
#target arm7tdmi <reset mode> <chainpos> <endianness> <variant>
target arm7tdmi little 0 arm7tdmi
[new_target_name] configure -event old-pre_reset { jtag_khz 10 }
[new_target_name] configure -event old-post_reset { jtag_khz 6000 }
[new_target_name] configure -event old-gdb_program_config { script event/str710_program.script }

working_area 0 0x2000C000 0x4000 nobackup

#flash bank str7x <base> <size> 0 0 <target#> <variant>
flash bank str7x 0x40000000 0x00040000 0 0 0 STR71x
flash bank str7x 0x400C0000 0x00004000 0 0 0 STR71x

Whats going wrong here? Why does it always print out “number of discovered devices in JTAG chain (…) doesn’t match configuration”? Does anyone have/had the same problem? My operatingsystem is Ubuntu 8.04.

Ok, now I have written a working config- and scriptfile for the parport wiggler. If USBProg also works, I will post the files, but at the moment the main problem of USBProg seems to be following:

jtag_speed: 20
usb_set_debug: Setting debugging level to 10 (on)
usb_os_init: Found USB VFS at /dev/bus/usb
usb_os_find_busses: Found 002
usb_os_find_busses: Found 001
usb_os_find_devices: Found 001 on 002
usb_os_find_devices: Found 006 on 001
skipping descriptor 0x0
skipped 1 class/vendor specific endpoint descriptors
Descriptor data still left
usb_os_find_devices: Found 002 on 001
skipped 1 class/vendor specific interface descriptors
usb_os_find_devices: Found 001 on 001
error obtaining child information: Inappropriate ioctl for device
error obtaining child information: Inappropriate ioctl for device
Info:   USB JTAG Interface ready!
Info:   JTAG device found: 0x3f0f0f0f (Manufacturer: 0x787, Part: 0xf0f0, Version: 0x3)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Info:   JTAG device found: 0xffffffff (Manufacturer: 0x7ff, Part: 0xffff, Version: 0xf)
Error:  number of discovered devices in JTAG chain (20) doesn't match configuration (1)

Does anyone has a solution for that?

Hi,

The same config file works well with Amontec JTAGkey.

If your USBprog reply by: “JTAG device found: 0x3f0f0f0f”, it is coming from the firmware of the USBprog itself and not from the OpenOCD ! The JTAG controller in the USBprog do not sample TDO in the right way.

Why not using the JTAGkey or JTAGkey-Tiny from Amontec, they really work better?

Regards,

Laurent

http://www.amontec.com

Hi - I would like to work with the “Amontec JTAGkey-Tiny”, but I am a student and the shipping to germany is very expensive!

Hi Bennm,

Yes, the shipping cost is a bit expensive but all Amontec parcels are registered and can be tracked. The track service has a cost, as the DHL FEDEX or UPS, but our ECOMONY International Post service is very cheaper than any of DHL FEDEX or UPS services.

Amontec Team is thinking to allow unregistered parcels, for keeping the shipping cost as low as possible. But we have to modify our shipping privacy and our online eShop → in case where the parcel is lost by the International Post service! What happens if the parcel is lost but was unregistered … That is the big question!

Before changing our shipping privacy, we have a lot of other higher priority as finalizing our new JTAGkey-Pro version :wink: :

Amontec JTAGkey-Pro

  • USB 2.0 Hi-speed (High speed) 480Mbps

  • up to 48Mhz TCK JTAG frequency (continu stream!)

  • RTCK support (sampled at 96Mhz)

  • fully compatible with FTDI MPSSE command

  • including Amontec JTAG Accelerator core

  • including larger Stream FIFO management

  • including Amontec SLC techno (Scan Loop Check) feature

  • keeping the price low as the JTAGkey !

Laurent

http://www.amontec.com