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

AVR32 UC3 and GCC Tools

Posted by Kevin on March 31, 2008
There's a recently identified problem with Atmel's AVR32 UC3 build GCC build tools. The problem seems to be that the linker will include an entire library instead of scanning the library for used functions. This results in a program file bloated with unnecessary and uncalled functions. I'm working on a USB application that almost triples in size when build with the GCC tools vs. IAR's kickstart version.
To get around this I had to add tell the linker to not use the standard gcc library (-nostdlib linker option). I then had to modify the FreeRTOS source code to remove the standard library calls, replacing them with functions added to port.c.
Being new to open source code I'm not sure of the procedure for modifying the code. I know I have to make changes publicly available. (This is a commercial application). It seems it may be useful to someone to not use any library calls in the main RTOS code, and include library calls only in port.c which could be removed by conditional compile flag. Would this be useful to any one else?
Atmel has admitted this problem but I havent' heard a timeframe for getting it fixed.

RE: AVR32 UC3 and GCC Tools

Posted by Richard on March 31, 2008
Thanks for the info.

Does the makefile use the -ffunction-sections and -fdata-sections compiler options, and then the --gc-sections linker option? I think in theory this should reduce the code size by removing unused functions but it can be difficult.

If you send your modification to me (r _dot_ barry _@_ freertos.org) then I can hold them on record, and then forward them to anybody else who expresses after reading this post. That way the source code is 'available'.

Regards.

RE: AVR32 UC3 and GCC Tools

Posted by Kevin on April 1, 2008
Even with the compiler and linker options you mentioned, the program file is huge. Apparently the problem is with the gcc library crt0.o startup file. To workaround, use the startup file included in the software framework provided by Atmel (UTILS/STARTUP_FILES/GCC/crt0.S) then use the -ffunction-sections and -fdata-sections compile options, and --gc-sections and -nostdlib linker options. memset(), memcpy(), and strncpy() functions will need to be replaced. After this my program size went from 88kB to 36kB.
Ideally Atmel will resolve this before production release of this product, if not, or if anybody else is interested I'll send you the modified source code.


[ 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