Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 07 Dec 2004 02:15 PM by  Anonymous
JTAG: flash bus D0..D7 is being jammed
 6 Replies
Sort:
You are not authorized to post a reply.
Author Messages
tom@cyberiansoftware.com
New Member
New Member
Posts:


--
27 Nov 2004 01:40 AM
    Hello,

    I have been working with a Wiggler and the Jtag software (openwince). So far I have been successfull in connecting to the LDP LH7A400 board and reading most of the Flash memory contents.

    I say most, as D8..D31 is being read correclty. However, there is some device hanging on D0..D7 and driving those bits low. I've read through the "IO Controller Specification" and searched through the Forum messages, but there is no clue as to what this could be.

    Judging from the schematics, the only device that has only 8 bits connected to the data bus is the CPLD. What signals would I need to deactivate to enusre that the CPLD is not driving the data bus?


    UPDATE:
    I've confirmed that the CPLD is giving us the problem. Lifting pin 76 of the CPLD allows the JTAG to read uP_MD6 bits correctly.
    tom@cyberiansoftware.com
    New Member
    New Member
    Posts:


    --
    29 Nov 2004 04:46 AM
    Ok, it looks like CS7 is the culprit. If I drive CS7 low with JTAG, then I can read the full D0..D31 of the data bus. CS[1,2,3,6] don't seem to have any effect upon the reading of the Flash array.

    Is CS7 the only signal required to be deactivated?
    tom@cyberiansoftware.com
    New Member
    New Member
    Posts:


    --
    29 Nov 2004 07:37 PM
    (feel like I'm talking to myself here..., For the sake of documenting what I've done, I'll continure this thread).

    From within the Jtag software (use the CVS version: http://openwince.sourceforge.net, I can kick the CPLD out of the way and gain read access to the Flash with a series of script statements:

    # install the interface.
    cable parallel 0x378 WIGGLER
    # detect the processor now
    detect
    # connect a bus handler to shift our chains.
    initbus lh7a400
    # disable the CPLD from driving D0..D7 low.
    set signal CS7 out 0
    set signal CS6 out 0
    set signal nCS1 out 1
    set signal nCS2 out 1
    set signal nCS3 out 1
    # read our memory.
    readmem 0xc0000 0x34844 sample.bin

    Note: the JTAG wiggler that I'm using is a homebrew built along the lines of the HRI wiggler: http://http://hri.sourceforge.net/tools/index.html#jtag. Make sure you ground unused inputs and use a 74HC device as they will operate across 2.0..6.0 volt range. The transistor used is a common 2N2222 or, you could use a 2N7000 FET and eliminate the base-bias resistors of 10K & 47K. The goal here is to develop a Linux based JTAG tool that can be used to recover the Flash and for use with gdb for program development later on. I'll post a webpage with this information later.

    Running Jtag with "Jtag <scriptfile>" will execute the above statements within the scriptfile and exit when they are completed. The sample.bin file is a 210K+ file that I burned into flash via lolo and then read back using Jtag. The contents were compared and found to be an exact match.

    So, I have the ability to read the Flash via the JTAG tap port. What I need to do now is be able to write to the Flash and it seems that the CPLD "is in the way". There only appears to be one write signal to the CPLD and five chipselects. Process of elimination seems to suggest that by using a combination of CS7 + uP_nWE0 that the internal registers can be written to via JTAG.

    However, it is not the case. Writing into the CPLD from the CPU with JTAG port does not appear to have any effect. Maybe there is a clock missing that the CPLD needs? Or, there is some other signal(s) that needs to be activated or de-activated?
    tom@cyberiansoftware.com
    New Member
    New Member
    Posts:


    --
    30 Nov 2004 12:33 AM
    Ok, getting closer. I can control the FL_VPEN output of the CPLD via JTAG. Here is the entire script needed to set FL_VPEN HI (enable writing to Flash memory cells), to use it, run Jtag then 'script <filename_of_this_script>':
    # install the interface.
    cable parallel 0x378 WIGGLER
    # detect the processor now
    detect
    # connect a bus handler to shift our chains.
    initbus lh7a400
    # disable the CPLD from driving D0..D7 low.
    set signal CS7 out 0
    set signal CS6 out 0
    set signal nCS1 out 1
    set signal nCS2 out 1
    set signal nCS3 out 1
    # set mode to control external bus.
    instruction EXTEST
    # send JTAG mode command to internal CPU control.
    shift ir
    # shove the current signal settings out into BSR.
    shift dr
    # address the CPLD
    set signal A21 out 0
    set signal A22 out 0
    set signal A23 out 0
    set signal A24 out 1
    set signal A25 out 0
    # set data for the CPLD
    set signal D0 out 1
    set signal D1 out 0
    set signal D2 out 0
    set signal D3 out 0
    set signal D4 out 0
    set signal D5 out 0
    set signal D6 out 0
    set signal D7 out 0
    set signal D8 out 0
    # idle the CS7 and WE0
    set signal CS7 out 0
    set signal nWE0 out 1
    # push the address / data out in readiness to write it.
    shift dr
    # select the CPLD.
    set signal CS7 out 1
    shift dr
    # strobe the nWE0 signal
    set signal nWE0 out 0
    shift dr
    set signal nWE0 out 1
    shift dr
    # now disable the chip select
    set signal CS7 out 0
    shift dr
    #
    # at this point, VPEN should be HI (pin 39 of CPLD).
    # also, CPU has stopped running and we have bit-level
    # control of the bus (LEDs have stopped winking).
    FL_VPEN is now high and seems to be latched in that state. Accesses to the Flash doesn't seem to affect the state of FL_VPEN.
    tom@cyberiansoftware.com
    New Member
    New Member
    Posts:


    --
    30 Nov 2004 02:22 AM
    A little more work in the Jtag software by implementing a tandom write function to assert both uP_nWE0 and uP_nWE3 when talking with the flash now allows the CFI to be seen. But the values look suspicious, look at the Maximum Chip erase timing, 0ms?
    jtag> detectflash 0
    Query identification string:
    Primary Algorithm Command Set and Control Interface ID Code: 0x0001 (Intel/Sharp Extended Command Set)
    Alternate Algorithm Command Set and Control Interface ID Code: 0x0000 (null)
    Query system interface information:
    Vcc Logic Supply Minimum Write/Erase or Write voltage: 2700 mV
    Vcc Logic Supply Maximum Write/Erase or Write voltage: 3600 mV
    Vpp [Programming] Supply Minimum Write/Erase voltage: 0 mV
    Vpp [Programming] Supply Maximum Write/Erase voltage: 0 mV
    Typical timeout per single byte/word program: 128 us
    Typical timeout for maximum-size multi-byte program: 128 us
    Typical timeout per individual block erase: 1024 ms
    Typical timeout for full chip erase: 0 ms
    Maximum timeout for byte/word program: 2048 us
    Maximum timeout for multi-byte program: 2048 us
    Maximum timeout per individual block erase: 16384 ms
    Maximum timeout for chip erase: 0 ms
    Device geometry definition:
    Device Size: 8388608 B (8192 KiB, 8 MiB)
    Flash Device Interface Code description: 0x0002 (x8/x16)
    Maximum number of bytes in multi-byte program: 32
    Number of Erase Block Regions within device: 1
    Erase Block Region Information:
    Region 0:
    Erase Block Size: 131072 B (128 KiB)
    Number of Erase Blocks: 64

    Also, when I run an eraseflash (leaving VPEN disabled!), I get the wrong manufacturer device ID:
    jtag> eraseflash 0xc0000 1
    addr: 0x000C0000
    Manufacturer: Intel
    Chip: 28F640J3A
    program:
    addr: 0x000C0000


    This is getting really close, but I am not yet ready to activate VPEN and truly attempt an erase yet.

    The schematic calls out for an RC28F128J3A-150 device tor the Flash, but the devices on the board don't have that number. They are marked 4LC11FW406, what are those things?
    tom@cyberiansoftware.com
    New Member
    New Member
    Posts:


    --
    30 Nov 2004 02:18 PM
    OKAY! It works! I can now program / erase / verify the LH7A400 card engine Flash using a $10 wiggler and Jtag. There is still an issue with getting the CPLD to accept a value at 0x71000000, this is something I'm not initializing or signal timing related.

    I'll package this up in a few days and send the patchfile up to the maintainer.
    Anonymous
    Posts:


    --
    07 Dec 2004 02:15 PM
    TomW,

    Thanks for posting your findings to the Technical Discussion Group. Glad to see that you were able to resolve these issues!

    Regards,

    Platform Support
    You are not authorized to post a reply.