Setting Up - adwinying/FreeLwIP-Nios-II GitHub Wiki
Setting up Projects
Table of Contents
Pre-requisites
Required Software
- Git client/shell
- Cygwin 32-bit (NOT 64-bit) with at least
telnetinstalled - Quartus 13.1 (setup below)
Setting up Quartus 13.1
- Run
QuartusSetup-13.1.0.162.exe - To activate Quartus, add system environment variable in Windows:
Variable:
LM_LICENSE_FILEValue:[email protected] - Done.
Configuring FPGA Hardware
- Clone project to a local directory (Cygwin
/home/recommended) - Navigate to
/[Project Name]/FPGA/and open the file that ends with*.qpfextension - Connect your FPGA to your computer via USB Blaster
- Click on the Programmer button (circled in red)

- Click OK on the dialog. The Programmer window may disappear but please check your minimized windows.

- Ensure device is listed in the window. If not, reconnect/troubleshoot in Device Manager
- Press Start to write to FPGA.
- Wait for progress bar to show
100% (Successful) - Done.
[IMPORTANT] Do not close [OpenCore Plus Status] window!! (shown below)

atk2-uIP
- Configure hardware using the files from
/atk2-uip/FPGA/using instructions from Configuring FPGA Hardware - Assuming you've cloned the files from GitHub, navigate to
atk-uip/atk2-sc1/OBJ/test_histogramin a Cygwin window - If there are no C files in the directory (
*.cor*.oextension), then type./run.shand hit Enter Careful, this could overwrite existing files in/OBJ/test_histogram - Once completed, type
make runand hit Enter - Once you see
TOPPERS/ATK2-SC1 Release 1.3.2 for NIOS2_DEV_DE2_115(NIOS2), compilation has complete and UIP is up and running.
- Done.
atk2-TINET
- Configure hardware using the files from
/atk2-tinet/FPGA/using instructions from Configuring FPGA Hardware - Assuming you've cloned the files from GitHub, navigate to
atk-tinet/atk2-sc1/OBJ/test_histogramin a Cygwin window - If there are no C files in the directory (
*.cor*.oextension), then type./run.shand hit Enter Careful, this could overwrite existing files in/OBJ/test_histogram - Once completed, type
make runand hit Enter - Once you see
TOPPERS/ATK2-SC1 Release 1.3.2 for NIOS2_DEV_DE2_115(NIOS2), compilation has complete and program is loaded.
- As with the screenshot above, you may see multiple lines of
Error:E_OS_STATE=SetEvent(2, 0x1). This is normal and wait for a few seconds until you seeTINET 1.5.3 (Jan 30 2017, 05:47:21)appears then TINET is up and running.
- Done.
lwIP (no OS)
- Configure hardware using the files from
/FreeLwIP-Nios-II/FPGA/using instructions from Configuring FPGA Hardware - In Windows Start Menu, look for a program named NIOS 13.1 Software Built Tools for Eclipse (SBT) and launch program.
- If prompted for default workspace location, select any local directory.
- Go to File > Import.. and select General > Existing Projects into Workspace then click Next.
- Under Select root directory, click Browse.. and locate the
/FreeLwIP-Nios-II/FPGA/software/directory then click OK. - Check the checkboxes for lwIP_NIOS_II_Example and lwIP_NIOS_II_Example_bsp then click Finish.
- Editing MAC address: in
main.clook foralteraTseNetif.hwaddr[0]to[5]and edit the MAC address - Enable/Disable DHCP: in
main.clook for#define USE_DHCPand change to0or1to Disable/Enable it. If DHCP is disabled,#define STATIC_IPmust be defined - Right click lwIP_NIOS_II_Example project directory in Project Explorer and click Build Project
- Build is completed when
lwIP_NIOS_II_Example.elfexists in project directory - Right click the project directory again then click Run As > 3 Nios II Hardware
- When running the program for the first time, ensure Project ELF file name is point to the right
*.elffile. Alternatively, you can manually select ELF file by checking Enable browse for file system ELF file and browse for the ELF file
- If system timestamp error appears, check Ignore mistmatched system timestamp under the Target Connection tab
- Press Run
- The Nios II Console should appear and something similar should be visible:
Running...
INFO : TSE MAC 0 found at address 0x04001c00
INFO : PHY Marvell 88E1119 found at PHY address 0x01 of MAC Group[0]
INFO : PHY[0.0] - Automatically mapped to tse_mac_device[0]
INFO : PHY[0.0] - Restart Auto-Negotiation, checking PHY link...
INFO : PHY[0.0] - Auto-Negotiation PASSED
INFO : PHY[0.0] - Checking link...
INFO : PHY[0.0] - Link established
INFO : PHY[0.0] - Speed = 1000, Duplex = Full
Waiting for link...OK
Waiting for DHCP IP address...IP address: 192.168.123.136
- Done.
FreeRTOS-lwIP
Refer to lwIP (no OS), and replace lwIP_NIOS_II_Example with FreeLwIP