USB Blaster

From MCEWiki

In order to load new firmware on the MCE cards, you need to have either an Ethernet Blaster or a USB Blaster or a ByteBlaster, all available from Altera, connected to the MCE front-panel JTAG connector. On the software side, you need to have Quartus installed (check Quartus II Installation )

(An alternative method is to load firmware over the fibre with no need for Altera Software/Hardware, this is work in progress. but if you have the patience, we can help you get it setup once and then use it forever. )

Updating firmware on MCE Cards

Each MCE card has an Altera Stratix FPGA and a configuration device. All cards except low-power Readout Cards (Rev. E and beyond) have an EPC16 configuration device. FPGAs are RAM-based devices, therefore, upon power up they load their firmware from a flash-based configuration devices.

In order to load firmware temporarily, use an .sof file to directly program the Stratix FPGA. This firmware only lasts till next power cycle. In order to load firmware permanently, use a .pof file to program the EPC16 parallel configuration devices or .jic to program the EPCS64 serial configuration device on low-power readout-card.

Firmware on all cards can be upgraded by attaching a Blaster (USB-Blaster, or Ethernet Blaster , or ByteBlaster) through the MCE front-panel connector.

Clock card is an exception because it has two configuration devices: a Factory configuration device and a application configuration device. When MCE is turned on, the Clock-Card FPGA is loaded from the Factory configuration device, but then it can switch to the firmware loaded in the application configuration device by issuing an "wb cc app_config 1" command in mas. See the next section to program the Clock-Card Factory configuration device.

  1. Connect a USB Blaster to a PC with Quartus software installed.
  2. Plug the Blaster connector into the MCE front-panel connector. Be sure that the Clock Card is powered on.
  3. Open Quartus II. (Note that on Linux systems, you may need to invoke Quartus from the terminal. If "quartus" is not in the path, you may be able to find it in /opt/usr/local/lib/altera/10.0/quartus/bin (which can be added to the path. Furthermore, you may need to be root user to access the USB blaster, in which case "sudo quartus" (or "sudo /path/to/quartus") should be enough.
  4. Select Tools -> Programmer
  5. Press the 'Hardware Setup' button
  6. Select USB Blaster from the 'Currently Selected Hardware' drop-down menu. If that option is not available, press the 'Add Hardware' button, and add a USB Blaster to the list.
  7. Select 'Close'
  8. Select the 'Auto Detect' button and after few moments you should see list of devices.
  9. There are two devices listed per each MCE card with the exception of the low-power Readout card which will only show as one device. The top two devices correspond to Address Card, then the next 2 devices correspond to BC1, and so on.
  10. In order to load temporary firmware, choose the desired EP1S device. In order to load firmware permanently, choose the EPC16 device. In both cases for low-power Readout Card, select the EP3S device.
  11. Firmware programming files should be downloaded from firmware repository. Copy files from this repository to the programming computer hard drive. Temporary firmware (for EP1S and EP3S devices) uses .sof files. Permanent firmware will be .pof (for EPC16 devices) or .jic (for EP3S devices).
  12. Double-click on the 'File' entry corresponding to the device that you wish to program, and select a programming file. For .jic files, an EPCS64 device should be automatically added to the device list when you associate the .jic with the EP3S device.
  13. Check the box in the Program/Configure column corresponding to your device. For .jic file, check boxes for both EP3S50 and EPCS64.
  14. Select 'Start'. If you are loading temporary firmware, it should take about 30 seconds, if you are loading permanent firmware, then it may take up to 10 minutes.
  15. For .sof files, the FPGA will automatically reconfigure itself when programming is complete. For .pof or .jic files, it is necessary to power cycle the unit to get the new firmware loaded.

Updating the Factory Configuration on Clock Card

  1. You need to program the Clock Card's .pof with your USB Blaster, but via P2 on the Clock Card board itself.
  2. To gain access to this connector, partially eject the Clock Card from the MCE until you can see the connector.
  3. Plug the USB blaster into the connector so that the ribbon cable is oriented upwards (this puts pin 1 of the USB Blaster to pin 1 of the connector).
  4. Gently curl the ribbon cable around so that it can come out the gap between the Clock Card faceplate and the Readout Card #4 faceplate.
  5. Gently re-insert the Clock Card taking care not to kink the ribbon cable.
  6. Open Quartus and go to the programmer window, as described above.
  7. Now when you press 'Auto Detect' to Scan the JTAG Chain, two devices should be listed. Click on EPC16 device and select a Clock Card .pof.
  8. Follow the instructions above for configuring the EPC16..

If the USB Blaster stops responding

  1. Close Quartus
  2. Power off the MCE
  3. Wait for 5 seconds
  4. Power on the MCE
  5. Re-open Quartus

Using Ethernet Blaster

You can program the MCE remotely, if you have an Altera-supplied Ethernet Blaster. Assuming that EthernetBlaster is configured and attached to MCE:

  1. In Quartus, select the "Tools -> Programmer" menu.
  2. Click on "Hardware Setup"
  3. Click on "Add Hardware"
  4. On the drop-down menus, select/specify the following pieces of information:
    • Hardware type: EthernetBlaster
    • Port: ---
    • Baud rate: ---
    • Sever name: <IP Address of the EthernetBlaster>
    • Server port: 1309 -- Server port 1309 should be opened for the Ethernet Blaster.
    • Server password: <Password>
  5. Press "Auto Detect". It takes few moments to find the EthernetBlaster. Press "OK".
  6. Now you are back to Hardware Setup Page with the following item showing up in the list of "Available Hardware Items": Hardware: Ethernet Blaster, Server: xxxxx, Port: /dev/ebhwip
  7. Click on the "Currently Selected Hardware" drop-down menu and select "EthernetBlaster", and then press "Close".
  8. Now Press on Auto Detect and you should see the list of cards that the EthernetBlaster is connected to.

Programming from the Command Line

On a remote Linux machine you might only have / might only be able to run a command line programmer.

Find the path to the programmer; possibly

alias quartus_pgm='sudo /opt/altera/11.1/qprogrammer/bin/quartus_pgm'

Scan (this is a CC factory configuration device):

quartus_pgm -a
...
Info (213045): Using programming cable "USB-Blaster [4-2]"
1) USB-Blaster [4-2]
  0100A0DD   EPC(16|4|8)
  171280DD   EPM(3128A|7128AE)

Program:

quartus_pgm --mode=JTAG -o 'PV;firmware/cc_v0500000e_15may2012.pof@1'
...
Info: Command: quartus_pgm --mode=JTAG -o PV;firmware/cc_v0500000e_15may2012.pof@1
Info (213045): Using programming cable "USB-Blaster [4-2]"
Info (213011): Using programming file firmware/cc_v0500000e_15may2012.pof with checksum 0x0D7E2A22 for device EPC16@1
Info (209060): Started Programmer operation at Tue May 28 10:33:04 2013
Info (209017): Device 1 contains JTAG ID code 0x0100A0DD
Info (209018): Device 1 silicon ID is 0xB0E9
Info (209044): Erasing EPC4/8/16 configuration device(s)
Info (209023): Programming device(s)
Info (209021): Performing verification on device(s)
Info (209011): Successfully performed operation(s)
Info (209061): Ended Programmer operation at Tue May 28 10:37:25 2013
Info: Quartus II 32-bit Programmer was successful. 0 errors, 0 warnings
    Info: Peak virtual memory: 111 megabytes
    Info: Processing ended: Tue May 28 10:37:25 2013
    Info: Elapsed time: 00:04:22
    Info: Total CPU time (on all processors): 00:00:06