FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [April 2016 Threads]
Dear Support,
I've been evaluating the RTOS on the PIC24 platform and have been impressed. I've got tasks with priorities, messages queues, critical sections etc.
I wanted to have a play with a Mutex but the linker does not seem to like xSemaphoreCreateMutex() even though it is happy with my later use of xSemaphoreGive() and xSemaphoreTake() in the same file. Maybe I've missed a header file or a defintion somewhere but I'm stuck.
/* My includes */
include "FreeRTOS.h"
include "task.h"
include "semphr.h"
include "queue.h"
/* My Mutex handle */
static SemaphoreHandlet MutexHandleAppTestLED = NULL;
/* My Mutex creation */
void vApplicationMutex(void)
{
MutexHandle_AppTestLED = xSemaphoreCreateMutex();
}
// Error thrown by the linker...
: In function _vApplicationMutex':
: undefined reference to
xQueueCreateMutex'
build/default/production/ext/1472/ApplicationTask.o(.text+0x12): In function _vApplicationMutex':
: undefined reference to
_xQueueCreateMutex'
The function xSemaphoreCreateMutex() is in blue in the project, showing it is recognize as a function and 'Navigate to defintion' opens the file semphr.h at the extract below ( where the section is active in the compilation ).
if( configSUPPORTDYNAMICALLOCATION == 1 )
define xSemaphoreCreateMutex() xQueueCreateMutex( queueQUEUETYPEMUTEX )
endif
Please can you help ?
Kind regards,
Ady
Is configUSE_MUTEXES set to 1 in FreeRTOSConfig.h?
Many thanks that has solved it.
In fact configUSE_MUTEXES was not in FreeRTOSConfig.h at all else I would have given it a try !
I'd expect all configurable options to be in this file ?
That is quite an old demo, perhaps even created before there were
mutexes? http://www.freertos.org/a00110.html
OK fair enough. I used the demo to get up and running, I'll look for the latest FreeRTOS source.
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.