Quality RTOS & Embedded Software

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




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) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists