From Fpga4u

Revision as of 10:43, 9 June 2009 by Xjimenez (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page describes a test suite that verifies most of the components of the FPGA4U. The components can be tested by using the binaries and scripts through a NIOSII command shell, or with the complete project sources and the NIOSII IDE. If you don't need to modify the test procedure, we suggest you to use directly the binaries as it is faster and easier.

Here are the files to download:

Run the test

To run these tests with the binaries, open a NIOS II command shell and navigate to the directory containing the binaries. By default the command shell start in the directory $NIOS_II_DIRECTORY$\examples, hence it is convenient to unzip the binaries in that directory.

Make sure that the *.exe files can be executed by your Nios II shell (type "chmod 755 *.exe".) Verify that the board is correctly plugged to your computer via the USB cable, then just type "./run_sh" in the shell.

The command will run 3 tests in the following order:

  1. testMemory.sh: Complete SDRAM test.
  2. testMisc.sh: Miscellaneous tests (LEDs, LAN, FX2, Serial lines, etc.).
  3. testEPCS.sh: EPCS16 test.

You can run each test independently by executing its corresponding script.

SDRAM test

It will check the SDRAM integrity. Here you have nothing to do. If everything is ok it will prompt: "Memory OKAY!" and continue with the next tests, otherwise it will prompt "MEMORY ERROR" and stop the procedure since the other tests need the SDRAM to work. That test generate a memory.log file saving the displayed information.

Miscellaneous tests

That test verifies the LEDs, buttons, switches, LAN chip, FX2 chip and the serial connectors I2C and UART. The text prompted by this test is saved in the file tests.log.

In this test you will be able to choose what devices you want to test. A menu appears describing the options you can choose:

(1) Test LEDs
(2) Test LAN
(3) Test FX2
(4) Test I2C UART
(a) Test all
(q) Exit

Test LEDs, buttons, and switches

Here you have to check several things on your own. When you press one of the four push buttons, check that only the corresponding LED is switched off. Check if the rows and columns are consistent on the LED matrix. Check that the Switch 0 controls the LEDs of the Switch 1. You can alternates their roles by pressing enter. If everything works fine, simply type 'y' and Enter; otherwise, type 'n' and Enter. Note that there won't be any feedback when you type something in the terminal.

Test LAN and its EEPROM


To successfully run this test you must:

  • Connect the board to a host machine using a RJ45 cable
  • The host's IP address must be set to


Here you have to enter the last digits of the MAC address of your FPGA4U, it will test if the EEPROM saves it correctly. Validate with Enter. Default MAC address is 00:60:D7:02:00:00, you can only modify the 4 last digits by entering numbers.

Test FX2


To successfully run this test you must have installed LibUSB 0.1.12.o for Windows or later. You can find here the LibUSB releases.


It will receive/send some data from/to your computer trough USB.

Test I2C and UART connectors


To successfully run this test you will need to link the I2C connector with the UART with a special cable:

  • pin 2 of UART must be connected with pin3 of I2C (rx - sda)
  • pin 3 of UART must be connected with pin4 of I2C (tx - scl)

If you really need to test these connectors and don't know how to connect them properly, you can go to the helpdesk to provide you one of these cables or to perform this test for you.


It will test the pull-up resistor of I2C, and if the lines are connected to the FPGA.

EPCS16 test

This test downloads a small program in the EPCS16 to be loaded by the FPGA on each reinitialization of the board (SW8 button). When the program is successfully downloaded, try to reinitialize the board. The logo EPFL and then the text "Fpga4U" should appear on the LEDs. If it's the case type 'y'; otherwise 'n'.

Personal tools