Skip to main content

Topics

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

Topics - tnt

1
Bus Pirate Development / Howto rebuild the firmware
Hi,

I was wondering if there was something special needed to rebuild the firmware ?

I downloaded MPLAB and the C compiler evaluation, installed them. Then cloned the SVN and loaded the project file in source/ and build that.
Then I tried flashing the output/busPirate.hex resulting of this but the loaded doesn't even want to load the .hex file ...

    Sylvain
2
OpenOCD JTAG / JTAG quite slow and ideas to make it go faster
Hi,

Yesterday I had to dump the NOR from a target with JTAG. It took about 8 hours to dump 64 Mo of flash. That's pretty long !

When looking at the jtag bus, I notices that it is currently the limiting factor. (the with 'fast' uart mode, the uart keeps up but is slowed down by the bit-banging).

The JTAG bus is aroung 100-125 kHz  right now (with a very un-even duty cycle). I think that by using an optimized loop, we could bring that to 500 - 600 kHz. Which should provide a pretty nice speed up.

I haven't programmed PIC in a long time ... (back when the 16f84 was a new product), but I tried estimating what could be done by a quick look at the datasheet. Below is what I came up with (probably buggy but that's just to estimate the cycle count) :

Basically there would be several 'layers' of loop to avoid doing the uart test or handling #bits != 16 ... and you'd have one very fast function doing just the bit bang for a certain number of 16 bits words and for the 'end' and when uart flushes are needed, we'd just have an outer loop in C.


[tt:]params:
        W0      inBuffer
        W1      outBuffer
        W2      bits

                # Main full 16 bits loop
                # ----------------------

                SL      W2, #4, W3              # W3 = W2 >> 4;
_loop_f16:                                      # do {

                #  Fetch & organize 2x16 bits
                MOV     [W0++], W5              #   W5 = *((uint16_t*)W0++);
                MOV     [W0++], W6              #   W6 = *((uint16_t*)W0++);

                        # W5 has one byte TMS and one byte TDO
                        # W6 has one btes TMS and one byte TDO
                        #  -> We must reorgonize that !
                SWAP    W6                      #   W6 = swap_bytes(W6);
                XOR     W5, W6, W7              #   W7 = W5 ^ W6;
                AND     #0xff, W7               #   W7 &= 0xff;
                XOR     W5, W7, W5              #   W5 = W5 ^ W7;
                XOR     W6, W7, W6              #   W6 = W6 ^ W7;
                SWAP    W6                      #   W6 = swap_bytes(W6);

                #  Clear destination register
                CLR     W7

                #  Inner loop
                MOV     #15, W4
_loop_f16_inner:

                #   Clear TCK
                BCLR    IOPOR, OOCD_TCK

                #   Set TDO & TMS
                MOV     IOPOR, W8
                BTST.Z  W5, W4
                BSW.Z   W8, OOCD_TDO
                BTST.Z  W6, W4
                BSW.Z   W8, OOCD_TMS
                MOV     W8, IOPOR1

                #   Set TCK
                BSET    IOPOR, OOCD_TCK

                #   Read TDI
                BTST    IOPOR, OOCD_TDI
                BSW.Z   W7, W4

                #   Loop condition
                DEC     W4
                BRA     NZ, _loop_f16_inner

                #  Store result
                MOV     W7, [W1++]

                #  Loop condition
                DEC     W3, W3
                BRA     NC, _loop_f16           # } while (W2--);



                # FIXME: Do the rest 0..15 bits[/tt:]
3
OpenOCD JTAG / [solved: use v5.1] OpenOCD Broken with FW V5.0
Hi,

I just tried the OpenOCD with the v5 firmware ( BPv3-Firmware-v5.0.hex ) and it doesn't work (not even the IDCODE)
Looking at it with a logic analyzer shows the the commands sent to the JTAG bus are correct, the TDO signal is correct on the bus but does _not_ match the bits received by openocd.

With the exact same setup and just reflashing to BPv3-Firmware-v4.2.OpenOCD.hex and things work fine.

Cheers,

   Sylvain

( ! ) 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.01252293496session_write_close ( )...(null):0
20.01282425088ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01282425864Database_MySQL->query( ).../DatabaseHandler.php:119
40.05782564600Database_MySQL->error( ).../Db-mysql.class.php:273