Microsemi FPGAs Fusion Webserver Demo Using uIP and FreeRTOS User Guide

June 9, 2024
Microsemi

Microsemi FPGAs Fusion Webserver Demo Using uIP and FreeRTOS User Guide
Microsemi FPGAs Fusion Webserver Demo Using uIP and
FreeRTOS

Introduction

The Fusion Webserver demo is designed for the Fusion Embedded Development Kit (M1AFSEMBEDDED-KIT), which demonstrates the use of Microsemi’s Fusion® mixed signal FPGAs with an embedded ARM® Cortex™- M1 processor for power management and webserver support.
Fusion integrates configurable analog, large flash memory blocks, comprehensive clock generation and management circuitry, and high-performance, flash-based programmable logic in a monolithic device.
The Fusion architecture can be used with the Microsemi soft microcontroller (MCU) core as well as the performance-maximized 32-bit Cortex™-M1cores.
In this demo, Free RTOS™ is running on the Cortex-M1 processor, while managing various tasks, such as ADC sampling, web service, and LED toggling. The UART- based Serial Terminal communication and I 2C-based OLED interface are provided for user interaction.
These tasks are explained in detail in the following sections.
The programming and design files can be downloaded from:
www.microsemi.com/soc/download/rsc/?f=M1AFS_Webserver_uIP_RTOS_DF.

Webserver Demo Requirement

  • M1AFS-EMBEDDED-KIT board
  • USB cable for power
  • Second USB cable if device needs to be programmed
  • Ethernet cable and internet connection (for web server option)
  • PC must be connected to the network to use the web server
    Note: This demo is intended for the advanced users.

Cortex-M1 Enabled Fusion Embedded Kit (M1AFS-EMBEDDED-KIT)
The Fusion Embedded Development Kit Board is intended to provide a low-cost embedded system management platform for evaluating the Fusion FPGA advanced features, such as mixed signal and embedded processor development.
The Fusion FPGA on this kit is M1-enabled for ARM Cortex-M1 or Core 8051s embedded processor development.

In addition, the Fusion Embedded Development Kit Board consists of a variety of features for mixed signal applications, such as voltage sequencing, voltage trimming, gaming, motor control, temperature monitor, and touch screen.
Figure 1 • Fusion Embedded Development Kit Top View
Development Kit View

For a detailed description of board-level components, refer to the Fusion Embedded Development Kit
User’s Guide: www.microsemi.com/soc/documents/Fusion_Embedded_DevKit_UG.pdf.

Design Description

The Fusion Webserver demonstration design example demonstrates the functionality of the Fusion FPGA device and various Microsemi IP cores, including Cortex-M1 processor, CORE10100_AHBAPB (Core10/100 Ethernet MAC), Core UARTapb, CoreI2C, Core GPIO, Core AI (analog Interface), Core AHBNVM, Core AHBSRAM, and Core Mem Ctrl (to access external SRAM and Flash memory
resources).
Microsemi provides firmware drivers for Microsemi IP cores.
The demo options can be controlled by switches (SW2 and SW3) by following the display options on the OLED or through serial communication program such as HyperTerminal or PuTTy and keyboard, simultaneously.
These two modes run in parallel and you can select different options in each mode using the switches or keyboard.
Here network communication is established using the uIP stack with the 10/100 Ethernet MAC core driver.
Figure 2 • Design Flow Chart
Design Description
The design is divided into the following tasks to meet the functional requirements.

LED Test
The LED test function drives general purpose inputs/outputs (GPIOs) in such a way that LEDs blinking provides a running visualization effect.
The following example code shows the call of GPIO driver function.
gpio_pattern = GPIO_get_outputs(&g_gpio);
gpio_pattern ^= 0x0000000F;
GPIO_set_outputs(&g_gpio, gpio_pattern);

ADC_task
This function reads the values from the analog-to-digital converter (ADC).
The example code and use of the driver functions is shown below.
CAI_init( COREAI_BASE_ADDR ); while( 1 )
{ CAI_round_robin( adc_samples );
process_samples( adc_samples );

Standalone_task
This task manages the demo through switches SW2 and SW3.
The menus for these switches are displayed on the OLED.
You can navigate to the menu with switches by using the help displayed on the OLED.
This task runs in parallel with HyperTerminal task.

Serial terminal task
This task manages the UART port.
It also displays the demo menu on UART serial terminal, accepts the user input, and performs the tasks according to the input selected.
It runs in parallel with the standalone task. Simultaneously, you can navigate the demo by using Serial Terminal Program and SW2 and SW3 switches.

This demo uses open-source software components like Free RTOS v6.0.1 and uIP stack v1.0 for OS support and TCP/IP functionality respectively.
The details of these open-source software are described in the following sections.

uIP Stack
The uIP TCP/IP stack was developed by the Networked Embedded Systems group at the Swedish Institute of Computer Science and is available for free at: www.sics.se/~adam/uip/index.php/Main_Page.
The Fusion web server is built as an application running on top of the uIP TCP/IP stack. HTML CGI interfaces are used to exchange the real-time data from the Fusion board and the user web page (web client).

  • The webTask() API is the main entry code for the web server application.
  • The mac_init() API call initializes the Ethernet MAC and gets the DHCP open network IP address.
  • The uIP_Init() API call takes care of initialization of all the uIP TCP/IP stack settings and calls the web server application call httpd_init().

Free RTOS

The FreeRTOS™ is a portable, open-source, royalty free, mini Real Time Kernel (a free to download and free to deploy RTOS that can be used in the commercial applications without any requirement to expose your proprietary source code).
The Free RTOS is a scale able Real Time Kernel designed specifically for small embedded systems.
For more information, visit the Free RTOS website: www.freertos.org.

Routing the NVIC interrupts to the Free RTOS

The following NVIC interrupts are routed to the Free RTOS interrupt handlers in the user boot code:

  • Sys tick Handler
  • SVC Handler
  • Pend SVC handler

Note: The Free RTOS configuration is done in the file ‘free RTOS Config. h’.

Demo Setup

Jumper Settings of the Boards

Connect the Jumpers using the settings given in the Table 1.
Table 1 Jumper Settings

Jumper Setting Comment
JP10 Pin 1-2 Jumper to select either 1.5 V external regulator or Fusion 1.5

V internal regulator.

  • Pin 1-2 = 1.5 V internal
  • Pin 2-3 = 1.5 V external

J40| Pin 1-2| Jumper to select power source.

  •      Pin 3-2 = 5 V power brick
  • Pin 1-2 = USB

Hooking Up the Board and UART Cables
Connect one USB cable between J2 (USB connector) on the board and the USB port of your PC to power up the board and for UART communication. Connect Microsemi Low Cost Programmer stick (LCPS) to jumper J1 and then connect it to USB port of your PC using other USB cable for device programming.

Hooking Up the Board and Ethernet Cable
Connect an Ethernet cable from the Local Area Network (LAN) to J9, the Ethernet jack on the board.
Note: For the board Ethernet test to pass, the local network must be running a DHCP server that assigns an IP address to the web server on the board.
Network firewalls must not block the board web server.
Also the PC Ethernet card link speed should be in auto detect mode or fixed to 10 Mbps speed.

Programming the Board
You can donwload the design and STAPL files from the Microsemi SoC Products Group website:
www.microsemi.com/soc/download/rsc/?f=M1AFS_Webserver_uIP_RTOS_DF
The downloaded folder contains Hardware and Programming folders having hardware project created with Microsemi Libero system-on-chip (SoC) and programming file (STAPL file) respectively.
Refer to the Readme.txt file included in the design files for directory structure and description.

Running the Demo

Program the board using the provided STAPL file. Reset the board.
The OLED displays the following message:
“Hi! I am Fusion
Want to Play?”
After few seconds the main menu is displayed on the OLED screen:
SW2: Multimeter
SW3: Menu Scroll
The above message indicates that switch SW2 should be used to select Multimeter option and switch SW3 should be used to scroll through the options provided into the demo.
Note: This application provides the flexibility to scroll through the demo option on serial terminal simultaneously through UART communication port.

Multimeter Mode
Press SW2 to select the Multimeter mode. OLED displays the voltage, current, and temperature readings from the configured ADC.
Vary the POT provided on board to change the value of the voltage and current.
Running values of the voltage, current, and temperature are displayed on the OLED.
Press SW2 to go back to the main menu.

Webserver Mode
Press SW3 to scroll through the options.
The OLED displays the following message:
SW2: Web Server
SW3: Menu Scroll
Press SW2 to select the Web Server option. OLED displays the IP address captured by DHCP from network.
Make sure that Ethernet cable is connected to the board and network.
Internet explorer6.0 or later version should be used to run the Web Server utility.
Enter the IP address displayed on OLED in the address bar of the Internet explorer to browse through the web server.

The following figure shows the home page of the web server that appears in the Internet explorer.
Figure 3 • Web Server Home Page
Home Page Web Server

Multimeter

Select the Multimeter option from the Web Server home web page.
It displays the voltage, current, and temperature values as shown in Figure 4. Click Home to go back to the home page.
Figure 4 • Webserver Multimeter Page Display
Multimeter

Real Time Data Display
Select the Real Time Data Display button from the home page.
It displays the voltage, current, and temperature values in real time.
Here, the web page refreshes periodically and displays the updated values of voltage, current, and temperature.
Vary the potentiometer on the board and observe the change in the voltage and current values as shown in Figure 5.
Click Home to go back to the home page.
Figure 5 • Webserver Real Time Data Display
Data Display

Fusion Gadgets
Select the Gadgets button from the home page.
You must have internet connection with proper access rights to get the gadgets page.
The gadget page displays different applications like calendar and US Zip Code Lookup as shown in Figure 6.
Click Home to go back to the home page.
Figure 6 • Webserver Gadgets
Fusion Gadgets

Fusion Stock Ticker
Select the Stock Ticker button from the home page.
You must have internet connection with proper access rights to get to the Stock Ticker page.
The Stock Ticker page displays the stock prices in NASDAQ as shown in Figure 7.
Click Home to go back to the home page.
Figure 7 • Webserver Stock Ticker
Fusion Stock

LED Test
Press SW3 to scroll the menu on OLED. The OLED displays the following message:
SW2: LED Test
SW3: Menu Scroll
Press SW2 to select LED test. Running LED pattern is displayed on board. Press SW3 for main menu.

Display on Serial Terminal Emulation Program

Demo options can be seen on the serial terminal emulation program simultaneously.
Serial terminal emulation programs such as HyperTerminal, Putty or Tera Term should be used for the serial communication.
Refer to the Configuring Serial Terminal Emulation Programs tutorial for configuring the HyperTerminal, Tera Term, and Putty.

Configure the Serial terminal emulation program with the following settings:

  • Bits per second: 57600
  • Data bits: 8
  • Parity: None
  • Stop bits: 1
  • Flow control: None
    In this demo, HyperTerminal is being used as serial terminal emulation program.
    Press SW1 to reset the system. HyperTerminal window should display a greeting message and play menu as shown in Figure 8.
    Figure 8 • Menu Display on Serial Terminal Program
    Emulation Program

Multimeter
Press “0” to select the Multimeter.
The Multimeter mode shows the values of voltage, current, and temperature on HyperTerminal.

Web Server
Press “1” to select the web server mode.
The system captures the IP address and displays on HyperTerminal.
Browse the captured IP address in the internet explorer to display the web server utility.
Note: Use internet explorer 6.0 or later version for better view of the web page.

LED Test
Press “2” to select the LED Test. Observe the blinking of LEDs on the board.

List of Changes

The following table lists critical changes that were made in each revision of the chapter.

Date Changes Page
50200278-1/02.12 The “Demo Setup” section was revised. 7
Figure 3 was updated. 9
Figure 6 was updated. 12
Figure 7 was updated. 13
Figure 4 was updated. 10
Figure 5 was updated. 11

Note: The part number is located on the last page of the document.
The digits following the slash indicate the month and year of publication

Product Support

Microsemi SoC Products Group backs its products with various support services, including Customer Service, Customer Technical Support Center, a website, electronic mail, and worldwide sales offices.
This appendix contains information about contacting Microsemi SoC Products Group and using these support services.

Customer Service
Contact Customer Service for non-technical product support, such as product pricing, product upgrades, update information, order status, and authorization.

From North America, call 800.262.1060
From the rest of the world, call 650.318.4460
Fax, from anywhere in the world, 650.318.8044

Customer Technical Support Center
Microsemi SoC Products Group staffs its Customer Technical Support Center with highly skilled engineers who can help answer your hardware, software, and design questions about Microsemi SoC Products.
The Customer Technical Support Center spends a great deal of time creating application notes, answers to common design cycle questions, documentation of known issues, and various FAQs.
So, before you contact us, please visit our online resources.
It is very likely we have already answered your questions.

Technical Support
Visit the Customer Support website (www.microsemi.com/soc/support/search/default.aspx) for more information and support.
Many answers available on the searchable web resource include diagrams, illustrations, and links to other resources on the website.

Website
You can browse a variety of technical and non-technical information on the SoC home page, at: www.microsemi.com/soc.

Contacting the Customer Technical Support Center
Highly skilled engineers staff the Technical Support Center.
The Technical Support Center can be contacted by email or through the Microsemi SoC Products Group website

Email
You can communicate your technical questions to our email address and receive answers back by email, fax, or phone. Also, if you have design problems, you can email your design files to receive assistance.
We constantly monitor the email account throughout the day.
When sending your request to us, please be sure to include your full name, company name, and your contact information for efficient processing of your request.
The technical support email address is: soc_tech@microsemi.com

My Cases
Microsemi SoC Products Group customers may submit and track technical cases online by going to My Cases.

Outside the U.S.
Customers needing assistance outside the US time zones can either contact technical support via email (soc_tech@microsemi.com) or contact a local sales office.
Sales office listings can be found at: www.microsemi.com/soc/company/contact/default.aspx.

ITAR Technical Support
For technical support on RH and RT FPGAs that are regulated by International Traffic in Arms Regulations (ITAR), contact us via soc_tech_itar@microsemi.com.
Alternatively, within My Cases, select Yes in the ITAR drop-down list.
For a complete list of ITAR-regulated Microsemi FPGAs, visit the ITAR web page.

Microsemi Corporation (NASDAQ: MSCC) offers a comprehensive portfolio of semiconductor solutions for: aerospace, defense and security; enterprise and communications; and industrial and alternative energy markets.
Products include high-performance, high-reliability analog and RF devices, mixed signal and RF integrated circuits, customizable SoCs, FPGAs, and complete subsystems.
Microsemi is headquartered in Aliso Viejo, Calif. Learn more at: www.microsemi.com.

SUPPORT

Microsemi Corporate Headquarters
One Enterprise, Aliso Viejo CA 92656 USA
Within the USA: +1 949-380-6100
Sales: +1 949-380-6136
Fax: +1 949-215-4996
Logo.png

References

Read User Manual Online (PDF format)

Read User Manual Online (PDF format)  >>

Download This Manual (PDF format)

Download this manual  >>

Related Manuals