The demo application has been tested on the following evaluation kit:
The Microblaze demo includes an FPGA Firmware design with several peripherals to demonstrate their integration with the RTOS.
The demo uses:
Please read all the following points before using this RTOS port.
See also the FAQ My application does not run, what could be wrong?
See the Source Code Organization section of the FreeRTOS site for a description of the downloaded files and information on creating a new project.
The Microblaze Demo application is designed to run a set of Common Demo Tasks, one of which is a UART loopback check. To enable this demo task to run without failing, please install a loopback (pins 2 and 3 of the UART connector).
The Spartan-3A is programmed and debugged using the Xilinx Platform Cable USB II Programmer/Debugger. You may be prompted to install various USB drivers the first time a USB connection is made between the evaluation board and a PC.
Within the ‘Xilinx Platform Studio’ open the your own project or the provided 'FreeRTOS_Demo_v7_XDK-Design/FreeRTOS_Demo_Design/FreeRTOS_Demo_Design.xmp'.
Select the ‘Project→Export Hardware Design to SDK’ menu item. This will generate a BitStream that can be used to program the hardware as well as generating a workspace for the SDK.
Launch the ‘Xilinx Software Development Kit’. When prompted for a Workspace, either create a new one or select the workspace that has been generated in the XPS project / SDK directory.
Within the XSDK select the ‘File→Import’ menu item and follow the wizard to import a ‘General→Existing Projects into Workspace’. Select the ‘Root Directory’ of the ‘FreeRTOS_Core_0’ project. Ensure that ‘Copy projects into workspace’ is ticked. The include paths are all relative to the project within the workspace.
Once the project has been included, ensure that it is linked with a Board Support Package. If a clean workspace was created, then it may be necessary to create a ‘File→New→Xilinx Hardware Platform Specification’ navigating to the XPS Project / SDK / SDK_Export / hw / system.xml which describes the hardware to the SDK. Additionally, a ‘File→New→Xilinx Board Support Package’ is required, linking it to the Hardware Description that was created in the last step and select the ‘standalone’ from ‘Board Support Package OS’.
Once a Hardware Description and Board Support Package are present in the workspace, right-click on the ‘FreeRTOS Demo’ project in the ‘Project Explorer’ view and select ‘Change referenced BSP’ to match the Board Support Package that was just created.
The Software can be built by selecting 'Build All..' from the 'Project' menu.
Use the ‘Xilinx Platform Studio’ to open the FPGA project and select the ‘Device Configuration→Download Bitstream’ menu item to program the FPGA. Note that there may be some licensing constraints imposed by the IP cores used in the FPGA design.
Switch to the ‘Xilinx Software Development Kit’. Select ‘Run→Debug Configurations…’ and within the dialog, right click ‘Xilinx C/C++ ELF’ and select ‘New Configuration’. This configuration should be set to download the ‘Debug/FreeRTOSDemo.elf’ file from the ‘FreeRTOS_Demo’ project. The default options for the rest of the configuration should be sufficient. Finally click the ‘Debug’ button. A reminder will be displayed regarding programming the FPGA.
The demo application creates 29 persistent tasks. These tasks consist predominantly of the standard demo application tasks (see the demo application section for details of the individual tasks).
When executing the demo application will behave as follows:
Configuration items specific to these demos are contained in FreeRTOS_Core_0/Demo/MicroBlaze/FreeRTOSConfig.h. The constants defined in this file can be edited to suit your application. In particular -
This sets the frequency of the RTOS tick. The supplied value of 1000Hz is useful for testing the kernel functionality but is faster than most applications require. Lowering this value will improve efficiency.
See the kernel configuration documentation for full information on these configuration constants.
Maps to the Interrupt Controller Device ID. Default:XPAR_INTC_0_DEVICE_ID
Maps to the Interrupt Controller Base Address. Default:XPAR_XPS_INTC_0_BASEADDR
Maps to the XPS Timer Device ID. Default:XPAR_XPS_TIMER_0_DEVICE_ID
Maps to the XPS Timer Base Address. Default:XPAR_XPS_TIMER_0_BASEADDR
Maps to the XPS Timer Interrupt Vector as defined in the Interrupt Controller. Default:XPAR_INTC_0_TMRCTR_0_VEC_ID
Maps to the XPS UART Device ID. Default:XPAR_RS232_UART_1_DEVICE_ID
Maps to the XPS UART Interrupt Vector as defined in the Interrupt Controller. Default:XPAR_INTC_0_UARTLITE_1_VEC_ID
Maps to the XPS GPIO Device ID for LEDs. Default:XPAR_LEDS_8BIT_DEVICE_ID
Each port #defines 'portBASE_TYPE' to equal the most efficient data type for that processor. This port defines portBASE_TYPE to be of type long.
Note that vPortEndScheduler() has not been implemented.
The MicroBlaze port uses the XPS Interrupt Controller to support Interrupt Service Routines. Please install ISRs by calling xPortInstallInterruptHandler() as defined in 'FreeRTOS_Core_0/Source/portable/GCC/MicroBlaze/port.c'.
Set the definition configUSE_PREEMPTION within FreeRTOS/Demo/MicroBlaze/FreeRTOSConfig.h to 1 to use pre-emption or 0 to use co-operative.
As 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.
Source/Portable/MemMang/heap_3.c is included in the MircoBlaze demo application project to provide the memory allocation required by the real time kernel. Please refer to the Memory Management section of the API documentation for full information.
The Linker script used to define the memory regions is 'FreeRTOS_Core_0/src/ldscript.ld'.