Jump to content
Forum sending old emails Read more... ×
abecedarian

GCC for MSP430 officially out of beta

Recommended Posts

From the binutils used in mspgcc:

commit 5a5c7b9cfa1ca229f661e5080f1af7584753c900
Author: Peter A. Bigot <pabigot@users.sourceforge.net>
Date:   Thu Feb 10 17:01:58 2011 -0600

    SF 3177314: undefined reference with too many template parameters
    
    This patch eliminates bounds on the length of symbols and instruction
    operands, and some rather inefficient string processing operations.  Storage
    of the appropriate length for a specific symbol is dynamically allocated,
    and freed when no longer necessary.
And it's a binutils bug, not a gcc bug. Still worth filing, and the binutils folks are a little more responsive. https://sourceware.org/bugzilla/

 

Unfortunately I couldn't get a usable copyright assignment from TI for the work they funded, which included the binutils cleanups that this patch belongs to, so my patch can't be merged upstream.

Share this post


Link to post
Share on other sites

sad when you see your fixed bugs show up unfixed later .. I certainly know that feeling.

 

Thanks for the heads up.

 

-rick

 

As I suggested...  We've taken a few steps backwards.

 

I'm sure that we can get it all ironed out quickly though.  Lot of bright people in these forums.

Share this post


Link to post
Share on other sites

Here are a few more of reasons to use this release.

 

1.) The USB Descriptor tool now generates code that works with msp430-elf-gcc.  In addition, most of the USB examples have CCS projects specifically for msp430-elf-gcc.

 

2.) -mlarge - so you can use all that flash space available in chips with more than 64k of flash

 

3.) -mcode-region=lower, -mcode-region=upper, -mcode-region=either - easily locate code or data high or low or fit it in where it can find a spot. Check out: msp430-elf/lib/msp430xl-sim.ld for examples. (You have to do some ldscript coding to get this to work right)

 

Personally, I'm feeling pretty happy with the code it generates and I'm now getting it to generate code as small or smaller than I was getting from msp430-gcc.

 

Flags to check out for good smallness:

$ msp430-elf-gcc -Os -g simple.cpp -o simple-4.9.1.elf -mmcu=msp430g2553 -minrt -fno-rtti -fno-exceptions -fdata-sections -ffunction-sections -Wl,--gc-sections
$ msp430-gcc -Os -g simple.cpp -o simple-4.6.3.elf -mmcu=msp430g2553 -mdisable-watchdog -fno-rtti -fno-exceptions -fdata-sections -ffunction-sections -Wl,--gc-sections
$ msp430-size simple-4.6.3.elf 
   text	   data	    bss	    dec	    hex	filename
    490	      0	     20	    510	    1fe	simple-4.6.3.elf
$ msp430-elf-size simple-4.9.1.elf 
   text	   data	    bss	    dec	    hex	filename
    484	      4	     20	    508	    1fc	simple-4.9.1.elf

-rick

Share this post


Link to post
Share on other sites

BTW: I'm using a version built from source. I downloaded msp430-gcc-14r1-10-source.tar.bz2 from:

http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/latest/index_FDS.html

$ mkdir -p ~/rh_gcc/build
$ cd ~/rh_gcc
$ tar xvf msp430-gcc-14r1-10-source.tar.bz2
$ cd build
$ export PATH=/home/kimballr/opt/rh_gcc/bin:$PATH
$ ../configure --target=msp430-elf --prefix=/home/kimballr/opt/rh_gcc --disable-nls
$ make
$ make install
$ msp430-elf-gcc -v
Using built-in specs.
COLLECT_GCC=msp430-elf-gcc
COLLECT_LTO_WRAPPER=/home/kimballr/opt/rh_gcc/libexec/gcc/msp430-elf/4.9.1/lto-wrapper
Target: msp430-elf
Configured with: ../configure --target=msp430-elf --prefix=/home/kimballr/opt/rh_gcc --disable-nls
Thread model: single
gcc version 4.9.1 20140707 (prerelease (msp430-14r1-10)) (GNUPro 14r1) (Based on: GCC 4.8 GDB 7.7 Binutils 2.24 Newlib 2.1) (GCC)
To make my command line life easier, I downloaded the header zip file and then manually moved all the header files (*.h) one place and the ldscripts (*.ld) someplace else. This way you don't have to provide -T and -I args to msp430-elf-gcc. All you need is the -mmcu=msp430g2553 and it automatically finds the msp430g2553.h and the msp430g2553.ld.

$ find /home/kimballr/opt/rh_gcc/ -name 'msp430-elf-gcc'
/home/kimballr/opt/rh_gcc/bin/msp430-elf-gcc

$find /home/kimballr/opt/rh_gcc/ -name 'iomacros.h'
/home/kimballr/opt/rh_gcc/msp430-elf/include/iomacros.h

$ find /home/kimballr/opt/rh_gcc/ -name 'msp430g2553.h'
/home/kimballr/opt/rh_gcc/msp430-elf/include/msp430g2553.h

$ find /home/kimballr/opt/rh_gcc/ -name 'msp430g2553.ld'
/home/kimballr/opt/rh_gcc/msp430-elf/lib/msp430g2553.ld
-rick

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×