Firmware - softerhardware/Hermes-Lite GitHub Wiki

Quartus Setup

The Hermes-Lite project currently uses Altera's Quartus II Web Edition 14.1 to synthesize, place and route the RTL. Be sure to download the free web edition, not the paid subscription edition. The BeMicro CV's Cyclone V and BeMicro SDK's Cyclone IV are supported by the free web edition. Altera has an excellent Quick Start Guide to guide you through the download and install process.

  • You must sign up for a free Altera account to download software. You can download and install multiple versions of Quartus with no worries.
  • A "Combined Files" download works well. If you want to download individual files, be sure to download support for Cyclone V (BeMicro CV) and/or Cyclone IV (BeMicro SDK).
  • If you never intend to compile the firmware, but only intend to program the binary firmware bitfiles, you can download just the "Programming Software" available from the "Software Selector" near the bottom of Altera's download page.
  • You must setup Altera's USB programming interface (USB-Blaster) driver. The USB-Blaster hardware is built-in to the BeMicros. For Linux driver setup, good instructions are here and here. For Windows, the driver install is part of the entire software install. With newer versions of Windows, you may have to force the driver install.
  • Go into the Windows device manager
  • Find the usb device with a warning sign
  • Force it to install the driver.
  • The driver was placed on the disk during the Quartus install but not actually installed. When you click install driver, have it look on the C drive (or wherever you installed Quartus) then it will find it.
  • For windows, you may need to install the Microsoft 2010 redistributable.
  • It can take a significant amount of time to synthesize, place and route the Hermes-Lite RTL. Install Quartus on your most capable computer. Also, after Quartus is installed, go to Tools->Options->Internet Connectivity->TalkBack Options and Enable sending TalkBack data to Altera. This trick enables use of multiple processors in the free web edition to speed up some steps.
  • To learn more about Quartus, take a look at the "Getting Started" links at the bottom of Altera's download page.

BeMicro Programming

Programming

  1. Make sure you have the desired firmware in the .jic format, JTAG indirect configuration file. You can find .jic files on github or you can create your own. With the precompiled .jic files found on github, start with the most recent release. **{ensure you download using "RAW" in Github} ** All releases are coded by release date. For example, 20150729 was released on July 29, 2015. If for some reason a release does not work for you, try an earlier release.

Also, make sure you choose a release that matches your hardware. Releases for the BeMicro SDK are in the SDK subdirectory.

Releases for the BeMicro CV are in the CV and CVC8 subdirectory. You have a CV with a C8 part if the part number ends with C8N and should use the CVC8 release.

If you part number ends with I7NFA, use the CV release. The 61 (61.440) or 73 (73.728) in the filename refers to the oscillator frequency. The FD in the filename indicates full-duplex support and will only work on v1.22 or later boards.

  1. Connect your BeMicro with no Hermes-Lite attached to your computer via USB.
  2. Open the Quartus programmer, Tools->Programmer and make sure it says "USB-Blaster" by the Hardware Setup button. If it doesn't, click the Hardware Setup button and select a USB-Blaster from the "Available hardware items" list. If there are no USB-Blaster available, verify that you have installed the required drivers. Quartus Programmer
  3. Click Add File and select your .jic file to program. You should see a screen similar to the one below.
  4. Check the lower Program/Configure checkbox to match what is seen below. Quartus Programmer
  5. Click Start. After a few minutes, you should see "100% (Successful)" in the Progress status box.

As seen in the picture, this procedure programs the BeMicro's onboard EPCS16 16 kbit EEPROM indirectly through the FPGA via JTAG. The EEPROM is nonvolatile and will retain the Hermes-Lite firmware after power down. Everytime the BeMicro is powered up, it loads firmware from this EEPROM.

Advanced Programming

It is safest to never connect your Hermes-Lite to the BeMicro if the BeMicro is connected to USB. This ensures that only one power supply (USB or Hermes-Lite) is active at a time. The previous recommended procedure follow this guideline. The following advanced programming procedure is not required for normal use and should only be used if you have a specific need.

It is possible to program the BeMicro's FPGA or EEPROM via USB while the Hermes-Lite is connected. To do this, think through how both the BeMicro and Hermes-Lite will be powered for both 5V and 3.3V. On the Hermes-Lite, J8 is provided to disconnect the BeMicro's 5V from the Hermes-Lite's 5V. This is usually shorted. Also, J7 connects the BeMicro's 3.3V to the Hermes-Lite. This is usually open except if you are powering the Hermes-Lite from the higher current capable BeMicro CV. Finally, J5 is provided on the Hermes-Lite to pull the BeMicro's PWREN# input low. This is usually shorted. On the BeMicro SDK, this disconnects the USB 5V from the main BeMicro 5V and disables the USB blaster. On the BeMicro CV, this has no effect. See the hardware wiki page for more details.

RTL Compilation

Please download a copy of the RTL if you plan to compile the RTL. The easiest way is to download a zip file by clicking the Download ZIP button on the Hermes-Lite main github page. If you plan to develop code, you can clone the git repository. In Linux, git is a standard tool and package. On Windows, you can use cygwin for a Linux-like shell-based git. Github also has tools and help.

Open the Quartus Project

The Hermes-Lite RTL is organized as a Quartus project. Start Quartus 14.1 and use File->Open Project to navigate to and open the Hermes-Lite/rtl/Hermes_Lite.qpf project file. Within the Quartus project, variations to target different BeMicro boards, SDK, CV or CVC8. Note that there are two variations of the BeMicro CV and the CVC8 refers to the part number ending in C8 rather than I7. Use Project->Revisions to open the "Revisions" selection window and select and Set Current the revision you would like to work on. If you plan to make major changes or use an experimental Hermes-Lite board, you can create your own revision based on one of these provided revisions.

QuartusRevisions

Configuration

Before compiling the RTL, you can set certain configuration parameters. This is done by editing the wrappers files Hermes-Lite/rtl/Hermes_Lite_CV.v or Hermes-Lite/rtl/Hermes_Lite_SDK.v depending on your target BeMicro. These wrapper files contain RTL specific to the target BeMicro as well as top-level Verilog parameters. You can open the file directly from Quartus (Files tab in Project Navigator then double click file name) or with your favorite code editor. Below is relevant code from Hermes_Lite_CV.v starting around line 50.

// PARAMETERS

// Ethernet Interface
parameter MAC = {8'h00,8'h1c,8'hc0,8'ha2,8'h22,8'h5c};
parameter IP = {8'd0,8'd0,8'd0,8'd0};

// ADC Oscillator
//61440000 or 73728000
parameter CLK_FREQ = 61440000;

// Number of Receivers
parameter NR = 2; // number of receivers to implement

This is where you can change your MAC address (6 hexadecimal values) or specify a fixed IP (4 decimal values). If the IP parameter is set to all zeros as in this default case, the Hermes-Lite will obtain an IP address via DHCP. You can also specify the Hermes-Lite onboard clock frequency. Set this to either 73728000 or 61440000 Hz depending on the oscillator in your kit. 73728000 is the preferred oscillator frequency as it avoids aliases in the 30 MHz range when transmitting on 10M. Finally, you can specify the number of receivers, currently 1 or 2 for the CV or 1,2 or 3 for the SDK. One receiver is useful to shorten the compile time if you are building the project frequently during development.

If you add new features to the RTL, please include a parameter to enable, disable or configure it in this top section of Hermes_Lite_CV.v and Hermes_Lite_SDK.v.

People familiar with Quartus might wonder why the Quartus GUI is not used to set Verilog parameters. Editing the parameters directly in the Verilog is preferred as the Quartus GUI has no readable way to specify the Verilog concatenation used for the MAC and IP parameters.

Pin Assignments

You may need to alter the default FPGA pin assignments used. You can either edit the *.qsf file when not open in Quartus or from the Quartus GUI use Assignments->Pin Planner. There are several levels of name indirection to determine the final pin number you need. You will have to refer to the Hermes-Lite schematic as well as the BeMicro CV documentation and schematics or the BeMicro SDK documentation and schematics.

Compilation

Once you've made your changes, save all changed files and start compilation by clicking on the Start compilation icon as shown below. After 5-60 minutes depending on your computer, the flow will complete with green check marks on the left side for all steps. There will be warnings but should not be any errors that stop the flow.

QuartusCompilation

The results of the compilation flow are in Hermes-Lite/rtl/build. All files in this directory are named after the revision that was built, e.g. Hermes_Lite12CV, and multiple builds may be in this directory. There are various report (*.rpt) and summary (*.summary) files. There str also FPGA programming files, *.sof. The .sof is used for volatile programming of the FPGA or to create a *.jic file. Please follow the instructions in the next section if you need to create a *.jic programming file.

Convert to JIC

To create a .jic programming file, select File->Convert Programming Files from within Quartus. The windows shown below should pop up.

QuartusConvert

In the "Convert Programming File" window that pops up, make these settings:

  1. Set Programming file type: to "JTAG Indirect Configuration File (.jic)."
  2. Set Configuration device: to "EPCS16." and "active serial" or "EPCQ256" and "active serial x4" if you have a CVA9.
  3. Set File name: to whatever name and location you like, or leave the default output_file.jic.
  4. In the "Input files to convert" section near the bottom, click on the Flash Loader line. This causes an "Add Device..." button to appear on the right. Click that and select Device family "Cyclone V" if you have a BeMicro CV or "Cyclone IV E" if you have a BeMicro SDK. The device family checkbox may not appear checked yet.
  5. Next, set Device name to "5CEFA2" if you have a BeMicro CV , "EP4CE22" if you have a BeMicro SDK or "5CEBA9" if you have a CVA9. Shown below is the selection for a BeMicro CV. QuartusSelectDevice
  6. Click on the SOF Data line in the "Input files to convert" area. This causes an "Add File..." button to appear on the right. Click that and select the .sof file you built in the Hermes-Lite/rtl/build subdirectory.
  7. The last step causes the file to be listed under "SOF Data" in the "Input files to convert" area. Click on the .sof file name. This causes a "Properties" button to appear on the right. Click that button and check the Compression check box in the small pop-up window.
  8. Click Generate to generate your .jic file.

This .jic can be used to program your BeMicro as described in programming.

BeMicro Usage

One your BeMicro CV or SDK is programmed, it can be used in test mode even without a Hermes-Lite connected. See the Software wiki page for more details. The BeMicro CV and SDK contain some user LEDs, buttons and switches which are used in the Hermes-Lite. The 8 User LEDS have the following meaning.

  • LED1: ADC Positive Clip
  • LED2: ADC Near Positive Clip
  • LED3: ADC Near Negative Clip
  • LED4: ADC Negative Clip
  • LED5: Ethernet RX for this MAC
  • LED6: Ethernet TX active
  • LED7: Hermes-Lite in Sync
  • LED8: Heartbeat with period of approximately 1 second

The DIP switch controls the following.

  • 1 On to identify as Hermes, Off to identify as Hermes-Lite
  • 2 Select alternate MAC address

BeMicro SDK

The User button on the BeMicro SDK will trigger an AD9866 reset when pressed.

BeMicroSDK1

BeMicro CV

The LEDs are not numbered on the BeMicro CV, but follow the same order as the BeMicro SDK. The BeMicro CV also has a jumper to select between 2.5V and 3.3V IO. When connected to the Hermes-Lite, it should be in the 3.3V position as shown.

The VCCIO jumper in this picture is for 2.5V. The CV manual is incorrect and has the 2.5V and 3.3V settings reversed for J11. Please use a volt meter and measure that 3.3V is being connected by J11.

BeMicroCV1