This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/MSP430F5659: Need guide for task sync

Part Number: MSP430F5659


Tool/software: TI-RTOS

Hello,

I have 3 task,

Comm Task(USB Rx/Tx), Data Manager Task and Handler task(UART RX/TX),

I want to sync the comm task  and Handler task, such that once i receive the USB command related UART handling, i want to lock the other USB command, or just send busy response until UART command processing is done. Which locking mechanism/blocking mechanism is good for this.

See pseudo code below.

Comm Task()

{

if(wait for the process to complete)

{

send command to Handler task

}

else

{

send busy response to USER Application over USB

}

}

Handler Task

{

Receive the command

Lock the OS flag/ call the Sync Mechanism

do the UART communication

release once done

}

Can any one guide me ,

i tried GateMutex enter and gateMutex Leave  in Handler task , and Gatemutes Query in Comm task, I could not achieve the intended results,

Please guide me how i can achieve this, with good locking mechanism, I don't want to use Global variable mechanism, i want to use OS concept here.

How to lock using Semaphore?

Thanks in advance

Nitesh

**Attention** This is a public forum