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

GCC 4.3.2, FreeRTOS and C++

Posted by Raphael Derosso Pereira on November 28, 2008
Hello,

When using GCC 4.3.2 in a ARM7 (LPC2387) environment, if I have one process that creates and deletes a lot one class instance using new and delete, and that process waits on serial interrupt, sometimes the SP register gets zeroed and I have a data abort. The weird thing is that creating and removing the instance using static declaration (creating a new block for example), the problem doesn't occur. It always occur only with new and delete.

If I use GCC 4.2 (tried with 4.2.2 and 4.2.4), the problem doesn't occur.

What I want to know is if someone have any similar problem or if someone have success with GCC 4.3

Best Regards,

RE: GCC 4.3.2, FreeRTOS and C++

Posted by Dave on November 28, 2008
I have still on GCC 4.2 and have not tried 4.3 but I suspect it might be something to do with the libraries more than the compiler. new and delete must be allocating memory from the heap so there is the potential for fragmentation. When they are static the heap will not be used.

RE: GCC 4.3.2, FreeRTOS and C++

Posted by Raphael Derosso Pereira on November 28, 2008
But then it would be the new and delete implementation rather malloc, because I'm using the same newlib version and only changing GCC.

I also suspect that it might be a FreeRTOS context switch incompatibility with some GCC 4.3 implementation.

RE: GCC 4.3.2, FreeRTOS and C++

Posted by Richard on November 28, 2008
I'm just downloading version 4.3.2 of Yagarto but will not be able to try it until later this evening.

Regards.

RE: GCC 4.3.2, FreeRTOS and C++

Posted by Raphael Derosso Pereira on November 28, 2008
Not a problem. I will keep GCC 4.2.4 until someone else can try it out.

RE: GCC 4.3.2, FreeRTOS and C++

Posted by Richard on November 28, 2008
So far I have found the SAM7X demo to work fine at -O3, but not at all at -O0. Still working on it.

Regards.

RE: GCC 4.3.2, FreeRTOS and C++

Posted by Richard on November 28, 2008
Actually - my mistake - it is working fine with GCC V4.3.2 and with both -O0 and -O3 settings. It was just my dodgy debug setup that was causing problems. If I flash the board and run it stand alone (not in the debugger) then everything is ok.

I am using just C, not C++ though.

Regards.

RE: GCC 4.3.2, FreeRTOS and C++

Posted by Raphael Derosso Pereira on December 19, 2008
The problem seems to be on "new" implementation, so, if using just C will not trigger the error. Could you please try C++ wih a lot of "new" and "delete"?

Regards,


[ 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