Quality RTOS & Embedded Software

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


Need perfect tracing procedure for FreeRTOS

Posted by Surjya Padhi on May 25, 2011
Hi Geeks,

Currently I am working on AVR based project. My development kit is EVK1105 and OS is FreeRTOS.
I am using two USARTs USART0 and USART1 for transmit and receive respectively. USART0 configured for 19230 baudrate, 7-databits, 1 stopbit, odd parity and USART1 configured for 57000 baudrate, 8 databit. I am trying to receive data from an external USART module and transmit it on USART1. I created tasks one RX and one TX. I used polling method to collect data on my USART0. To communicate between RX and TX tasks I use a queue. The data received on RX task is put on in the buffer and tx task will transmit the data on queue on USART1. Now can I ask is it good idea to use polling method to collect data from USART? I am not getting the expected output on my TX terminal and other tasks also become slow due to this. Can anybody suggest me how I can trace my current task? I have read through so many posts in this forum about trace facility but no-where I found a clear and to the procedure to do it. Can anybody provide a good link which is informative and gives step by step procedure to trace my tasks and callstack in freeRTOS?

RE: Need perfect tracing procedure for FreeRTOS

Posted by Richard Damon on May 25, 2011
Having a task use polling is rarely a good idea, because that task will be using a lot of CPU time for little result. It will also cause any task of a lower priority to be totally starved for time. Note that even if you put a Yield in the poll loop, you will have the starving issue as Yield only allows other task at the same priority to run. You can possibly use polling for very slow tasks with a delay in the loop, but then you are limited in how fast you can poll.

I/O like this should really be done with interrupts, so that the tasks needing data can wait for data to be available and not be consuming resources. You can look at the demo program for an example of how to do this.

RE: Need perfect tracing procedure for FreeRTOS

Posted by Surjya Padhi on May 26, 2011
In the FreeRTOS demo application, we have a serial.c file which uses USART using interrupt method. But that does not work properly. There is problem in reception in the USART by this method. I already posted that issue in so many forums even here but I din't get any reply for that till now.

RE: Need perfect tracing procedure for FreeRTOS

Posted by Richard on May 26, 2011
This is the reply I posted to your bug report (which was incorrectly posted as it is not a bug in the kernel - in fact, its not a bug at all):

"The driver included in that demo is for a PIC32MX360F512, not a PIC32MX795F512L. The driver required for the PIC32MX795F512L is different,"

I have a driver for the 795F somewhere at will dig it out.


RE: Need perfect tracing procedure for FreeRTOS

Posted by Surjya Padhi on May 26, 2011
Thanks a lot for you reply. I am so much thankful that you will provide a driver. Its my mistake I din't mentioned the micro-controller name is AT32UC3A1512. Its from ATMEL. Do you have any driver for this?

It would help me a lot if you can provide tips on tracing the freeRTOS tasks and callstack. I went through the documentation. Its mentioned which Hook-up trace macros to use but haven't mentioned how to use them. Like after collecting the binary data in a buffer how can I transfer that data to my PC for analyze and how the sample data look like and how to interpret them. If you can throw some light on this, it will be helpful to me.

[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]

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


FreeRTOS and other embedded software careers at AWS.

Latest News

FreeRTOS kernel V10.0.1 is available for immediate download. Now MIT licensed.

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

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