:::: MENU ::::

Webserver on Spartan3E500 using Microblaze

NOTE: I suggest that you are not using the weberver examples that can be found on the internet or Xilinx site. Honestly I lost too many hours debugging why the designs can’t be compiled or why they aren’t working. Sooner or later you will realize that this designs were made by different version of EDK (Xilinx changed cores version with service packs) and fixing issues is time consuming. But nevertheless this made designs are treasures where you can find a lot of great piece of code.

Requirements:

  • Advanced use of EDK (IDE workflow and Debugging workflow)
  • Good Lwip and xilkernel knowledge
  • Understanding Memory management
  • Understanding file systems
  • Networking knowledge

Useful code:

  • LCD IP core (Spartan3A and Spartan6 example)
  • Spartan3E1600 webserver example
  • XAPP433
  • XAPP1026
  • XAPP1016

 

Lets Kick off, this tutorial will show how to crate a basic Microblaze system with all necessary peripheral to allow us access via web browser. The basic system is composed by following IP cores:

  • CPU (microblaze) only one but you can use more if you have newer EDK and bigger FPGA
  • IO pins (xps_gpio) LEDs, Buttons and Switches
  • Flash memory (xps_mch_emc)
  • Ethernet(Ethernet_MAC)
  • DDR SDRAM (mpmc)
  • Debug module(mdm)
  • Clock generator(clock_generator)
  • UART (xps_uartlite) I used DTE
  • Timer (xps_timer)
  • Interrupt controler(xps_intc)
  • System reset (proc_sys_reset)

 

Optional you can add own IPs or reuse one from (Spartan3AN example) ad use LCD core to show debugging messages on it instead of using terminal to debug the code. Because the Digilent Spartan3E500 rev.:D Starter Kit is supported by Board System Builder (BSB), you can use the wizard to crate your MB system. Your duty is only to check a few check boxes and to define all the necessary periphery.

 

STEP 1 – Setting up our MB system

Start the system builder wizard and go through.

  • Firstly select where your project will be stored. And press OK

Xilinx system builder EDK

  • On the second screen select »I would like to create new design« and press Next

Xilinx system builder EDK

  • From the drop-down menu select you board (Spartan3E500 rev.D, but you can use others) and press Next

Xilinx system builder

  • In processor section select Microblaze and press Next

Xilinx system builder EDK

  • Select operation frequency (Bus freq should be set max to 50MHz) add more Local memory (32kB), check use cache, FPU check box can be deselected and press Next

Xilinx system builder

  • IO interfaces: select DTE or DCE with XPS UARTLITE driver set to 9600-8-N-1 and interrupt option deselected and press Next

Xilinx system builder IO configuration

  • IO interfaces: select LEDs_8bit, DIP_Swithes_4bit, Buttons_4bit and flash and press Next

Xilinx system builder IO configuration

  • IO interfaces: select DDR_SDRAM and Ethernet_MAC with use interrupt and press Next

Xilinx system builder IO configuration

  • Add internal peripherals add timer with 32bit counter width One timer,use interrupt and press Next

Xilinx system builder IO configuration

  • Cache: both I and D cache are 2kB large and check only SDRAMs Dcache and Icache and press Next

Xilinx system builder RAM configuration

  • Software setup: Select STDIN/STDOUT depending one what you selected in IO interfaces (DTE or DCE) and use ilmb_ctrlr and Boot memory and press Next

Xilinx system builder RAM configuration

  • Configure memory test: Instruction: ilmb_cntlr, Data: dlmb_cntrl, Steak/Heap: dlmb_cntrl and press Next

Xilinx system builder RAM configuration

  • Configure peripheral test : For all three options use DDR_SDRAM and press Next

Xilinx system builder RAM configuration

  • System overview press Generate

Xilinx system builder overview

And here is a result of our work

System overview

This is the end of first part of tutorial dedicated to the Microblaze web-server project. Next part will describe in details the Microblaze core setting, Lwip settings and C code used to add the necessary functionality to make the system behave as standard web-servers.

19