FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [August 2007 Threads] 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.
Regards.
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)
Thanks, Johanan
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). Regards, Joahanan
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|