Quality RTOS & Embedded Software

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


Debugging FreeRTOS

Posted by altraqua on November 1, 2004
I'm using the GNU toolchain: gcc, gdb and friends.

When I start the ARM7 demo application (compiled in RAM) with gdb or insight, step executing don't work.

I think that this is due to the interrupt driven scheduler and the ARM EmbeddedICE debug mode that disable interrupts.

How can I debug a FreeRTOS task whith gdb???

RE: Debugging FreeRTOS

Posted by Richard on November 1, 2004
Some debugging methods cope better than others. I have encountered problems with other ports whereby stepping the compiler temorarily enables interrupts, even when you have them disabled in your application - causing big problems. I am not familiar with the EmbeddedICE, but have not had a problem with the tools I use - parallel port wiggler, and a Keil USB device. The wiggler seems to work well with GDB.

One way around your problem might be to run using the cooperative scheduler (set portUSE_PREEMPTION to 0 in portmacro.h). This way if your debugger is causing problems with the interrupts then at least context switches won't occur between debug steps! Debugging with the cooperative scheduler tends to be much simpler - but is of coarse not always suitable. You can go back to preemptive once you have finished debugging.

Depending on the size of your application, another option might to be to use the Keil simulator. This is an excellent tool and works well with GCC built applications. It is limited to 16K unless you buy the full version however.

You say that step execution doesn't work - what exactly happens? If you stop on a break point then step the code, does it just start executing again instead of just executing one instruction? If this is the case then I think I have read somewhere else about this problem.

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

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

Latest News

FreeRTOS v10.2.0 is available for immediate download. MIT licensed, and including RISC-V and ARMv8-M (Cortex-M33) demos.

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

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


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Cadence Tensilica Cortes

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