AnsweredAssumed Answered

vTaskResume,vTaskSuspend

Question asked by d.rajesh.001 on Aug 16, 2016
Latest reply on Aug 19, 2016 by Osto





01.

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 am continuously polling for uart data has received completely.

Is there is any possibility 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


/*
02.uart thread that resumes from interrupt when data buffer fills in uart RX.
03. 
04.*/
05. 
06. 
07.static void UartThread( void const * argument )
08.{
09.    static uint8_t taskState = FALSE;
10.    if(taskState == TRUE)
11.    {
12.        taskState = FALSE;
13.        while(1)
14.        {
15.            HAL_Delay(100);
16.            BSP_LED_Toggle(LED_GREEN);
17.        }
18. 
19.    }
20.    else
21.    {
22.        if (HAL_UART_Receive_IT(&UartHandle, (uint8_t *) aRxBuffer, 16) != HAL_OK)
23.        {
24. 
25.        }
26.        else
27.        {
28.            vTaskSuspend(NULL);
29.            taskState = TRUE;
30.        }
31.    }
32. 
33.}
34. 
35./****
36.uart rx call back function
37.*****/
38.void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
39.{
40.    if(huart->RxXferCount == 0x00)
41.    {
42.        vTaskResume(uartTaskhandle);
43.    }
44.    else
45.    {

Outcomes