Difference between revisions of "Programming over Fibre"

From MCEWiki
(Introduction)
(Firmware Requirements)
Line 14: Line 14:
  
 
= Firmware Requirements =
 
= Firmware Requirements =
In order to be setup for remote firmware update, the Clock Card FPGA has to run firmware revision 5.0.7 or later. Considering that Clock Card FPGA can be loaded through one of Factory or Application configuration devices, at least one of those need to have 5.0.7+ firmware. If you are running Clock Card firmware prior to 5.0.7, which means your factory configuration device is loaded with prior to 5.0.7, then attach USB-Blaster to the MCE front-panel connector. Run Quaruts Programmer, click on auto-detect, and program the second part from the bottom of the list, EPC16, with Clock Card firmware 5.0.7+.pof.
+
The Clock Card FPGA has to run firmware revision 5.0.7 or later. Considering that Clock Card FPGA can be loaded through one of Factory or Application configuration devices, at least one of those need to have 5.0.7+ firmware. If you are running Clock Card firmware prior to 5.0.7, which means your factory configuration device is loaded with prior to 5.0.7, then attach USB-Blaster to the MCE front-panel connector. Run Quaruts Programmer, click on auto-detect, and program the second part from the bottom of the list, EPC16, with Clock Card firmware 5.0.7+.pof.
  
 
Then issue the following command:
 
Then issue the following command:
 
  rs cc config_app 1
 
  rs cc config_app 1
read back the firmware revision to make sure the 5.0.7+ is now active.  
+
read back the firmware revision to make sure the 5.0.7+ is now active.
  
 
= Hardware Requirements =
 
= Hardware Requirements =

Revision as of 17:30, 7 December 2010

Remote Firmware Update (RFU), aka Remote Configuration is the ability to reprogram the MCE via the fibre-optic interface. This feature was implemented in February 2010.

This page details the steps to enable the remote update ability.

Introduction

Each of the Address Card, Bias Card, and Readout Card of the MCE has an Altera Stratix FPGA along with a configuration device ( See here). Clock-Card, however, has one FPGA with two configuration devices. FPGAs are RAM-based devices while configuration devices are Flash-based devices. Upon power up, each FPGA is loaded from its respective configuration device. The Clock Card FPGA is loaded from its factory configuration device upon power up, but then later, the firmware in the application configuration device can be loaded into the FPGA by issuing a command, i.e., on mas PC: rs cc config_app 1.

All these programmable parts with the exception of the factory configuration device are on a continous JTAG chain that can be controlled via the MCE front-panel connector with a USB-Blaster attached OR the Clock Card FPGA that runs the right firmware and is driven through the fibre interface.

The factory configuration device, however, is not on the same JTAG chain. It is only accessible through an on-board JTAG connector and can only be programmed with a USB-Blaster attached and Quartus Programmer.

In order to load temporary firmware, an sof file can be loaded into the FPGA. This firmware will be gone upon power cycle. To load permanent firmware, a pof file (or a jic file depending on EPC16 or EPCS64) can be loaded.

Firmware Requirements

The Clock Card FPGA has to run firmware revision 5.0.7 or later. Considering that Clock Card FPGA can be loaded through one of Factory or Application configuration devices, at least one of those need to have 5.0.7+ firmware. If you are running Clock Card firmware prior to 5.0.7, which means your factory configuration device is loaded with prior to 5.0.7, then attach USB-Blaster to the MCE front-panel connector. Run Quaruts Programmer, click on auto-detect, and program the second part from the bottom of the list, EPC16, with Clock Card firmware 5.0.7+.pof.

Then issue the following command:

rs cc config_app 1

read back the firmware revision to make sure the 5.0.7+ is now active.

Hardware Requirements

The buffer that controls whether the FPGA can drive the JTAG chain or not is controlled by BB_EN or SW1 dip switch setting on the Clock Card. Clock Cards shipped earlier do not have the right settings. You need to check this setting on your Clock Card. To do so, turn off the MCE power and unplug the Clock Card. The SW1.P1 labeled as "BB_EN" DIP should be on OPEN position.

  • Note that with this DIP switch setting, you can not program the FPGA(sof) from the front panel connector (USB_Blaster) anymore.
  • With this DIP switch setting, if CC firmware is pre-5.0.7, you can not access the JTAG chain from the front panel connector (USB_Blaster) anymore. Assuming you have 5.0.7+ in your configuration device, you need to issue: rs cc config_app 1 to be able to access front-panel JTAG.

Remote Configuration Software

Installation

Make sure the following are installed

  • mce_jam : This should be under /usr/mce/bin/
  • read_idcode.jam : This should be in $MAS_TEMPLATE directory
  • $MCE_JAM_DIR is set : This is set through mas_env.bash
  • mce_auto_detect : this is under mce_script directory.

Scan JTAG Chain

run mce_auto_detect:

mandana@mce-ubc-1:~/mce_script/trunk/script$ ./mce_auto_detect
 Device #1  |      EPC4/EPC8/EPC16     Altera          |
 Device #2  |      EP1S40              Altera          |
 Device #3  |      EPC4/EPC8/EPC16     Altera          |
 Device #4  |      EP1S40              Altera          |
 Device #5  |      EPC4/EPC8/EPC16     Altera          |
 Device #6  |      EP1S10              Altera          |
 Device #7  |      EPC4/EPC8/EPC16     Altera          |
 Device #8  |      EP1S10              Altera          |
 Device #9  |      EPC4/EPC8/EPC16     Altera          |
 Device #10  |      EP1S10              Altera          |
 Device #11  |      EPC4/EPC8/EPC16     Altera          |
 Device #12  |      EP1S10              Altera          |
 Device #13  |      EPC4/EPC8/EPC16     Altera          |

Generate JAM file

You need to update firmware on one device at a time. If you have access to internet:

  1. Go to MCE Jam File Generation webpage,
  2. copy and paste the result of mce_auto_detect on that webpage.
  3. Select the target device
  4. Select the device you want to program, and click generate
  5. Save the generated file in $MCE_JAM_DIR directory.

If you do NOT have access to internet:

  1. Install Quartus II Web Edition on Linux
  2. ....
  3. to be added later

Update Firmware

run mce_fw_update:

Usage:   ./mce_fw_update <device> <jamfilename>
  device         FPGA, EPC16, or EPCS64
  jamfile        filename, needs to be located in /usr/mce/mce_script//firmware/

Footnotes

Generating .JAM Files for Remote Update

Porting Remote Configuration Sofware to DAS

The following C-code will need to be ported to DAS to enable Remote Configuration. You will need to convert the MCE WB and RB commands in the code to use DAS libraries and compile the code with the included Makefile:

Development Notes