Skip to main content
Topic: Unreliable Busblaster v2.5 with Olimex SAM7-P256 under Linux (Read 8395 times) previous topic - next topic

Unreliable Busblaster v2.5 with Olimex SAM7-P256 under Linux

I just bought the busblaster 2.5 as a replacement for the olimex arm-usb-tiny-h. While the arm-usb-tiny-h just works out of the box the buslaster won't see anything most of the time (see output below). The setup is exactly the same as in viewtopic.php?f=37&t=5478

I am actually not sure if this is supposed to work out of the box. Is the busblaster 2.5 in its delivery state compatible to the openocd busblaster.cfg distributed e.g. with a ubuntu 13.04?

The odd thing is that sometimes (~1 out of 10 attempts) certain things seem to work. E.g. in the output below the line
Code: [Select]
Info : JTAG tap: at91sam7s.cpu tap/device found: 0x3f0f0f0f (mfg: 0x787, part: 0xf0f0, ver: 0x3)
tells me that sometimes the jtag transfer does work. But most of the time it doesn't (like a few lines later).

What may be the reason for this unreliability? Sounds like the wiring is correct as otherwise the correct jtag ids would never be returned. It seems there's a timing problem or missing pullups or similar ...

The schematic of the sam7-p256 is available here: https://www.olimex.com/Products/ARM/Atm ... -REV-F.pdf

Till

Code: [Select]
openocd -f interface/busblaster.cfg -f target/at91sam7sx.cfg --command "adapter_khz 10000; init; reset init;  flash protect 0 0 7 off; sleep 1; arm7_9 fast_memory_access enable; flash write_bank 0 firmware.bin 0x0; resume; shutdown"
Open On-Chip Debugger 0.6.1 (2012-12-06-17:21)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.sourceforge.net/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'jtag'
srst_only srst_pulls_trst srst_gates_jtag srst_open_drain
Warn : use 'at91sam7s.cpu' as target identifier, not '0'
adapter speed: 10000 kHz
Info : max TCK change to: 30000 kHz
Info : clock speed 10000 kHz
Info : JTAG tap: at91sam7s.cpu tap/device found: 0x3f0f0f0f (mfg: 0x787, part: 0xf0f0, ver: 0x3)
Warn : Unexpected idcode after end of chain: 32 0xfffffffe
Error: double-check your JTAG setup (interface, speed, missing TAPs, ...)
Error: Trying to use configured scan chain anyway...
Error: at91sam7s.cpu: IR capture error; saw 0x0f not 0x01
Warn : Bypassing JTAG setup events due to errors
Info : Embedded ICE version 0
Error: unknown EmbeddedICE version (comms ctrl: 0x00000000)
Info : at91sam7s.cpu: hardware has 2 breakpoint/watchpoint units
Info : TAP at91sam7s.cpu does not have IDCODE
Warn : JTAG tap: at91sam7s.cpu      UNEXPECTED: 0x00000000 (mfg: 0x000, part: 0x0000, ver: 0x0)
Error: JTAG tap: at91sam7s.cpu  expected 1 of 1: 0x3f0f0f0f (mfg: 0x787, part: 0xf0f0, ver: 0x3)
Warn : Unexpected idcode after end of chain: 1 0xfffffffe
Error: double-check your JTAG setup (interface, speed, missing TAPs, ...)
Error: Trying to use configured scan chain anyway...
Error: at91sam7s.cpu: IR capture error; saw 0x0f not 0x01
Warn : Bypassing JTAG setup events due to errors
Warn : srst pulls trst - can not reset into halted mode. Issuing halt after reset.
Warn : ThumbEE -- incomplete support
target state: halted
target halted in ThumbEE state due to debug-request, current mode: System
cpsr: 0xffffffff pc: 0x3ffffff9
requesting target halt and executing a soft reset
Error: Jazelle state handling is BROKEN!
target state: halted
target halted in Jazelle state due to debug-request, current mode: Supervisor                             
cpsr: 0xffffffd3 pc: 0x00000000                                                                           
Warn : NOTE! DCC downloads have not been enabled, defaulting to slow memory writes. Type 'help dcc'.     
Warn : NOTE! Severe performance degradation without fast memory access enabled. Type 'help fast'.         
Warn : Cannot identify target as an AT91SAM                                                               
Error: auto_probe failed                                                                                 
in procedure 'flash'                                                                                     
make: *** [flash] Error 1

Re: Unreliable Busblaster v2.5 with Olimex SAM7-P256 under L

Reply #1
I now installed urjtag as of this posting: viewtopic.php?p=36686

The busblster is detected, i can use it to detect the pld:

Code: [Select]
UrJTAG 0.10 #2039
Copyright (C) 2002, 2003 ETC s.r.o.
Copyright (C) 2007, 2008, 2009 Kolja Waschk and the respective authors

UrJTAG is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
There is absolutely no warranty for UrJTAG.

warning: UrJTAG may damage your hardware!
Type "quit" to exit, "help" for help.

jtag> cable ft2232 interface=1
Connected to libftd2xx driver.
jtag> detect
IR length: 8
Chain length: 1
Device Id: 00000110111000011100000010010011 (0x06E1C093)
  Manufacturer: Xilinx (0x093)
  Part(0):      xc2c32a-vq44 (0x6E1C)
  Stepping:    0
  Filename:    /usr/local/share/urjtag/xilinx/xc2c32a-vq44/xc2c32a-vq44

Now when i try to update the cpld urjtag doesn't know the svf command:

Code: [Select]
jtag> svf ~/tmp/busblaster/programming/bbv2.svf progress stop
svf: unknown command
jtag>

Why is that? Is this the wrong version of urjtag? Which is the right one then?

And my unreliability with the olimes board of course isn't gone:

Code: [Select]
jtag> detect
jtag> detect
warning: TDO seems to be stuck at 1
jtag> detect
warning: TDO seems to be stuck at 1
jtag> detect
jtag> detect
warning: TDO seems to be stuck at 0
jtag> detect
jtag>

Any ideas?

Re: Unreliable Busblaster v2.5 with Olimex SAM7-P256 under L

Reply #2
I had the same problem. But managed to solve it by installing from Ubuntu repo. Had go back and forth between repo and installing from source but latest repo install works well. Did you try that?

Re: Unreliable Busblaster v2.5 with Olimex SAM7-P256 under L

Reply #3
[quote author="tayken"]I had the same problem. But managed to solve it by installing from Ubuntu repo.[/quote]

The urjtag from the ubuntu 13.04 repo doesn't detect the busblaster at all:

Code: [Select]
jtag> cable jtagkey
error: Couldn't connect to suitable USB device.
error: ftdi/ftd2xx error: ftdi_usb_open_desc() failed: device not found

According to viewtopic.php?p=36686#p36689 this is due to the fact that the ubuntu version is compiled without ftd2xx support.

Also unloading ftdio_sio as suggested in viewtopic.php?p=36686#p36749 doesn't help with the version delivered with ubuntu

Re: Unreliable Busblaster v2.5 with Olimex SAM7-P256 under L

Reply #4
Managed to connect with it using vid and pid arguments. Of course normally it does not detect but once you put vid and pid, there are no problems.

Re: Unreliable Busblaster v2.5 with Olimex SAM7-P256 under L

Reply #5
[quote author="tayken"]Managed to connect with it using vid and pid arguments. Of course normally it does not detect but once you put vid and pid, there are no problems.[/quote]

That doesn't help:

Code: [Select]
jtag> cable jtagkey vid=0403 pid=6010 
error: Couldn't connect to suitable USB device.
error: ftdi/ftd2xx error: ftdi_usb_open_desc() failed: device not found

The device is there:

Code: [Select]
$ lsusb 
...
Bus 002 Device 011: ID 0403:6010 Future Technology Devices International, Ltd FT2232C Dual USB-UART/FIFO IC
...

Telling it to use ftd2xx also results in an immediate error (while using ftdi-mpsse takes a second or two to show an error):

Code: [Select]
jtag> cable jtagkey vid=0403 pid=6010 driver=ftd2xx-mpsse
error: Couldn't connect to suitable USB device.

and ftdi_sio has been unloaded.

Re: Unreliable Busblaster v2.5 with Olimex SAM7-P256 under L

Reply #6
Here is the command I use:
Code: [Select]
jtag> cable jtagkey pid=0x6010 vid=0x403

I also get rid of usbserial module.

Re: Unreliable Busblaster v2.5 with Olimex SAM7-P256 under L

Reply #7
[quote author="tayken"]Here is the command I use:
Code: [Select]
jtag> cable jtagkey pid=0x6010 vid=0x403

I also get rid of usbserial module.[/quote]

Argh ... C style hex notation!!! With the leading 0x it works.

And with the urjtag from ubuntu 13.04 i was then able to upload BBv2-JTAGkey-v1.3.svf

And after that the unreliability is gone and jtag detects my arm controller:

Code: [Select]
jtag> detect
IR length: 4
Chain length: 1
Device Id: 00111111000011110000111100001111 (0x3F0F0F0F)
  Unknown manufacturer! (11110000111) (/usr/share/urjtag/MANUFACTURERS)

And even better: OpenOCD now also just works out of the box. Great!

The only question left: What svf was installed at delivery? I was expecting it to be the BBv2-JTAGkey-v1.3.svf as the docs claim that the board comes preflashed with a jtagkey setup.

Re: Unreliable Busblaster v2.5 with Olimex SAM7-P256 under L

Reply #8
I'm glad that it works. :) I had lots of problems with it after changing my laptop, it took me a while to figure this out.

[quote author="harbaum"]The only question left: What svf was installed at delivery? I was expecting it to be the BBv2-JTAGkey-v1.3.svf as the docs claim that the board comes preflashed with a jtagkey setup.[/quote]

Don't know but the latest ones v1.4 works better. I had a similar problem with my JTAG interface, maybe it was a timing issue.