1 |
29 |
wfjm |
# $Id: INSTALL_fx2_support.txt 654 2015-03-01 18:45:38Z mueller $
|
2 |
|
|
|
3 |
|
|
The Nexys2 and Nexys3 board feature a Cypress FX2 USB interface. It allows
|
4 |
|
|
to configure the FPGA and to transfer between FPGA and a PC. The retro
|
5 |
|
|
project uses a custom firmware in the FX2, this writeup describes the
|
6 |
|
|
installation of tools, environment setup and generation of the FX2 firmware.
|
7 |
|
|
|
8 |
|
|
Table of content:
|
9 |
|
|
|
10 |
|
|
1. System requirements
|
11 |
|
|
2. Setup environment variables
|
12 |
|
|
3. Setup USB access
|
13 |
|
|
4. Rebuild Cypress FX2 firmware
|
14 |
|
|
|
15 |
|
|
1. System requirements ----------------------------------------------------
|
16 |
|
|
|
17 |
|
|
- the download contains pre-build firmware images for the Cypress FX2
|
18 |
|
|
USB Interface. Re-building them requires
|
19 |
|
|
- Small Device C Compiler
|
20 |
|
|
-> package: sdcc sdcc-ucsim
|
21 |
|
|
|
22 |
|
|
- for FX2 firmware download and jtag programming over USB one needs
|
23 |
|
|
- fxload
|
24 |
|
|
-> package: fxload
|
25 |
|
|
- urjtag
|
26 |
|
|
-> package: urjtag for Ubuntu 12.04
|
27 |
|
|
-> see INSTALL_urjtag.txt for other distributions !!
|
28 |
|
|
|
29 |
|
|
2. Setup environment variables ---------------------------------------------
|
30 |
|
|
|
31 |
|
|
The default USB VID and PID is defined by two environment variables.
|
32 |
|
|
For internal lab use one can use
|
33 |
|
|
|
34 |
|
|
export RETRO_FX2_VID=16c0
|
35 |
|
|
export RETRO_FX2_PID=03ef
|
36 |
|
|
|
37 |
|
|
!! Carefully read the disclaimer about usage of USB VID/PID numbers !!
|
38 |
|
|
!! in the file README_USB-VID-PID.txt. You'll be responsible for any !!
|
39 |
|
|
!! misuse of the defaults provided with the project sources. !!
|
40 |
|
|
!! Usage of this VID/PID in any commercial product is forbidden. !!
|
41 |
|
|
|
42 |
|
|
3. Setup USB access -------------------------------------------------------
|
43 |
|
|
|
44 |
|
|
For using the Cypress FX2 USB interface on Digilent Nexys2, Nexys3 and
|
45 |
|
|
Atlys boards 'udev' rules must be setup to allow user level access to
|
46 |
|
|
these devices. A set of rules is provided under
|
47 |
|
|
|
48 |
|
|
$RETROBASE/tools/fx2/sys
|
49 |
|
|
|
50 |
|
|
Follow the 'README.txt' file in this directory.
|
51 |
|
|
|
52 |
|
|
Notes:
|
53 |
|
|
- the provided udev rules use the VID/PID for 'internal lab use' as
|
54 |
|
|
described above. If other VID/PID used the file must be modified.
|
55 |
|
|
- your user account must be in group 'plugdev' (should be the default).
|
56 |
|
|
|
57 |
|
|
4. Rebuild Cypress FX2 firmware -------------------------------------------
|
58 |
|
|
|
59 |
|
|
The download includes pre-build firmware images for the Cypress FX2
|
60 |
|
|
USB interface used on the Digilent Nexys2, Nexys3 and Atlys Boards.
|
61 |
|
|
These firmware images are under
|
62 |
|
|
|
63 |
|
|
$RETROBASE/tools/fx2/bin
|
64 |
|
|
|
65 |
|
|
To re-build them, e.g. because a different USB VID/PID is to be used
|
66 |
|
|
|
67 |
|
|
cd $RETROBASE/tools/fx2/src
|
68 |
|
|
make clean
|
69 |
|
|
make
|
70 |
|
|
make install
|
71 |
|
|
|
72 |
|
|
Note: The default build assumes that sdcc with a version 3.x is installed.
|
73 |
|
|
In case sdcc 2.x is installed use
|
74 |
|
|
make SDCC29=1
|
75 |
|
|
instead. See also tools/fx2/src/README.txt in the
|
76 |
|
|
|
77 |
|
|
Please read README_USB_VID-PID.txt carefully to understand the usage
|
78 |
|
|
of USB VID and PID.
|
79 |
|
|
|