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

xQueue

Posted by Andrew Hankins on August 24, 2009
Hi,
Running freertos on AVR UC3A EVK1100 dev board and I have run into a few problems using queues.
I have two task, one which receives data from usb connection and another which does something with the data. I wish to setup up a queue to communicate between the two.
However whenever I attempt to place data onto the queue I can only add 1 item, despite the fact the queue is 32 items deep. If I add another element the code crashes and nothing else on the board continues to run.
Has anyone else had any issues, or can post some sample code demonstrating queue usuage between threads.
Currently I am declaring a global variable and using createqueue() inside one of the tasks.

Cheers
Andrew

RE: xQueue

Posted by Dave on August 25, 2009
There are loads of examples in the demo/common/minimal directory of the download. Most likely you are passing bum data. Data is copied into the queue and then copied out so if you queue a pointer to some data make sure the data pointed to is not on a stack or anywhere else it could get overwritten. Also never use a standard queue function in an interrupt, only use the ones with FromISR in their name.

RE: xQueue

Posted by Andrew Hankins on August 26, 2009
FIXED: Was infact a problem with the linker settings. Narrowed it down to the memcpy instruction and it turns out the projects that come with the software framework I am using have a bogus linker option.
Fix from sma on avrfreaks

Well, the real question is: what are your gcc -mpart and -march options?
The UC3 memcpy() supports all alignements so this is not the problem. I suspect you link with something like -march=uc instead of -march=ucr1 (uc3a0512es) or -march=ucr2 (uc3a0512). This was an old toolchain bug that makes the compiler links with AP7 libraries (of course the AP7 memcpy() will crash on UC3).

-sma


[ 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