STM32 FreeRTOS
I am using STM32F072RB.
I have enable the FreeRTOS CMSIS1.
I have created two tasks which uses the same UART for transmitting data.
I want to use the semaphore concept to use this shared resource between two task.
The task as belows:
TASK 1 High priority
void StartTask02(void const * argument)
{
/* USER CODE BEGIN StartTask02 */
/* Infinite loop */
for(;;)
{
uint8_t data[1];
data[0] = 65;
HAL_UART_Transmit_IT(&huart1, &data, 1);
}
/* USER CODE END StartTask02 */
}
Task 2 Low priority
void StartTask03(void const * argument)
{
/* USER CODE BEGIN StartTask03 */
/* Infinite loop */
for(;;)
{
osSemaphoreWait (myBinarySem01Handle, 100);
uint8_t data[1];
data[0] = 66;
HAL_UART_Transmit_IT(&huart1, &data, 1);
osSemaphoreRelease (myBinarySem01Handle);
}
/* USER CODE END StartTask03 */
}
I tried to use the semaphore, but didnt get the proper result. I continuously getting data from task1 even if I used semaphore in task 2.
Kindly correct me if anything is wrong....
