Overview

Our development environment is configured with tools that can “synthesize” Verilog to a configuration file (called a bitstream) for the iCE40 UltraPlus FPGA, which is on the UPduino board. The UPduino also includes an RGB LED, which can be used for output.

Preparation & Plugging in

  1. Programming requires your USB (data) cable, your UPduino, and either Chrome (macOS or Windows) or Edge (windows).

    Caution!

    Only browsers with WebUSB support will work. Safari does not support WebUSB.

  2. Plug the UPduino into your computer.

    Windows

    The tools being used require the WinUSB driver. Other drivers may be installed by default or due to prior work, like working with Arduinos.

    You can use the Zadig.exe installation tool to change the driver.

    1. Connect the UPDuino
    2. Download and open Zadig
    3. click Options > List All Devices
    4. Select the UPduino from the list (If the UPduino is not shown, you may want to confirm that you have a data-capable cable)
    5. If it’s not already selected, pick “WinUSB” in the right box (above Reinstall Driver)
    6. Click Reinstall Driver. It may take a few minutes to download and install the driver. Some versions of Windows may also require a reboot.

    Note in the picture below the UPduino was selected, then the WinUSB driver was selected, and finally “Reinstall Driver” was clicked.

    Zadig Driver Tool

    Other resources:

    macOS

    Newer versions of macOS will ask if you want to connect to USB devices. If so, be sure to select “Allow”. If you have difficulties accessing the device, you may want to adjust the default permissions for accessories as described here. (“Ask for new accessories” is probably the best choice, but “Always” may be beneficial if you are unable to get it to connect).

    If you don’t see any evidence of the UPduino being connected confirm that you have a data-capable cable.

Running the Programmer

Use the Task to open the FPGA programmer (“FPGA Programmer Server”). Unlike most tasks, this one will continue running. There will be a small, animated ring on the left showing it running and the buttons will change to include a reload and a stop bytton, which could be used to try to close and restart it if needed:

FPGA Programmer Task

Running the task should reveal an “Open in Browser” pop-up:

Open in Browser

Clicking on the button should open a web browser to the “programmer page”.

If you close the browser tab or don’t see that pop-up, you can use the “PORTS” tab in the VS code bottom pane to get the URL or re-open it:

Reopen in Browser

You can also open the “PORTS” view by View > Open View... and searching for “ports”.

Connecting

“Images” (bitstreams) are files that describe how the FPGA should be configured. The initial webpage should look something like:

Programmer Page

You will need to “connect” to the UPduino via the Connect button. That should cause the browser to pop-up a window that will allow you to select and connect to the UPduino:

Select UPduino

Programming Images

Each “image” file will have an Upload button. If the UPDuino is connected, you should be able to upload the image to program it. Most repositories will contain images that turn the led colors. You can use these images to confirm that programming is working. After selecting Upload on an image you should see the row for that image fill with a reddish color as the UPduino is erased and then a greenish color as the image is programmed. You’ll also see status messages in the “Standard Output” (StdOut) pane (or possibley error messages in the “StdError” pane)

Try programing one of the LED color images (red.bin or blue.bin), which should make the LED on the UPduino the corresponding color.

Trouble Shooting

Check all wiring

Carefull check all external wiring to confirm there aren’t short circuits, misconnected wires, or floating inputs/outputs.

Confirm Connection / Reconnect

  1. You may need to reload the page and reconnect to the UPduino via the Connect button.
  2. If connection is successful, the Connect button should be faint and the Disconnect button should be enabled:

Connected

Confirm Programming

  1. The last bitstream that was successfully programmed to the UPduino will be highlighted with a Green bar. If no images have a green bar, you may need to confirm that you’re connected and select Upload by the image.
  2. Images also contain the creation time. If the UPduino isn’t updating as expected, you may want to confirm that the image is changing when you change your source code and run the task to create the bitstream.

After Upload

Images Not Updating

If the image isn’t updating, you may want to review the Problems tab for clear syntax problems and the Terminal associated with the task for problems related to creating the bitstream. In the example below there was an error in the blink: image task:

  1. The Problems tab shows syntax errors.
  2. Selecting
    1. the Terminal tab (2a) and then
    2. the terminal associated with the blink: image task (2b)

    shows more detail about errors. Some configuration errors will not be shown in Problems, but will be shown in the terminal. This also provides a lot more detail about the synthesis process.

Programming Problem Details