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


Error with xQueueCreate

Posted by Diamel Sarmiento on June 26, 2012
Hi, I'm ussing FreeRTOS and when i try to create a quoue the MPLAB Compiler give me the next error:

MPLINK 4.1, Linker
Copyright (c) 2006 Microchip Technology Inc.
Error - could not find definition of symbol 'xQueueCreate' in file 'Objects\main.o'.
Errors : 1

i'm doing as the Reference Manual says:

#define QUEUE_LENGHT 5
#define QUEUE_ITEM_SIZE sizeof( AMessage )

typedef struct A_Message
char ucMessageID;
char ucData[20];

} AMessage;

void main( void ){

xQueueHandle xQueue;


I hope someone can helpme, thanks.

RE: Error with xQueueCreate

Posted by Richard on June 27, 2012
I presume you have #include "FreeRTOS.h" and #include "queue.h" in you source file? Are you building queue.c as part of your project?

I suggest taking the demo project details on this page http://www.freertos.org/port_PIC32_MIPS_MK4.html as a start. There are both MPLAB 8 and MPLAB X project, and it includes a simple blinky demo that uses a couple of tasks and a queue. When that compiles (and runs) you can take the demo code out, leaving the FreeRTOS source files in, and add in your own code.


RE: Error with xQueueCreate

Posted by Diamel Sarmiento on June 28, 2012
thanks richard!! i can create a queue now, my misstake was the queue.c that i didnt have in the project..

Now my problem is when i try to use xQueueReceive, the reading is 0x66 ever, i put send and receive in the same task to find the problem:

static xQueueHandle xQueueUART;

void main( void ){

xQueueUART = xQueueCreate( 10, sizeof( portCHAR ) );



xTaskCreate( vtaskA, ( const char * const ) "T1", configMINIMAL_STACK_SIZE, NULL, PRIORITY_taskA, NULL );



static void vtaskA( void *pvParameters ){

int Data='A';
int Data2;


xQueueSend(xQueueUART,&Data,( portTickType ) 0);





RE: Error with xQueueCreate

Posted by Diamel Sarmiento on June 28, 2012
but write in USART 0x66 that is the Data2 valor.

RE: Error with xQueueCreate

Posted by Richard on June 29, 2012
Your queue is created to hold 8 bit types, and when you send data to the queue you pass it a pointer to a 32 bit type.

You are sending the letter 'A', which is ascii 65, so I would expect to receive decimal 65, not hex 66, but that might be something to do with the mismatch in types.


RE: Error with xQueueCreate

Posted by Diamel Sarmiento on July 6, 2012
you was right richard!! I changed the variable to char and now is working.

[ 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