The demo application has been tested on the following evaluation kits:
The LM3S6965 and LM3S8962 demos creates (amongst other tasks) a simple web server that can be used to both view run time information, and write data to the LED and OLED display on the EVB-LM3S6965/EVB-LM3S8962 evaluation board.
There is a separate documentation page describing how to build and debug the GCC version of this demo using the Eclipse Workbench and OpenOCD. Both of these tools are open source.
The demo uses:
FreeRTOS has made some modifications to the uIP stack since this demo was created. See the Embedded Ethernet Examples List page for more information.
Note for LM3S2965 and LM3S6965 users: The display part number changed on REV C evaluation kit boards. If you are using a REV C board then:
Note: If this project fails to build then it is likely the version of IAR Embedded Workbench being used is too old. If this is the case, then it is also likely that the project file has been (silently) corrupted and will need to be restored to its original state before it can be built even with an updated IAR version.
IMPORTANT! Notes on using the ARM Cortex-M3 Web Server DemoPlease read all the following points before using this RTOS port.
My application does not run, what could be wrong?
Source Code OrganisationSee the Source Code Organization section of the FreeRTOS site for a description of the downloaded files and information on creating a new project.
IAR project files
Keil uVision project files
The Demo Application
LM3S6965 / LM3S8962 Demo application setup
The web server will only be included in the build if mainINCLUDE_WEB_SERVER is set to 1 within main.c. Excluding the web server allows the application to be built using the KickStart version of the IAR Embedded Workbench.
Connect the EVB-LM3S6965 or EVB-LM3S8962 development board to a computer running a web browser either directly using a point to point (crossover) cable, or via a hub/router using a standard Ethernet cable. The prototyping board may also allow the use of a standard Ethernet cable when connecting point to point, but I have not tried this configuration.
The IP address used by the demo is set by the constants uipIP_ADDR0 to uipIP_ADDR3 within the file FreeRTOS/Demo/CORTEX_LM3Sxxxx_IAR_Keil/uIP_Task.c. The IP addresses used by the web browser computer and the prototyping board must be compatible. This can be ensured by making the first three octets of both IP addresses identical. For example, if the web browser computer uses IP address 192.168.100.1, then the prototyping board can be given any address in the range 192.168.100.2 to 192.168.100.254 (barring any addresses already present on the network).
The evaluation kits read their MAC address from their internal memory, removing the need for this to be manually configured.
The demo application uses the LED and OLED display built onto the prototyping board so no other hardware setup is required.
The EVB-LM3S6965 / EVB-LM3S8962 is powered, programmed and debugged through the single micro USB connector. You will be prompted to install various USB drivers the first time a USB connection is made between the evaluation board and a PC. The required USB drivers can be obtained from the Luminary Micro CD, or from the Luminary Micro website.
EVB-LM3S2965 / EVB-LM3S1968 demo application setupNote the comments at the head of this page regarding the selection of the correct display driver.
The LM3S2965 and LM3S1968 demos do not require any specific configuration.
Building and executing the demo application
FunctionalityThe demo application creates 20 persistent tasks, and periodically dynamically creates and destroys another 2. These tasks consist predominantly of the standard demo application tasks (see the demo application section for details of the individual tasks).
The following tasks and tests are created in addition to the standard demo tasks:
When executing correctly the demo application will behave as follows:
Served Web Pages (LM3S6965 and LM3S8962 only)The top of each served page includes a menu containing a link to every other page.
The served RTOS stats page
The RTOS stats page provides run time information on the state of each task within the system - including the stack high water mark (the minimum amount of stack there has been available at any time since the task started executing). The page will reload approximately every two seconds - depending on network load.
This page is transmitted in three sections - the HTML header and menu, the dynamically generated content, then finally the HTML footer. This makes the page relatively fast to load. It could be optimised further by transmitting the entire page in one go.
The continuous reloading can sometimes make navigating away from the RTOS stats page a little tricky.
The served IO page
The IO page provides a simple interface that permits data to be sent to the LED and OLED display on the development board.
The check box permits the state of the user LED to be set and queried. The text box can be used to write a message to the OLED display, but does not query the text currently being display. Changes are sent to the target hardware by clicking the "Update IO" button.
The TCP Stats and Connections pages display run time networking information. Note that these pages transmit each line individually so will not load quickly. This demonstrates how memory usage can be optimised through the use of a small transmit buffer by sacrificing the achieved data throughput.
RTOS port specific configurationConfiguration items specific to these demos are contained in FreeRTOS/Demo/CORTEX_LM3Sxxxx_IAR_Keil/FreeRTOSConfig.h. The constants defined in this file can be edited to suit your application. In particular -
The lowest priority on a ARM Cortex-M3 core is in fact 255 - however different ARM Cortex-M3 vendors implement a different number of priority bits and supply library functions that expect priorities to be specified in different ways. Use the supplied examples as a reference.
Each port #defines 'BaseType_t' to equal the most efficient data type for that processor. This port defines BaseType_t to be of type long.
Note that vPortEndScheduler() has not been implemented.
Interrupt service routinesIn the demo application the vector table remains in flash.
Unlike most ports, interrupt service routines that cause a context switch have no special requirements and can be written as per the compiler documentation. The macro portEND_SWITCHING_ISR() can be used to request a context switch from within an ISR.
Note that portEND_SWITCHING_ISR() will leave interrupts enabled.
Switching between the pre-emptive and co-operative RTOS kernelsSet the definition configUSE_PREEMPTION within FreeRTOS/Demo/CORTEX_LM3Sxxxx_IAR_Keil/FreeRTOSConfig.h to 1 to use pre-emption or 0 to use co-operative.
Compiler optionsAs with all the ports, it is essential that the correct compiler options are used. The best way to ensure this is to base your application on the provided demo application files.
Memory allocationSource/Portable/MemMang/heap_2.c is included in the ARM Cortex-M3 demo application project to provide the memory allocation required by the RTOS kernel. Please refer to the Memory Management section of the API documentation for full information.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.