All -

I've seen a number of things about using the EzUSB chip, i have some experience/knowledge with this chip, and the EzUSB library that generates the license concern, is very easy to work around.

-Duane.

If you do this you can re-purpose many other devices into JTAG dongles

 For example:

    http://www.devasys.com/usbi2cio.htm
    http://www.usbee.com/sx.html
    http://www.usbee.com/usbeeex2.html

    http://www.cutedigi.com/product_info.php?products_id=4515
    http://www.minford.ca/html/mf3001.html

    http://www.knjn.com/shop.html?pg=img&src=5131

    http://www.knjn.com/FPGA-FX2.html
        Some of these have an ARM + FPGA + EzUSB chip

The EzUSB magic works like this:

1) At POWER ON RESET, the EzUSB chip reads the first 8 bytes of the on board I2C chip.

    IF I2C chip is not present (or data is corrupt) THEN
use ANCHOR (now cypress) Vendor ID, and ANCHOR assigned Product ID.
            Attach via USB.

IF I2C is present, and 8 byte data header is valid, header may be in two forms.
    CASE 1:
Firmware is present - chip loads the firmware from I2C and runs your code.
            Your code decides when and how to attach.

    CASE 2:
            the "BOOT HEADER" is present only.
            The boot header has YOUR vendor ID, and YOUR product ID.
The boot header has no usb strings, no nothing, ie; 'minimal stuff'
            But - it has enough to attach via USB..

2) The magic download trick is this: one USB "vendor" command.
    Specifically: the value is '0xA0' (the A is probably for Anchor)

    Problem: No windows native stuff lets you send VENDOR commands.
    Example: WinUSB driver library cannot do this,
    The Cypress EzUSB library + EzUSB driver can ...

    In contrast,  LIBUSB - you *can* send vendor commands :-)

    Hence you can write a driver using LIBUSB :-)

3) In the USB vendor setup packet, the important two fields are:
       (a) wValue = 16 bit address to write data to
       (b) wLength = the number of bytes to write.

    In effect, the USB vendor command (0xa0) says:
            Write (N) bytes to memory address(X).
            You can access the full 8051 internal address space (64K)

NOTE:
    Even if you have assigned your own VID/PID the hardware intercepts the
   vendor command 0xa0 - and allows any PC application to take control.
   This is a good thing, especially when you have bugs in your 8051 code.

4) Download STEP 1 - send a vendor command to write 1 byte to the SFR 'reset register' The value 0x01 - puts the CPU in reset, the value 0x00 lets the CPU run.
    At this step, the CPU is held in reset.

5) Download STEP 2 - repeat vendor commands to download app to internal RAM.
    You can only write via the 0xa0 command,you cannot read.

6) Download STEP 3 - Write to that same SFR register, and release CPU RESET.
    your EzUSB chip begins execution at the reset vector.

NOTE: When it does this, the USB device is not "reset' but remains attached.
    Your downloaded code - can if needed disconnect and reconnect.

The above is generally what the linux tool:  "fxload" does.
    http://linux.die.net/man/8/fxload

=====

To PROGRAM the on board I2C chip, do the following:

    Start: Your I2C chip is blank or corrupt.
    Connect via USB - send the vendor command 0xa0, put cpu in reset.
    Download new code, remove reset.
    Your downloaded code re-writes the I2C chip.

    OR - Above - download prebuilt cypress HEX file
    That HEX file supports various vendor commands to rd/wr the I2C chip.


*END*








_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to