Quality RTOS & Embedded Software

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


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 ]    [ Privacy ]    [ Sitemap ]    [ ]


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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

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

Xilinx Microblaze and Zynq partner