Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT




Loading

binary semaphore issue

Posted by tomirtos on October 31, 2014

Hi Everyone!

I'm giving a binary semaphore from task1 to task2. If task1 receives the correct string from UART, that is when it gives the binary semaphore to task2. Task2 will read data from an ADC and send it via the UART to the PC.

The problem is that on the first run or after every reset of the microcontroller Task2 automatically writes to the UART without task1 giving it the semaphore.

Is this a generic problem that the task can take the semaphore on the first startup of the program? Are there any work arounds for this?

My code is quite large I think, so thats why I don't post it right now. If there are no general solutions to this I will try and strip the code to a simple one which still exhibits this error.

Cheers, Tomi


binary semaphore issue

Posted by rtel on October 31, 2014

Please see the reply to this question: http://www.freertos.org/FreeRTOSSupportForumArchive/August2014/freertosxSemaphoreTakebinarynotwaitingtobegiven04bfabb9j.html

Regards.


binary semaphore issue

Posted by tomirtos on October 31, 2014

Thank you very much for the fast help! This has solved my problem!

I was using vSemaphoreCreateBinary(); and I only had to change it to xSemaphoreCreateBinary(); to solve the problem.

Cheers, Tomi


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS