2021-03-16 11:18 PM
hey there
there is a simple question: how can I receive data on my UART in DMA mode using RTOS? recently I ran a project where I just get all the data right when they arrived using UART DMA. but not I what the whole process to be done using RTOS. how can I do that?
2021-03-17 05:14 AM
HELP:
I added some tasks to just check state of a pin, but what happens is that the scheduler stucks in the task of UART receive... why? I mean the added task do not need any resources and all of them have same priority...
void UARTTask(void const * arg)
{
while(1)
{
HAL_IWDG_Refresh(&hiwdg); //Reload Watchdog inorder to prevent Micro Reset
UartDataRec_FUN();
}
}
void SEND_Initial_AT_Task(void const * arg)
{
while(1)
{
//stuff that I mentioned in privious posts ....
}
vTaskSuspend(SEND_Initial_AT_TaskHandle);
}
}
void CheckAntenna_Task(void const * arg)
{
while(1)
{
HAL_IWDG_Refresh(&hiwdg); //Reload Watchdog inorder to prevent Micro Reset
CheckAntenna();
}
}
it doesn't go through CheckAntenna_Task() and stucks in UARTTask() where it receives via UART DMA, whyyyyy????
2021-03-17 05:29 AM
Usually application isn't aware of length of data to receive. You may implement the approach as described on Github article:
https://github.com/MaJerle/stm32-usart-uart-dma-rx-tx
In a nutshell, it works like this: