FPGA Update

The logic on the CoCoVGA main board is mostly contained within the larger surface-mounted FPGA. FPGA stands for Field Programmable Gate Array. This means that in the field (such as in your home or office), you may upgrade the configuration of the hardware logic gates within the FPGA chip using a hardware release provided via this web site. This programming/configuration is performed serially by way of a protocol defined by and therefore known as JTAG (Joint Test Action Group).

From time-to-time, new CoCoVGA FPGA hardware releases may be made to fix bugs or provide feature enhancements. These can be used either temporarily (by programming the CoCoVGA FPGA directly) or permanently, by updating the flash memory on the CoCoVGA main board.

Requirements

You will need:

  1. an Altera Byte Blaster USB cable
  2. Quartus Prime Pro Edition Programmer and Tools software for your PC (more details in step 2, below)
  3. an FPGA image from the Downloads page, either:
    • .sof file for temporary updates - OR -
    • .jic file for permanent updates

Pictured below is one example of an Altera Byte Blaster USB cable:

If you happen to have one with a circuit-board style adapter, instead, use these pictures to help you orient the adapter and USB Blaster correctly:

Procedure

  1. If you have not already installed your CoCoVGA main board in your computer, please do so. See Installation for more information.
  2. If you do not already have it installed, download and install the Quartus Prime Pro Edition Programmer and Tools provided on Intel/Altera's web site. It may be necessary to sign up for a free account. From the link, select the Additional Software tab, then under Stand-Alone Software, check only Quartus Prime Pro Edition Programmer and Tools and click Download Selected Files. (At this time, only the Windows version of the Quartus Prime Programmer has been heavily tested. Some users have been able to use the Linux version of the Quartus Prime Programmer if permissions are set properly and appropriate libraries are installed and part of your LD_LIBRARY_PATH. Additional guidance on using Quartus with Linux can be found here: https://wiki.archlinux.org/index.php/Altera_Design_Software and at the end of this document.)
  3. Turn off your computer which has CoCoVGA installed in it and disconnect disk drives, IDE/SDC/MMC/flash and other data storage peripherals.
  4. Plug in your Altera Byte Blaster USB cable, first to an available USB port on your computer, and then to the small JTAG header connector on your CoCoVGA main board (labeled "JTAG").
  5. Turn on the computer which has CoCoVGA installed in it.
  6. Start up the Quartus Prime Programmer Pro Edition.
  7. Click "Hardware Setup..." and select the USB Blaster plugged into one of your USB ports. Close this pop-up. If your computer is unable to recognize the USB Blaster it may not show up in the list, in which case, please see Troubleshooting, below.
  8. If you have an AMC2 board, then skip to step 11, otherwise, continue with step 9.
  9. (Only for F1, AMC3, KMC1, T1) Click the "Auto Detect" button. The programmer will ask you to select a device. Click the radio button by EP4CE6 and then OK. A window may pop up saying that "The auto-detected device chain does not match the Programmer's device list." Click Yes.
  10. (Only for F1, AMC3, KMC1, T1) Left click once on the "UNKNOWN_29604093" device and then right click once on the same device, select Edit > Change Device... Scroll to the bottom of the "Device family" list and click "User Defined". (In the "Device name" list, if "XC9572XL-VQ64" is not listed, click New... and enter this name into the "Device Name:" blank. If a mask is required, the default is ok. Then click OK.) In the "Device name" list, click the checkbox next to "XC9572XL-VQ64" and then OK. (Note: older versions of Quartus may allow you to ignore this device, in which case, please use that feature.)
  11. Left click once on the "EP4CE6E22" device and then the "Change File..." button from the left (or alternatively, right click on the "EP4CE6E22" device and select Edit > Change File). Select the .sof or .jic file you would like to program. For a .sof file, ensure that Program/Configure is checked for only the EP4CE6E22 (which should be the first and perhaps only device in the list). For a .jic file, ensure that Program/Configure is checked for the EPCS4 or EPCS16 device (this will also check the EP4CE6, which is ok). Verify and Blank-Check are optional, but should also only be applied to the EP4CE6E22 or EPCS4 or EPCS16 device.
  12. Click Start to begin programming.
  13. See below for next steps - generally, a temporary .sof causes automatic FPGA reconfiguration whereas a .jic is permanent and requires power cycling your CoCo or Dragon system upon completion of the programming step.

.sof

If programming a temporary .sof, the "Progress:" bar should reach "100% (Successful)" and then CoCoVGA should reconfigure itself and you should see the appropriate version number in the banner. This configuration will stay present and active within the FPGA until you either reboot your CoCo or Dragon or press the "RECONFIG" button on the CoCoVGA main board.

AMC2 example:

AMC3, F1, KMC1, T1 example:

.jic

If programming a permanent .jic, wait until the "Progress:" bar has reached "100% (Successful)" and then power-cycle your CoCo or Dragon. Once your VGA monitor syncs, you should see the appropriate version number in the banner.

AMC2 example:

AMC3, F1, KMC1, T1 example:

Linux

One of the designers of CoCoVGA has found Windows 10 and 11 to be difficult or unreliable with respect to use of the USB Blaster. These steps worked when setting up version 21.1 of Quartus Prime under a Linux VM (Oracle VM VirtualBox):

  1. Install Oracle VirtualBox and a Linux distribution such as Ubuntu.
  2. Install VirtualBox extensions to enable USB forwarding.
  3. Plug your USB Blaster into a USB port.
  4. Configure VirtualBox session to add and forward any of these USB configurations by clicking the "USB plug +" button on the right side of the window.
  5. Start up Linux VM.
  6. Install Quartus Prime or Quartus Prime Programmer within Linux VM.
  7. Create /etc/udev/rules.d/90-usb-blaster.rules to contain the following (reference https://www.jackenhack.com/quartus-prime-fpga-usb-blaster-problems-ubuntu-18-04/):

    # USB Blaster

    SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6001", MODE="0666", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", RUN+="/bin/chmod 0666 %c"

    SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6002", MODE="0666", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", RUN+="/bin/chmod 0666 %c"

    SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6003", MODE="0666", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", RUN+="/bin/chmod 0666 %c"

    # USB Blaster II

    SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6010", MODE="0666", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", RUN+="/bin/chmod 0666 %c"

    SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="09fb", ATTR{idProduct}=="6810", MODE="0666", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", RUN+="/bin/chmod 0666 %c"

  8. Create symlink from libudev.so.1 to libudev.so.0. This appears to be in different locations depending on the version of the distribution. It may be necessary to sudo apt install mlocate so that you can locate libudev.so and create the symlink in that directory, like this:
    sudo ln -s /usr/lib/x86_64-linux-gnu/libudev.so.1 /usr/lib/x86_64-linux-gnu/libudev.so.0
  9. Add the directory where the Quartus Prime installer installed its libraries (look for files named lib*.so) to your LD_LIBRARY_PATH, something like this:
    export LD_LIBRARY_PATH=/home/brendan/intelFPGA_lite/21.1/quartus/linux64
    It may make sense to add this to your .bashrc so that it's always set upon login.
  10. Connect the USB Blaster (both the USB and JTAG header ends) and power up your CoCo or Dragon
  11. Use the jtagconfig tool provided by your Quartus Prime installation, something like:
    ~/intelFPGA_lite/21.1/quartus/linux64/jtagconfig
    Which should result in output that resembles:
    1) USB-Blaster [2-2]
    020F10DD 10CL006(Y|Z)/10CL010(Y|Z)/..

    which means that not only is your Linux VM properly communicating with the USB Blaster, but the USB Blaster is in turn able to clock and shift the JTAG scan chain on the CoCoVGA FPGA.
  12. Now you should be able to start up your Quartus Prime or Quartus Prime Programmer like this, respectively:
    ~/intelFPGA_lite/21.1/quartus/bin/quartus
    or
    ~/intelFPGA/21.1/qprogrammer/bin/quartus_pgmw
    Refer to step 7 in the "Procedure" section, above, for the remainder of the process.

Troubleshooting

Marty Jenkins, after having some difficulty with recognizing his USB Blaster from Windows, provided this document which may help those who are having trouble with their FPGA update in versions of Windows from 7 to 10. Thank you, Marty!

Some additional issues not covered by this document may be related to getting the USB Blaster driver installed in the first place under Windows 10. If you find in your Device Manager that your Altera USB Blaster device is recognized but has an exclamation point icon next to it and/or no driver installed or available, then the missing auto-installation of the driver could be the problem. This is related to the fact that Intel is currently (as of 2020) not producing signed drivers. To install them requires rebooting your PC with driver signature checks disabled. Courtesy this forum, take the following steps:

  1. Go to Windows 10 settings and search for "advanced startup options" .
  2. Under Advanced Startup, hit "Restart now"
  3. Choose "Troubleshoot", then "Advanced options", then "Startup Settings".
  4. You'll get a screen telling you what you will be able to change. Click the "Restart" button.
  5. As part of the reboot, you'll be given a menu of options; item 7 disables driver signature enforcement.
  6. Once done booting, use Device Manager to update the drivers. Point it to the location on your system where you have installed the Quartus software, for example C:\intelFPGA_lite\20.1\quartus\drivers. When installing the driver, expect to see a warning about the signature. Despite this, the driver should install successfully.
  7. Now you should be able to see your USB Blaster in your Quartus Programmer software. If you are satisfied that the driver is installed properly you may reboot to re-enable signature enforcement.