Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


RTOS in Spartan 3

Posted by chuck12 on December 18, 2007

The demo for microblaze included in the RTOS file, is for another board, not for spartan 3 revision e(the board that i'm using). Does anyone was able to put it in my board? what changes do i have to make to work properly? tks in advance

RE: RTOS in Spartan 3

Posted by Richard on December 18, 2007
I am not familiar with your board, but I would suggest the following approach.

1) Start from the existing demo - first take a look at prvSetupHardware() in main.c to see if any changes are required for your hardware.

2) Next edit partest.c so that it control the LED's (or any other measurable output) on your hardware.

3) In main(), before the call to start the scheduler, add some very simple code that just toggles the LED's to check you changes to partest.c are correct. For example:

volatile unsigned long ul;
for( ;; )
____for( ul = 0; ul < 0xfffff; ul++ ); // Basic delay.
____vParTestToggleLED( 0 );
____vParTestToggleLED( 1 );
____vParTestToggleLED( 2 );
____vParTestToggleLED( 3 );

4) Next you need to check the tick timer functionality. Look in port.c, prvSetupTimerInterrupt(), and make any changes necessary for your hardware configuration. This routine sets up the tick interrupt at the required frequency using one of the peripheral timers.

5) Check the timer operation by writing a very simple interrupt handler that does nothing but toggles an LED - remove any RTOS specific code so just write the handler as if it were a normal ISR. You might want to toggle an LED every 1000 ticks, so you can visually see the behaviour and take some crude timing measurements by watching the LED. Also, you might want to toggle the LED directly rather than use the partest.c functions as the partest.c functions use critical sections that might mess up your ISR.

6) Once you have the LED's and timer running you are ready to get the whole system up and running. Put the timer interrupt routine back to its original code, and install it in exactly the same manner as per the example. Then cut down the number of tasks that are created, start with just the flash tasks. main() will then look something like this:

int main (void)


____/* Start the standard demo application tasks. */
____vStartLEDFlashTasks( mainLED_TASK_PRIORITY );

____/* Finally start the scheduler. */

____/* Should not get here as the processor is now under
____control of the scheduler! */

____return 0;

Once this is working then add back in the other demo tasks. Take care about your RAM usage, I don't know how much you have available on your hardware.


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers


STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner