FX2LOAD_WRAPPER(1)

NAME
fx2load_wrapper - auto-load firmware into Cypress FX2 USB controller

SYNOPSIS
fx2load_wrapper [--board=b] [--file=f] [--ihx_path=p] [--cycfx2prog] [--force] [--dry_run]
fx2load_wrapper --help

DESCRIPTION
Checks firmware state of a Cypress FX2 USB controller and re-loads the firmware in case of a mismatch of currently active and desired firmware. The command locates a USB device with a USB path defined by the environment variables RETRO_FX2_VID and RETRO_FX2_PID, or default vid=16c0 and pid=03ef. It inquires with lsusb(1) the 'iProduct' attribute of the currently active USB descriptor. If this attribute is defined and equals the basename of the firmware image given with --file it is assumed the proper firmware is already active. Otherwise the firmware image is loaded with either fxload(1) or cycfx2prog. Note: after a firmware load the Cypress FX2 USB controller restarts. This causes a USB re-enumeration, the USB device disconnects and reconnects with a new device descriptor. It can take some time till the Linux USB stack shows the new device descriptor. The command sleeps for 1.5 seconds, this is usually enough to ensure that subsequent commands see the new state.

OPTIONS

--board=b
    determines the type of board to be configured. The default is 'nexys2', currently supported boards are:
    nexys2
        Digilent Nexys2. Default file: nexys2_jtag_2fifo_ic.ihx
    nexys3
        Digilent Nexys3. Default file: nexys3_jtag_2fifo_ic.ihx
    atlys
        Digilent Atlys. Default file: nexys3_jtag_2fifo_ic.ihx

--file=f
    specifies the firmware image to be loaded. Must be in .ihx format and located in the path defined with the --ihx_path option.

--ihx_path=p
    specifies the directory were firmware image files are searched. The default is $RETROBASE/tools/fx2/bin.

--cycfx2prog
    Use cycfx2prog instead of fxload(1) to load the firmware.

--force
    Unconditionally load the firmware, even when an 'iProduct' attribute match is seen. Useful to reset the Cypress FX2 controller.

--dry_run
    Don't load the firmware, display only the command used to do so.

--help
    print help text and exit.

EXIT STATUS
In case of an error, an exit status 1 is returned.

ENVIRONMENT

RETRO_FX2_VID, RETRO_FX2_PID
    Define the USB path of the Cypress FX2 USB controller. If not specified the defaults vid=16c0 and pid=03ef are used.

RETROBASE
    Path to current Retro project root directory. Used for the default firmware path in case no --ihx_path option is given.

EXAMPLES

fx2load_wrapper --board=nexys2 --file=nexys2_jtag_2fifo_ic.ihx
    Checks whether the 'nexys2_jtag_2fifo_ic' version of the firmware is loaded and in case not, loads the firmware image.

SEE ALSO
fxload(1), config_wrapper(1)

AUTHOR
Walter F.J. Mueller <W.F.J.Mueller@gsi.de>