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


STR91x PORT led demo bug?

Posted by johanan on August 27, 2007
The led flash demo should control 3 leds, with 3 different tasks, but only one led is working. Looking at the code I don't understand how it should work.
/* Create the three tasks. */
for( xLEDTask = 0; xLEDTask < ledNUMBER_OF_LEDS; ++xLEDTask )
/* Spawn the task. */
xTaskCreate( vLEDFlashTask, ( const signed portCHAR * const ) "LEDx", ledSTACK_SIZE, NULL, uxPriority, ( xTaskHandle * ) NULL );
But in order to create 3 different leds, the vLEDFlash must execute (in order to increment uxFlashTaskNumber),
and I don't think that xTaskCreat is executing the the function vLEDFlashTask(), it only take its address.

Am I wrong?

RE: STR91x PORT led demo bug?

Posted by Richard on August 27, 2007
Either I misunderstand your question or you have some misconceptions about how a multitasking system works. vLEDFlashTask() is not an ordinary function, but defines a task. The task executes autonomously (by itself). xTaskCreate() does not attempt to call vLEDFlashTask(), it creates the task that is defined by vLEDFlashTask(). As it is called three times it creates three such tasks, so when the scheduler takes control all three tasks run (pseudo) simultaneously and continuously.


RE: STR91x PORT led demo bug?

Posted by johanan on August 27, 2007
I understand. My miscoseption is from beeing a bit "object oriented" thinking that xCreate should create all the data structure that is needed for the task to run, which probably should have been done with the vParameters pointer. In the demo the led number is changed when the function starts before the endless loop.

I will look for the problem elswhere, probably in the 91x_vect.s (I did not use the demo supplied file, so probably its a problem with user/supervisor mode)


RE: STR91x PORT led demo bug?

Posted by johanan on August 27, 2007
Well, of course its in the 91x_vect.s file. Problem is that IAR made some changes in the file (IAR Ver 5.0)since the original one. Looks easy to change a few lines in the file so SWI will work. However I am so new to ARM that I don't wnat to do somthing I don't fully understand. ANy help will be apriciated. (I don't see how can attach a file to the post).

[ 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