(no commit message)
[libreriscv.git] / HDL_workflow / ECP5_FPGA.mdwn
index cbcc74ab46fe4320c415381cba2e3dadc1fe9b95..e390b4aa149443f123194dc394022f53841e3f7c 100644 (file)
@@ -8,16 +8,95 @@ Cross referenced with:
 
 ## Original Instructions
 
-See https://bugs.libre-soc.org/show_bug.cgi?id=517#c0
+See <https://bugs.libre-soc.org/show_bug.cgi?id=517#c0>
 
-TODO checklist based on above
+Checklist based on above
 
-| Done?   | FPGA IO PAD |
-|---------|-------------|
-|         |    Hello    |
-|         |    Motto    |
-|         |    Frodo    |
-|         |    Dodo
+* For god's sake make sure you get this right, ***TRIPLE*** check everything.
+    
+* ***DO*** make sure to ***only*** drive an input as an input, and to ***only*** drive an output as an output.
+
+* ***DO*** make sure to ***only*** wire up 5.0V to 5.0V and to ***only*** wire up GND to GND with the jumper-cables.
+
+* ***DO*** make sure that ***before*** even ***thinking*** of uploading to and powering up the FPGA that everything has been ***THOROUGHLY*** triple-checked.
+
+If you violate any of the above stated hard-and-fast rules you will end up learning the hard way by **DESTROYING** the FPGA.
+
+To start we have to ensure we have a safe set up.
+
+| Checklist Step |
+|----------------|
+| Ensure power is disconnected from FPGA |
+| Ensure STLINKV2 USB is disconnected |
+| Ensure FPGA USB is disconnected |
+
+Now lets review all of the relevant material on this page before we begin the wiring process.
+
+| Checklist Step |
+|----------------|
+| Review the STLINKv2 Connector diagram and table |
+| Review the connections table for your model of fpga |
+| Ensure the orientation of the FPGA and STLINKv2 match that of the images and diagrams on this page |
+
+Next we will wire up the STLINKv2 and our FPGA in three separate stages. 
+
+* First attaching one end of a jumper cable to each necessary header pin on the STLINKv2. 
+
+* Then we will attach the end of a new jumper cable to each male header pin on the FPGA. Finally, we will connect the wires from the STLINKv2 to the wires from the FPGA by matching the colours of the wires. This way you do not lose the connections when you want to disconnect and store the two devices. We are using FEMALE-TO-FEMALE jumper cables on the male header pins of each of the FPGA so that the wires do not randomly damage the bare PCB due to a short.
+
+We will wire each of the pins on the the STLINKv2 according to the diagrams, tables, and images on this page. 
+
+| Action | Colour | Pin # | Pin Name |
+|--------|--------|-------|----------|
+| Attach | Red    |   2   |   VREF   |
+| Attach | Black  |   4   |   GND    |
+| Attach | Green  |   5   |   TDI    |
+| Attach | Blue   |   7   |   TMS    |
+| Attach | White  |   9   |   TCK    |
+| Attach | Yellow |  13   |   TDO    |
+
+Next, we will wire each of the pins on the the FPGA according to the diagrams, tables, and images on this page.
+
+Follow this section if you have the ULX3S FPGA:
+
+| Action | Colour | Pin # | Pin Name |
+|--------|--------|-------|----------|
+| Attach | Red    |   2   |   VREF   |
+| Attach | Black  |   4   |   GND    |
+| Attach | Green  |   5   |   TDI    |
+| Attach | Blue   |   6   |   TMS    |
+| Attach | White  |   7   |   TCK    |
+| Attach | Yellow |   8   |   TDO    |
+
+Follow this section if you have the Versa ECP5 FPGA:
+
+| Action | Colour | X3 Pin # | Pin Name |
+|--------|--------|----------|----------|
+| Attach | Red    |    39    |   VREF   |
+| Attach | Black  |     1    |   GND    |
+| Attach | Green  |     4    |   TDI    |
+| Attach | Blue   |     5    |   TMS    |
+| Attach | White  |     6    |   TCK    |
+| Attach | Yellow |     7    |   TDO    |
+
+Final steps for both FPGA boards:
+
+| Checklist Step |
+|----------------|
+| Check each jumper wire connection between the corresponding pins on the FPGA and the STLINKv2 **THREE** times |
+| ***lckl*** check for ground loops? |
+
+
+Finally, we will connect the jumper cables of the same colour from STLINKv2 and the FPGA.
+
+| Checklist Step |
+|----------------|
+| Attach the ends of the **RED** jumper cables   |
+| Attach the ends of the **BLACK** jumper cables |
+| Attach the ends of the **GREEN** jumper cables |
+| Attach the ends of the **BLUE** jumper cables  |
+| Attach the ends of the **WHITE** jumper cables |
+| Attach the ends of the **YELLO** jumper cables |
 
 ## Connecting the dots:
 
@@ -152,9 +231,8 @@ Table of connections:
 
 | X3  pin #   | FPGA IO PAD | STLinkv2       |Wire Colour|
 |-------------|-------------|----------------|-----------|
-|1 GND        | GND         | 4 (GND)        |   Black   |
-|2 NC         | NC          |  NC            |    NC     |
 |39 +3.3V     | 3.3V supply | 2 (MCU VDD)    |   Red     |
+|1 GND        | GND         | 4 (GND)        |   Black   |
 |4 IO29       |  B19        |    5 (TDI)     |   Green   |
 |5 IO30       |  B12        |    7 (TMS)     |   Blue    |
 |6 IO31       |  B9         |    9 (TCK)     |   White   |