By: mifi ( Michael Fischer )
RE: How to use with Amontec JTAGkey? [ reply ]  
2006-Mar-21 20:01
Hello,

if you want to use the new Amontec JTAGkey with the OpenOCD on windows, you must use a newer one than 20060213.
The source could be downloaded from the SVN, you must have cygwin installed to compile it.

The interface section of the CFG file must looks like:

#interface
interface ftd2xx
ftd2xx_device_desc "Amontec JTAGkey A"
ftd2xx_layout jtagkey
ftd2xx_vid_pid 0x0403 0xcff8
jtag_speed 2

For use with an STR7xx or LPC2xxx the reset_config must looks like:

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

The target configuration should not include reset_halt or reset_init, here is my setting:

#target <type> <startup mode>
#target arm7tdmi <reset mode> <chainpos> <endianness> <variant>
target arm7tdmi little run_and_halt 0 arm7tdmi-s_r4
run_and_halt_time 0 30

Dominic told me not to use "reset halt" or "reset init" on the gdb line.

All this information does not come from me direct. I have some eMail conversation with Dominic, because
I had the same trouble. I think he is busy, therefore I wrote it here. So all the thanks go to Dominic.

Regards,

Michael



LPC2000 flash writing improved
January 15th, 2006

The LPC2000 flash driver is able to calculate the checksum thats used by the bootloader to identify a valid flash image.

#flash bank lpc2000 base size 0 0 lpc_variant target # cclk calc_checksum
flash bank lpc2000 0x0 0x40000 0 0 lpc2000_v1 0 14765 calc_checksum

When calc_checksum is specified in the LPC2000 flash bank configuration, the flash writing code inserts the correct checksum whenever a write to offset 00 of at least 32 byte (size of the exception vectors) occurs.

flash probe 0
Uses the IAP routines to check the erase state of all flash sectors
flash erase 0 x y
Erases flash blocks x to y using IAP calls
flash info 0
Prints information about the flash bank (block sizes, block starting offsets, erase state)
flash write 0 FILE OFFSET
Writes the binary FILE to the LPC2000 internal flash starting at OFFSET.






By: rekisum ( Heinz Keins )
target_script [ reply ]  
2006-May-30 11:45
Hi,

as I got OpenOCD with STR71X running so far, I now want the maximum comfort!
I would like to flash the controller on start of my debugging session.
I found the example config and script files by Martin Thomas and others.
I tried to adapt them to my STR711, but nothing happens.
I have the target_script entry in my cfg file but I see no reaction of OpenOCD, no success or error messages.
Even debug output doesn't show something like 'file not found'.
I looks like the target_script parameter gets ignored completely?
Regards,
Jrg

      By: drath ( Dominic Rath )
      RE: target_script [ reply ]  
      2006-May-30 18:53
      (already replied by email, this is for the records)

      You have to change the target line from "run_and_halt" to "run_and_init". Only with "run_and_init" (or "reset_init", but this doesn't work for LPCs) is the 'reset' event delivered, and the configured script file executed.

      Regards,

      Dominic

            By: rekisum ( Heinz Keins )
            RE: target_script [ reply ]  
            2006-May-31 10:59
            Yes,

            with run_and_init the file gets flashed. :-)

            Thanks,

            Jrg



From Dominc Rath's Web-Site:


Updates
In the meantime, mostly bugs in the OpenOCD code have been fixed. These are, among others:
- flash erase_check would crash for CFI flashes when there was no working_area specified.
- register valid/dirty tracking was buggy. The result was an occasional register xxx dirty but no valid data error.
- The INTDIS signal wasnt high during debug execution (i.e. flash writing, DCC downloads, ). This would corrupt memory or flash writing, if a system was already up and running with interrupts enabled.
- The working area reserved for LPC2000 flash operations was too small, and could corrupt flash writing.

Added/changed functionality includes, among others:
- Access to ETM registers. This is for a new project of mine, and isnt currently usable (another reason for branching)
- DCC downloads have been disabled by default. Use the arm7_9 dcc_downloads  command to enable them. DCC drastically increases download performance (host->target), but requires a working area that must NOT be written to, and is potentially unsafe on targets running at a very low speed, like the 32kHz startup clock of some Atmel ARMs.
- Fast memory writes have been disabled by default. Use the arm7_9 fast_writes  command to enable them. Fast writes drastically increase download performance, especially when using a USB JTAG interface (Amontec JTAGkey, Olimex ARM-USB-OCD, homebrew).

There might be an issue left with LPC2000 systems:
If the CCLK frequency specified in the config file lists the crystal frequency, but your startup code enabled the PLL already, flash writing might fail. This has been reported only once so far, and a possible solution might be to manually turn the PLL off before starting any flash operations:

mwb 0xe01fc080 0x0
mwb 0xe01fc08c 0xaa
mwb 0xe01fc08c 0x55



By: drath ( Dominic Rath )
RE: downloading to flash [ reply ]  
2006-May-27 09:58
I guess you've specified
"daemon_startup reset"
and
"target arm7tdmi little run_and_halt 0 arm7tdmi-s_r4"
in your config file. The first line tells OpenOCD to reset all targets when it starts up, while the "target" line tells it what to do when that reset happens: "run_and_halt" means let the target run for some time (to allow the bootloader to do its job), and then halt the target.
If you type "resume" at the telnet command line, the target should continue operation.

Regards,

Dominic






