Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


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 ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner