USBProg JTAG Problem!

Hi Folks,

I am trying to program my STR711 with the USBPROG-JTAG Adapter (http://www.embedded-projects.net/index.php?page_id=175), but there are a lot of Errors (logfile):

Error:   str7x.c:197 str7x_flash_bank_command(): unknown STR7x variant: '0'
Error:   flash.c:180 handle_flash_bank_command(): 'str7x' driver rejected flash bank at 0x40000000
Info:    usbprog.c:222 usbprog_init(): USB JTAG Interface ready!
Error:   jtag.c:1253 jtag_examine_chain(): JTAG communication failure, check connection, JTAG interface, target power etc.
Error:   jtag.c:1440 jtag_init(): trying to validate configured JTAG chain anyway...
Error:   jtag.c:1346 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x00
Error:   jtag.c:1346 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x00
Error:   jtag.c:1346 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x00
Error:   jtag.c:1346 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x00
Error:   jtag.c:1346 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x00
Error:   jtag.c:1346 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x00
Error:   jtag.c:1448 jtag_init(): Could not validate JTAG chain, exit

I’ve created a config file like it is descriped here:

http://sunge.awardspace.com/arm-getting … arted.html

Together with some lines from here:

http://gandalf.arubi.uni-kl.de/avr_proj … ml#str7int

It looks like that:

(Configfile)

#daemon configuration
telnet_port 4444
gdb_port 3333

#interface
interface usbprog
jtag_speed 2

#use combined on interfaces or targets that can't set TRST/SRST separately
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 configuration
daemon_startup reset

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

# flash-configuration STR710:
# internal flash at address 0x40000000 size 256kB (0x40000)
# internal ram   at address 0x20000000 size  64kB (0x10000)
# a 16kB working area inside RAM:
working_area 0 0x2000C000 0x4000 nobackup
#flash bank <driver> <base> <size> <chip_width> <bus_width>
flash bank str7x 0x40000000 0x00040000 0 0 STR71x 0

target_script 0 reset openocd_str711_flash.script

(Script)

arm7_9 dcc_downloads enable
wait_halt
sleep 10
poll
flash probe 0

# STR710 erase all banks:
#flash erase 0 0 9
# STR710 erase first 4 banks (32kB)
flash erase 0 0 4

flash write 0 main.bin 0x0
reset run
sleep 10
shutdown

What is the Problem with that? I am absolutely new in the ARM-World, but have done a lot with AVR-µC before. Please give me a hint, what’s wrong! Thank you!

The basic problem is the JTAG communication failure.

Error: jtag.c:1253 jtag_examine_chain(): JTAG communication failure, check connection, JTAG interface, target power etc.

This is only related to the hardware setup and the JTAG settings in the config file.

The script file looks OK but your system never gets there as the JTAG must work properly before any other parts are invoked.

So check the jumper settings on the target board, the usb connections.

On the OpenOCD config side the first thing to try is to lower the jtag speed.

Change

jtag_speed 2

to

jtag_speed 20

Regards,

Magnus

Hi,

here are two pictures of my JTAG-Connection:

[(USBProg-JTAG-Adapter with 5V to 3,3V Levelshifter)

[(Connection on PCB)

There are no JTAG-Jumpers - there should be a Connection between USBProg and STR711-Board.

Maybe I do anything wrong using OpenOCD.

  1. I copy main.bin, oocd_flash.cfg and openocd_str711_flash.script into my Project Folder.

  2. I open the Prompt.

  3. I go to the Project Folder

  4. I type: openocd-usbprog -f oocd_flash.cfg -l openocd.log

Is that correct? There are a lot of alerts:

http://munske.de/Temp/Error.jpg](http://munske.de/Temp/�JTAG.jpg)](http://munske.de/Temp/JTAG-Adapter.png)

Hi - hope all of you had a merry christmas!

I have some news: a wire was missing - USBProg-GND and µC-GND was not connected, but I still have the same alerts.

After solving this problem I have checked all the JTAG- and VCC/GND connections - they should work.

In Addition to my last questions, I have two further ones:

  1. How can I correct this errors:
Error:   str7x.c:197 str7x_flash_bank_command(): unknown STR7x variant: '0'
Error:   flash.c:180 handle_flash_bank_command(): 'str7x' driver rejected flash bank at 0x40000000
  1. Is there any “Testpin” at the STR711xx µC to check if it is ever running!?

The variant and the target number has switched place ( to conform to general target practice in OpenOCD) so in the configuration file you should try

(if your OpenOCD rev is 189 or later):

flash bank str7x 0x40000000 0x00040000 0 0 0 STR71x

Regards, and a merry Xmas

Magnus

Yes this works! Now I only have the following errors:

Info:    usbprog.c:222 usbprog_init(): USB JTAG Interface ready!
Error:   jtag.c:1253 jtag_examine_chain(): JTAG communication failure, check connection, JTAG interface, target power etc.
Error:   jtag.c:1440 jtag_init(): trying to validate configured JTAG chain anyway...
Error:   jtag.c:1346 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x3f
Error:   jtag.c:1346 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x3f
Error:   jtag.c:1346 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x3f
Error:   jtag.c:1346 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x3f
Error:   jtag.c:1346 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x3f
Error:   jtag.c:1346 jtag_validate_chain(): Error validating JTAG scan chain, IR mismatch, scan returned 0x3f
Error:   jtag.c:1448 jtag_init(): Could not validate JTAG chain, exit

How can I check my Hardware to find the reason for this?! Have you taken a look at my Pictures to check my connection - maybe thats the reason for the problems?

Perhaps your JTAG connection was wrong.

I once have the same problem, please exchange the connection of

pin1 and pin 9 of SV1 on your Level-Shifter-Adapter and try again.

This is my post:

viewtopic.php?p=36683

Now I have checked the Pin-swap, but there are still the same errors!

Because the Hardware is developed by myself I don’t know if it works proper! Is there any way to see if the device is alive?

You can program another firmware of USBprog, i.e. AVRISP MKII Clone, and try it, to verify

your hardware.

@sunge: Sorry, the USBProg (version 3) is running as MKII-Clone! I mean the ARM-Mainboard!

I see. The problem maybe occur in the connection between the USBprog and

your JTAG adapter board.

Please ensure the PD0 (NOT PB4) of ATMEGA32 is connected to JTAG’s NRST pin.

according to USBprog’s schematics (V3.1), PD0 is linked to PIN 2 of JP3.

So please check whether PIN 3 of SV1 on your JTAG adapter is connected to

PD0 of ATMEGA32(Maybe PIN2 of JP3 on your USBprog).

Here is my JTAG connection:

http://sunge.awardspace.com/arm-getting … penocd.png

Ok, now I’ve changed TDI and TDO as you said before and connected NRSTIN to PD0.

Same errors!

Then I’ve cut NJTRST, but there is no difference - is this pin necessary? I can’t see it in your schematic.

It’s strange: if the JTAG is connected and I switch on the Powersupply of the Board, NJTRST is low! When I disconnect and reconnect USBProg by pulling the cable it’s high ^^

With Disconnected JTAG it’s always high

(Take a look at [here)

Maybe I should really try to use a simple wiggler!](http://munske.de/Temp/�JTAG.jpg)

I’ve tested a simple Wiggler today and it works! Now I can access the STR711 via telnet.

TODO: Why does USBProg not work?

I suggest you to post this problem on USBprog’s support forum:

http://forum.embedded-projects.net/

Yeah - half a year later I found the solution: It was a wrong firmware!

Look at here: http://forum.embedded-projects.net/viewtopic.php?id=233

…but there a new problems :frowning:

Hi All,

I am a noob as far as ARM and JTAG is concerned. I have done a bit of uP Prog on ATMega128. I am just starting to learn ARM prog using my newly acquired ARM-USB-OCD JTAG and LPC-MT-2138 board.

I am following the Olimex instructions for setting up my ARM-USB-OCD JTAG.

I have installed the Olimex-GCCFD-240907.exe which installed openOCD, Eclipse and the JTAG-USB drivers on my Win-XP PC.

I am 100% sure that the drivers are properly installed cause I can see the device under the Windows Device Manager without the exclamation mark.

At this stage I have connected my LPC-MT-2138 board to the JTAG cable and powered on the LPC-MT-2138. I can see a dark first line on the LCD on my target board (LPC-MT-2138). Also checked voltage levels at various points on the target board at these seem to be OK.

So I followed the setup on the following web-page for setting up the ARM-USB-OCD and see if I have gone wrong somewhere.

Now I am trying to test if the installation steps I followed are correct.

http://psas.pdx.edu/OlimexLPC2148Setup/

Section—> Setup on Windows 2K/XP

When I come to the stage where we run the LPC config command

which is " openocd-ftd2xx.exe -fconfigs/lpc2xxx_armusbocd.cfg

I get the following output. And the LED goes from green to RED+GREEN. I have to disconnect the USB cable to get the LED again in Green state.

C:\Program Files\openocd-2007re204\bin>openocd-ftd2xx.exe -fconfigs/lpc2xxx_armu

sbocd.cfg

Info: openocd.c:93 main(): Open On-Chip Debugger (2007-09-05 09:00 CEST)

Error: jtag.c:1253 jtag_examine_chain(): JTAG communication failure, check con

nection, JTAG interface, target power etc.

Error: jtag.c:1440 jtag_init(): trying to validate configured JTAG chain anywa

y…

Error: jtag.c:1346 jtag_validate_chain(): Error validating JTAG scan chain, IR

mismatch, scan returned 0x3f

Error: jtag.c:1346 jtag_validate_chain(): Error validating JTAG scan chain, IR

mismatch, scan returned 0x3f

Error: jtag.c:1346 jtag_validate_chain(): Error validating JTAG scan chain, IR

mismatch, scan returned 0x3f

Error: jtag.c:1346 jtag_validate_chain(): Error validating JTAG scan chain, IR

mismatch, scan returned 0x3f

Error: jtag.c:1346 jtag_validate_chain(): Error validating JTAG scan chain, IR

mismatch, scan returned 0x3f

Error: jtag.c:1346 jtag_validate_chain(): Error validating JTAG scan chain, IR

mismatch, scan returned 0x3f

Error: jtag.c:1448 jtag_init(): Could not validate JTAG chain, exit

Can anyone please help me with this.

Many Thnx!