2016-08-02 02:42 AM
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 *****/ voidHAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{if
(huart->RxXferCount == 0x00)
{
vTaskResume(uartTaskhandle);
}
else
{
#iap-usart-uart-stm32f4discovery2016-08-08 01:07 AM
Hello Rajesh ,
You should post your issue in STM32 side Best regards Erwan2017-01-26 01:56 PM
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.