cancel
Showing results for 
Search instead for 
Did you mean: 

vTaskSuspend,vTaskResume

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






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

{

#stm32f746-uart-and-freertos
1 REPLY 1
slimen
Senior
Posted on August 19, 2016 at 14:42

Hi,

You can insprire from STM32746G-DISCO examples and implement your code within STM32CubeF7 package from this path:

STM32Cube_FW_F7_V1.4.0\Projects\STM32746G-Discovery\Applications\FreeRTOS

Regards