cancel
Showing results for 
Search instead for 
Did you mean: 

vTaskResume,vTaskSuspend

rajesh23
Associate II
Posted on August 02, 2016 at 11:42

     

 hi, i am using STM32F746G-Disco in that i have receiving a 16 byte of data from other device,which can be get at interrupt . problem: i have created two threads for GUI and Uart Thread, in that uart thread i have i amcontinuously polling for uart data has receivedcompletely.  Is there is anypossibility for resume task from whenever complete packet received from interrupt given below.  i have tried below code it was hangs some where can any one help me this issue regards rajesh    i have two threads 1. GUI and uart thread   /*

uart thread that resumes from interrupt when data buffer fills in uart RX.

*/

static

void

UartThread(

void

const

* argument )

{

static

uint8_t taskState = FALSE;

if

(taskState == TRUE)

{

taskState = FALSE;

while

(1)

{

HAL_Delay(100);

BSP_LED_Toggle(LED_GREEN);

}

}

else

{

if

(HAL_UART_Receive_IT(&UartHandle, (uint8_t *) aRxBuffer, 16) != HAL_OK)

{

}

else

{

vTaskSuspend(NULL);

taskState = TRUE;

}

}

}

/****

uart rx call back function

*****/

void

HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)

{

if

(huart->RxXferCount == 0x00)

{

vTaskResume(uartTaskhandle);

}

else

{

#iap-usart-uart-stm32f4discovery

2 REPLIES 2
Erwan YVIN
ST Employee
Posted on August 08, 2016 at 10:07

Hello Rajesh ,

You should post your issue in STM32 side

            Best regards

                           Erwan

Chris1
Senior III
Posted on January 26, 2017 at 22:56

Typically one would not suspend / resume tasks like this.  Instead, you could have a queue that your callback function sends a message to when it has all the data.  Your UartThread could call xQueueReceive() which would block (execution of UartThread) until a message is received in that queue.  You could use event signalling features similarly, if your RTOS provides that.