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

PIC24 counting semaphores:

Posted by paraparvy on July 3, 2016

Hi All,

Having difficulty in tyring to create counting semaphores in PIC24 port.

SemaphoreHandle_t xCountingSemaphore;

xCountingSemaphore = xSemaphoreCreateCounting(5,0);

The above lines generate the following errors: (...can't see anything to configure in FreeRTOSConfig.h i.e configSUPPORTDYNAMICALLOCATION is not defined)

nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed build/default/production/ext/1472/mainInterruptBinSemaTut.o(.text+0x8c): In function .L0': : undefined reference toxQueueCreateCountingSemaphore' build/default/production/ext/1472/mainInterruptBinSemaTut.o(.text+0x8e): In function .L0': : undefined reference to_xQueueCreateCountingSemaphore' make[2]: *** [dist/default/production/FreeRTOSTutorial.X.production.hex] Error 255 make[1]: *** [.build-conf] Error 2 make: *** [.build-impl] Error 2

BUILD FAILED (exit value 2, total time: 3s)

Thanks


PIC24 counting semaphores:

Posted by rtel on July 3, 2016

If you look at the implementation of xQueueCreateCountingSemaphore() you will see it is guarded by:

#if( ( configUSE_COUNTING_SEMAPHORES == 1 ) && ( 
configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )

Do you have both configUSECOUNTINGSEMAPHORES and configSUPPORTDYNAMICALLOCATION set to 1?


PIC24 counting semaphores:

Posted by paraparvy on July 4, 2016

Hi, Thanks for getting back.

No, configUSECOUNTINGSEMAPHORES and configSUPPORTDYNAMICALLOCATION do not appear to be declared anywhere...or at least i could't find them.

Should I define and set them in FreeRTOSConfig.h ?

Cheers


PIC24 counting semaphores:

Posted by davedoors on July 4, 2016

Only if you want to use counting semaphores.


PIC24 counting semaphores:

Posted by paraparvy on July 4, 2016

OK, thanks Dave


PIC24 counting semaphores:

Posted by paraparvy on July 4, 2016

Hi All,

Counting semaphores are now OK...having trouble compling Mutex:

SemaphoreHandle_t xMutex; xMutex = xSemaphoreCreateMutex();

configSUPPORTDYNAMICALLOCATION is set to 1 in FreeRTOSConfig.h ...and i think that is all that is needed in semphr.h

Cheers

nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed build/default/production/ext/1472/mainMutex1Tut.o(.text+0x50): In function .L0': : undefined reference to_xQueueCreateMutex' build/default/production/ext/1472/mainMutex1Tut.o(.text+0x52): In function .L0': : undefined reference to_xQueueCreateMutex'


PIC24 counting semaphores:

Posted by rtel on July 4, 2016

Either search for the word "Mutex" on the configuration options web page (http://www.freertos.org/a00110.html), or search for xQueueCreateMutex in the source code (the "queue" in the function name tells you it is implemented in queue.c) - then you will be able to answer your own question.


PIC24 counting semaphores:

Posted by paraparvy on July 4, 2016

OK, needed to declare and set configUSE_MUTEXES, all fine now Thank you so much


[ 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