Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training


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 ]    [ Sitemap ]    [ ]

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists