Quality RTOS & Embedded Software

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


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