Readme - Web Server Software Example
DESCRIPTION:
A Web Server running from a file system in flash memory.
REQUIREMENTS:
This example will run on the following Nios II harware example designs:
- Standard
- Full Featured
In addition, one of the following Nios development boards is required:
- Nios II Development Board, Stratix II Edition
- Nios II Development Board, Cyclone II Edition
- Nios Development Board, Stratix Professional Edition
- Nios Development Board, Stratix Edition
- Nios Development Board, Cyclone Edition
PERIPHERALS USED:
This example exercises the following peripherals:
- Ethernet MAC (named "lan91c111" in SOPC Builder)
- STDOUT device (UART or JTAG UART)
- LCD Display (named "lcd_display" in SOPC Builder)
SOFTWARE SOURCE FILES:
This example includes the following software source files:
- web_server.c: Contains the bulk of the code, including main(), the
networking initialization routines, the web server task (WSTask), and all of
board control utilities/tasks.
- http.c: Implementation of an HTTP server including all necessary sockets
calls to handle a multiple connections and parsing basic HTTP commands to
handle GET and POST requests. Requests for files via HTTP GET requests direct
the server to fetch the file, if available, from the flash file system and
send it to the client requesting it.
- http.h: Header information defining HTTP server implementation and common
HTTP server strings & constants.
- web_server.h: Definitions for the entire example application.
- network_utilities.c: Contains MAC address, IP address, and DHCP routines to
manage addressing. These are used by NicheStack during initialization, but are
implementation-specific (for any implementation of this example not an Altera
Nios development board, Stratix, Stratix Professional, or Cyclone edition,
this file will need to be modified to control addressing in your system).
- alt_error_handler.[ch]: Contains a simple error handler for MicroC/OS-II
errors.
- srec_flash.c: Contain the SREC parsing and flash programming routines needed for remote configuration.
BOARD/HOST REQUIREMENTS:
This example requires an Ethernet cable connected to the development board's
RJ-45 jack, and a JTAG connection with the development board. If the host
communication settings are changed from JTAG UART (default) to use a
conventional UART, a serial cable between board DB-9 connector and the host is
required.
If DHCP is available, the application will attempt to obtain an IP
address from a DHCP server. Otherwise, a static IP address (defined in
web_server.h) will be assigned after a timeout.
KNOWN ISSUES/LIMITATIONS
The read-only zip filesystem must be set to a flash memory device whose base
address is 0x0 (note that you may place read-only zip file system contents
at any offset within the flash memory device). This limitation is scheduled
to be corrected in a future Nios development kit release.
ADDITIONAL INFORMATION:
Not all characters will display as typed on the LCD display. This is because
HTML forms send unicode, for some characters, and standard ASCII for others.
This HTTP server will "translate" unicode (%20) spaces, but any other charac-
ters sent with leading spaces will pass through to the LCD.
This is an example HTTP server using NichStack on MicroC/OS-II. The server can
process basic requests to serve HTML, JPEG, and GIF files from the Altera
read-only zip file system. It is in no way a complete implementation of a
full-featured HTTP server.
This example uses the sockets interface. A good introduction to sockets
programming is the book Unix Network Programming by Richard Stevens. Additionally,
the text "Sockets in C", by Donahoo & Calvert, is a concise & inexpensive text for
getting started with sockets programming.
To run the HTTP server, you must first program the file system using the Flash
Programmer utility of the Nios II IDE. The read-only zip file system contents
come from a .zip file ("ro_zipfs.zip" by default) in your application "syslib"
library project by default. When the web-server application is built, the
contents of this zip file are extracted and converted into a flash programming
file.
This file will be programmed into flash allowing the HTTP server
to fetch content at runtime.
To build & run the web-server application, perform the following steps:
=== I. BUILD PROJECT ===
1. After creating a new "Web Server" software example project and referring to
a Nios II "standard" or "full_featured" hardware example design .ptf file,
you may build it by choosing "Build All" from the Nios II IDE "Project"
menu.
2. Wait for the build process to complete. During the software build, the
files necessary to run this example are generated.
=== II. PROGRAM FLASH ===
1. Select the web-server application project (the default project name is
"web_server_0" unless specified otherwise during project creation).
2. From the "Tools" menu, select "Flash Programmer".
2. Select "Flash Programmer" under the list of "Configurations:".
3. Press New.
4. Press Program Flash.
Flash on your development board will now be programmed with the
web-server application, read-only zip file system contents, and a
boot-copier program. When your board is programmed with the standard
or full_featured .sof file, the web-server application will boot and
serve web content from flash in the read-only zip file system.
=== III. DEBUG ===
The above instructions will allow you to run the web server when the FPGA
has been configured. If you wish to manually download the web-server
application (for example, after making an edit and re-compiling), or if you
wish to debug the web-server application, the following steps apply:
1. Program the standard or full_featured design (.sof file) into the FPGA
using the Quartus II Programmer.
2. In the Nios II IDE, again select the web server application project.
3. From the "Run" menu, select "Debug..." (to launch the debugger) or
"Run..." (to download software to RAM and execute).
4. Select a "Nios II Hardware".
5. Press "New".
6. Press "Run" or "Debug" as appropriate.
=== Remote Configuration ===
Basic remote configuration features are included with this webserver. The
methodology chosen uses multipart forms (HTML standard) to upload the hardware
or software images and then a series of additional web pages to control the
flow.
The basic steps are:
1. Fill out the multipart-form.
- Choose the flash for your image when doing this.
NOTE: Only the Develop Kit flash names are currently supported.
- ext_flash(CFI)
- epcs_controller(EPCS)
If you have differing flash names, you'll need to change the web
content to reflect these names.
- Select the image you'd like to upload
- This is usually a .flash file produced (and tested) using
the flash programmer.
2. Upload your selected image.
- This could take a while, depending on the size of your image.
- On completion, a new page will load giving you a new form for programming
the flash.
3. Program the Flash
- Click the button in the form located on the Remote Configuration section
of this page and the flash will start programming.
- Again, this could take a while...
- Upon completion, you'll see a "reset system" option in the Remote
Configuration section.
4. Reset the System
- If this is the only image you need to update, then reset your system to
see if it functions.
- If you need to update more images (hardware or software) click the main
hyperlink (takes you back to the main/index page) and repeat steps
1-3 as necessary.
Note: This example will n
没有合适的资源?快使用搜索试试~ 我知道了~
all_test_3.rar_EP2C
共1864个文件
o:639个
d:639个
v:61个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 112 浏览量
2022-09-19
16:12:08
上传
评论
收藏 7.4MB RAR 举报
温馨提示
基于EP2C开发板实验小程序 内含全部代码管脚分配等
资源推荐
资源详情
资源评论
收起资源包目录
all_test_3.rar_EP2C (1864个子文件)
nios.ptf.5.10 141KB
libsimple_socket_server_0_syslib.a 1.13MB
libweb_server_0_syslib.a 1.09MB
libsimple_socket_server_1_syslib.a 1.07MB
liball_test_v5_syslib.a 456KB
altera_ro_zip_file_ok 42B
nios.ptf.bak 176KB
setup.tcl.bak 7KB
seg78led.v.bak 2KB
all_test_3.bdf 63KB
delay_reset_block.bdf 7KB
key_filter.bdf 7KB
key_filter.bdf 7KB
nios.bsf 13KB
altpll0.bsf 4KB
reset_counter.bsf 3KB
VGAsingl.bsf 2KB
lpm_rom0.bsf 2KB
delay_reset_block.bsf 2KB
key_filter.bsf 2KB
key_filter.bsf 2KB
memtest.c 43KB
http.c 31KB
ctrl_rtl8019.c 30KB
ctrl_rtl8019.c 29KB
simple_socket_server.c 25KB
simple_socket_server.c 23KB
network_utilities.c 18KB
alt_error_handler.c 18KB
alt_error_handler.c 18KB
network_utilities.c 18KB
network_utilities.c 16KB
beep_test.c 11KB
led.c 10KB
led.c 10KB
all_test.c 8KB
hello_led.c 8KB
oc_i2c.c 7KB
web_server.c 7KB
lwip_init.c 5KB
lcd_tri_12864.c 5KB
alt_sys_init.c 4KB
alt_sys_init.c 4KB
alt_sys_init.c 4KB
alt_sys_init.c 4KB
altera_avalon_pwm_routines.c 3KB
lwip_init.c 3KB
eeprom_main.c 3KB
ps2_test.c 2KB
key_main.c 2KB
dma_main.c 2KB
lcd_tri_1602.c 2KB
DA_AD.c 2KB
timer_test.c 1KB
key_task.c 1KB
uart_main.c 1KB
tlc5620_core_test.c 1KB
key.c 1KB
test_all.c 1001B
hello_altera_avalon_pwm.c 931B
ad_main.c 814B
pcf8563.c 812B
lcd_main.c 744B
main.c 705B
avalon_tlc5620.c 379B
alt_sys_init.c-t 42B
alt_sys_init.c-t 42B
alt_sys_init.c-t 42B
alt_sys_init.c-t 42B
all_test_3.cdf 340B
.cdtbuild 2KB
.cdtbuild 2KB
.cdtbuild 2KB
.cdtbuild 2KB
.cdtbuild 2KB
.cdtbuild 2KB
.cdtbuild 2KB
.cdtbuild 2KB
.cdtbuild 2KB
.cdtbuild 2KB
.cdtbuild 2KB
.cdtbuild 2KB
.cdtbuild 2KB
.cdtbuild 2KB
.cdtbuild 2KB
.cdtbuild 2KB
.cdtbuild 2KB
.cdtbuild 2KB
.cdtbuild 2KB
.cdtbuild 2KB
.cdtbuild 2KB
.cdtbuild 2KB
.cdtbuild 2KB
.cdtproject 2KB
.cdtproject 2KB
.cdtproject 2KB
.cdtproject 2KB
.cdtproject 2KB
.cdtproject 2KB
.cdtproject 2KB
共 1864 条
- 1
- 2
- 3
- 4
- 5
- 6
- 19
资源评论
weixin_42651887
- 粉丝: 79
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功