Skip to main content

Messages

This section allows you to view all Messages made by this member. Note that you can only see Messages made in areas you currently have access to.

Messages - robots

542
OpenOCD JTAG / Re: First port of OpenOCD firmware to Bus Pirate
I know that people LOVE pictures :))

Here are some of my setup:
http://robot.mysteria.cz/21012010029.jpg
White cable is my "handle", so i can remove the connector :)
http://robot.mysteria.cz/21012010030.jpg

The pinout for the cable is:

BPJTAG 20 pin
BLACK104,6,8,10,12,14,16,18,20
YELLOW49
ORANGE35
RED27
BROWN113
GREEN515
WHITEPGD3

The white cable is not connected to the 10pin connector, its should be connected to the programming header's PGD signal (not needed in my case)
The gnd can be connected to any of those (4 in my case)
543
OpenOCD JTAG / Re: First port of OpenOCD firmware to Bus Pirate
Some calculations:
Code: [Select]
grep buspirate_tap_execute ./log2.log | wc -l
672
totaly 672 transfers

Code: [Select]
grep buspirate_tap_execute ./log2.log | cut -d" " -awk 'BEGIN {a=0;} {a+=$1} END { printf a; printf "n" }'
604612

Totaly transfered 604621 bits  roughly 75578 bytes
That means 75578*2 + 672 * 3 = 157172 bytes were sent to BP
and 75578 + 672*3 = 79594 bytes were received from BP
As we are doing "half duplex" totaly 236766 bytes transfered!!!

@115200:
115200 baud (8bits + start + stop) = 11520 bytes/second

236766/11520 = 20.6 seconds

It seems that the actual bitbanging and openocd "thinking" took only ~1second!!

I don't think I can do any better at current rate :)
544
OpenOCD JTAG / Re: First port of OpenOCD firmware to Bus Pirate
Got the new firmware and openocd driver working :))) (pure magic that it even works (: )

I have taken the idea of arm-jtag-ew as i said earlier.

The speed now is
Quote
wrote 31840 byte from file ./stm32_menu.elf in 21.471720s (1.448126 kb/s)

Attaching log, Everytime you see something like "executing tap" we are sending stuff. Compared to the old log, this is much better, much less transactions, and transactions are bigger.
Now the question are ...
Can we use interrupt transfers in pic ? (would it be possible to integrate to BP firmware?)
Can we go faster with serial port ? (and not break up other BP stuff)

I'm going to check in the firmware into svn.
545
OpenOCD JTAG / Re: First port of OpenOCD firmware to Bus Pirate
I know there is a bug in READ_TDO, but ... its not used in my flashing :) so i have not fixed it

I have writen new function in firmware and rewriten the openocd driver. (almost finished debugging - just some minor problem with reading bits)

If this works, there is going to be only one function in the BP firmware (small and preferrably fast) + function to control SRST/NRST
547
OpenOCD JTAG / Re: First port of OpenOCD firmware to Bus Pirate
I have those 255 nops removed in my code. But what i didnt know is that, openocd gives you chain of commands and waits for answers.

I have been looking on other jtag interfaces, and i like the idea of arm-jtag-ew.

They have 2 buffers tms and tdi.
When you are doing a scan or tms walk you fill the buffers with the bits, which you want to shift out. Send those buffers over to the interface, and the interface shifts out all the bits, and shifts in TDO values. Reply is the buffer of TDO bits.
You just have to divide received bits into chunks (scans), and pass them to openocd.
548
OpenOCD JTAG / Re: First port of OpenOCD firmware to Bus Pirate
just some stuff was bitbanged,  in openocd it is called runtest, it does some changes on the tms bit.

I have queued these bytes and sent them over to BP in one piece, and let the BP do the work.
(much like WRITE_TMS_CHAIN)

I got to something like
Quote
wrote 31840 byte from file ./stm32_menu.elf in 27.153990s (1.145090 kb/s)

The wiggler gets about 14kb/s

I'm attaching log file, so you can see what is going on in there
550
OpenOCD JTAG / Re: First port of OpenOCD firmware to Bus Pirate
First real test :) , I have tried to flash my STM32 board. The speed is about 0.8 kb/s

Quote
Open On-Chip Debugger 0.3.0-rc0 (2010-01-18-17:44)
$URL$
For bug reports, read
   http://openocd.berlios.de/doc/doxygen/bugs.html
tms sequence is  long
srst_only separate srst_gates_jtag srst_open_drain
1000 kHz
jtag_nsrst_delay: 100
jtag_ntrst_delay: 100
trst_and_srst separate srst_gates_jtag trst_push_pull srst_open_drain
Warn : stm32.bs: nonstandard IR mask
Warn : use 'stm32.cpu' as target identifier, not '0'
20
Info : Buspirate Interface ready!
Error: Translation from khz to jtag_speed not implemented
Error: Translation from jtag_speed to khz not implemented
Error: Translation from khz to jtag_speed not implemented
Info : interface specific clock speed value 1000
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)
Info : device id = 0x20036410
Info : flash size = 128kbytes
stm32x mass erase complete
Info : Padding image section 0 with 0 bytes
wrote 31840 byte from file ./stm32_menu.elf in 38.119694s (0.815687 kb/s)
requesting target halt and executing a soft reset
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x01000000 pc: 0x08002790 msp: 0x20005000
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)
552
OpenOCD JTAG / Re: First port of OpenOCD firmware to Bus Pirate
I think that ft232 uses bulk transfers as well. At first we should get it to working state :)

Can you add me (xxxx) to the svn ? 
Also I'm having problem with the dos<->unix newline. SVN wants to change the whole usbprogjtag.c file, even though i changed only few lines. Which one do you preffer in the SVN? 
553
OpenOCD JTAG / Re: First port of OpenOCD firmware to Bus Pirate
I guess porting of usbprog is finished :) I have found a thread in openocd mailinglist

http://www.mail-archive.com/openocd-dev ... 09493.html

It mentions that usbprog only transfers chunks of 64bytes, and that the initial scan in Larger and has to be split, this is where we loose one clock tick. There are some options listed as how to fix this.

I am going to change the usbprog handling so that:
1. We sent the whole thing to buspirate (1024k buffer "should" be enough but we have 8k available just in case ;))
2. remove the TMS handling from WRITE_AND_READ/ WRITE_TDO/ READ_TDI and put it all to openocd driver.

Im not sure what is the impact on overall speed going to be. As we are also on usb as usbprog is. (except we are on 115k uart , can we go faster ? )
554
OpenOCD JTAG / Re: First port of OpenOCD firmware to Bus Pirate
I am almost there :))

http://pastebin.com/m26ab869a

The important piece is
Quote
Info : JTAG tap: stm32.cpu tap/device found: 0x3ba00477 (mfg: 0x23b, part: 0xba00, ver: 0x3)
Info : JTAG tap: stm32.bs tap/device found: 0x16410041 (mfg: 0x020, part: 0x6410, ver: 0x1)

the unpleasant piece is
Quote
Warn : Unexpected idcode after end of chain: 480 0x800000ff
Warn : Unexpected idcode after end of chain: 512 0x8000007f
Warn : Unexpected idcode after end of chain: 544 0x0000007f


Im not yet sure, what causes this magic error :( It seems that im getting more data from the jtag than expected

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01862452160session_write_close ( )...(null):0
20.01902583776ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01902584552Database_MySQL->query( ).../DatabaseHandler.php:119
40.06392723312Database_MySQL->error( ).../Db-mysql.class.php:273