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

undefined reference to '_xQueueCreateMutex'

Posted by ady001 on April 28, 2016

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 toxQueueCreateMutex' 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


undefined reference to '_xQueueCreateMutex'

Posted by davedoors on April 28, 2016

Is configUSE_MUTEXES set to 1 in FreeRTOSConfig.h?


undefined reference to '_xQueueCreateMutex'

Posted by ady001 on April 28, 2016

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 ?


undefined reference to '_xQueueCreateMutex'

Posted by rtel on April 28, 2016

That is quite an old demo, perhaps even created before there were mutexes? http://www.freertos.org/a00110.html


undefined reference to '_xQueueCreateMutex'

Posted by ady001 on April 28, 2016

OK fair enough. I used the demo to get up and running, I'll look for the latest FreeRTOS source.


[ 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