This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

ARM RTOS help required urgent

hello friends
i have written the code for ARM RTOS, i have used same priority for all of my 4 task, its working fine

my problem is when i change the priority in the code then all task's are not executing simultaneously....
please any one help

Parents
  • You normally never do force a single task to run for a specific time by trying to block the scheduler - it is more something used when having the simplest form of round-robin interaction or when something very special happens like a communication thread that instead of normal communication gets a new firmware where the real-time requirements gets dropped until the device have rebooted after the firmware update.

    Different tasks are created to solve different problems. Different problems that often have different priorities, where the priority can be used to avoid bad interaction from other threads. And real-time systems are normally designed to perform all prioritized tasks as short bursts before leaving the CPU capacity to lower-prioritized tasks. Often with lots of interrupt processing to allow high-prio tasks to sleep until the hardware detects special conditions.

    So you assign task priorities based on the importance of the work to be done. If the buzzer is the most important thing to do, then you may decide to give the buzzer task the highest priority. Then no other task will interfere with the buzzer task until the buzzer task performs a wait statement, waiting either a fixed time or waiting for an event or mail.

    Next thing - if you think about it - is that if that buzzer is a piezo, then you don't have to generate any wave frequency to get it to sound. You only have to turn on the power. Then you can have your processor busy doing other things while waiting until it's time to turn off the power.

    Didn't you read my previous post about writing down your different things you need to do, and figure out what priorities they should have and what things may be done concurrently and when a higher priority task should be performed in full before a lower prio task gets reactivated?

    You can't just program by random copy/paste of wait, set_event, ...

    When you do know what tasks to solve, and how they _need_ to interact, then it is easy to figure out what OS function calls you need to add to the different tasks - and where - to get that specific interaction.

Reply
  • You normally never do force a single task to run for a specific time by trying to block the scheduler - it is more something used when having the simplest form of round-robin interaction or when something very special happens like a communication thread that instead of normal communication gets a new firmware where the real-time requirements gets dropped until the device have rebooted after the firmware update.

    Different tasks are created to solve different problems. Different problems that often have different priorities, where the priority can be used to avoid bad interaction from other threads. And real-time systems are normally designed to perform all prioritized tasks as short bursts before leaving the CPU capacity to lower-prioritized tasks. Often with lots of interrupt processing to allow high-prio tasks to sleep until the hardware detects special conditions.

    So you assign task priorities based on the importance of the work to be done. If the buzzer is the most important thing to do, then you may decide to give the buzzer task the highest priority. Then no other task will interfere with the buzzer task until the buzzer task performs a wait statement, waiting either a fixed time or waiting for an event or mail.

    Next thing - if you think about it - is that if that buzzer is a piezo, then you don't have to generate any wave frequency to get it to sound. You only have to turn on the power. Then you can have your processor busy doing other things while waiting until it's time to turn off the power.

    Didn't you read my previous post about writing down your different things you need to do, and figure out what priorities they should have and what things may be done concurrently and when a higher priority task should be performed in full before a lower prio task gets reactivated?

    You can't just program by random copy/paste of wait, set_event, ...

    When you do know what tasks to solve, and how they _need_ to interact, then it is easy to figure out what OS function calls you need to add to the different tasks - and where - to get that specific interaction.

Children