Jump to content
Sign in to follow this  
gwdeveloper

Definitive guide to installing/using mspgcc4?

Recommended Posts

what would you do differently? im always open to suggestions... as I'm not a hardcore linux user, I just use what i've learned in the last couple years...

 

It's perfectly fine. I'm just a cranky ex-Slackware user that's just getting back into getting my hands dirty again with software (I've been lazy with my Linux machines for the past two years).

 

I really appreciate that you've posted the detailed guide and I am glad that I can personally thank you for posting it. You saved me a lot of time since I was able to just copy and paste each step right into the terminal.

 

thanks :) that was what I was trying to do... my only regret is not being a linux hacker so I could provide a general solution, but i only know how to use ubuntu...

Share this post


Link to post
Share on other sites

Just thought I wanted to chime in: As it can be a bit of a pain to copy/paste the build descriptions for mspgcc uniarch, I've created a small script to ease this task. This simple build script fetches and builds the trunk of the MSP430 GCC Uniarch project as described on the uniarch wiki-page. Currently, it works only on Linux, as it tries to detect required packages and requests them to be installed. It has been tested on Ubuntu 11.04 and Fedora Core 13.

 

Usage of the script is very easy. Create a new directory for MSP430 GCC Uniarch, copy build.sh to it, and run it. Example:

# mkdir -p $HOME/msp430
# cp build.sh $HOME/msp430
# cd $HOME/msp430
# ./build.sh

 

If the script finished succesfully (which might take a while) everything is installed into $HOME/msp430/install, and setting PATH to $HOME/msp430/install/bin allows msp430gcc to be invoked with "msp430-gcc".

 

Get it here: http://xpg.dk/files/File/msp430/build.sh

 

Feedback is appreciated.

 

Cheers,

Paul

Share this post


Link to post
Share on other sites

trying the script now on Ubuntu 10.10 64bit--

 

Edit script works

 

justin@desktop:~/msp460gcc/install/bin$ ./msp430-gcc -v
Using built-in specs.
Reading specs from /home/justin/msp460gcc/install/lib/gcc/msp430/4.5.2/../../../../msp430/lib/msp430mcu.spec
COLLECT_GCC=./msp430-gcc
COLLECT_LTO_WRAPPER=/home/justin/msp460gcc/install/libexec/gcc/msp430/4.5.2/lto-wrapper
Target: msp430
Configured with: /home/justin/msp460gcc/gcc/configure --target=msp430 --enable-languages=c,c++ --prefix=/home/justin/msp460gcc/install
Thread model: single
gcc version 4.5.2 (GCC) 

 

 

only took about 30mins on my PC.

 

BY any chance would git-clone work better then update?

Share this post


Link to post
Share on other sites

Hi everyone,

 

Help needed using GNU linker, ld.

 

I've compiled latest mspgcc (uniarch, mspgcc-20110612) on Windows box.

 

But the problem is, ld does have hardcoded paths. When I move mspgcc from the directory it was compiled into attempt to link results in ld not finding ldscripts:


**** Build of configuration Debug for project blinky ****

make all 
'Building file: ../main.c'
'Invoking: Cross GCC Compiler'
msp430-gcc -I"C:\MSPGCC4\msp430\include" -Os -g3 -Wall -c -fmessage-length=0 -mmcu=msp430g2452 -MMD -MP -MF"main.d" -MT"main.d" -o"main.o" "../main.c"
'Finished building: ../main.c'
' '
'Building target: blinky.elf'
'Invoking: Cross GCC Linker'
msp430-gcc -L"C:\MSPGCC4\msp430\lib" -mmcu=msp430g2452 -o"blinky.elf"  ./main.o   
c:/mspgcc4/bin/../lib/gcc/msp430/4.5.2/../../../../msp430/bin/ld.exe: cannot open linker script file memory.x: No such file or directory
collect2: ld returned 1 exit status
make: *** [blinky.elf] Error 1

 

If i copy just the msp430/lib directory in to the old location where toolchain was built everything compiles/links ok.

 

Any suggestions?

 

BTW, if someone is interested in building mspgcc under windows I've a preliminary draft Windows batch file to do this (w/ mspgcc-20110612). It's based on Sergio Campama's Ubuntu tutorial with some Windows-specific changes.

Prerequisites are MinGW+MSYS installation in C:\MinGW and GNU wget in path.

Everything else needed should be downloaded/unpacked by this script.

 

UPD: Can't add this batch file with sourceforge and GNU URL-s for fetching packages, too spammy :) - account was deleted immediately

Share this post


Link to post
Share on other sites
Hi everyone,

 

Help needed using GNU linker, ld.

 

I've compiled latest mspgcc (uniarch, mspgcc-20110612) on Windows box.

 

But the problem is, ld does have hardcoded paths. When I move mspgcc from the directory it was compiled into attempt to link results in ld not finding ldscripts:

 

Hello andre,

 

I suggest that you install mspgcc into the directory where you want it to be. You can use --prefix for that during the configure phase. If you cannot do that for some reason I see (maybe) two more options: First, you could manually give the path to the linker scripts of the MCU you are using:

msp430-gcc -L"C:\MSPGCC4\msp430\lib\ldscripts\msp430g2453" -mmcu=msp430g2452 -o"blinky.elf"  ./main.o   

I'm guessing that this is the right path. Try searching for memory.x, you'll find the right msp430g2453 directory. Note, that it is important that the directory matches your -mmcu argument, else strange things might happen.

The other option is a pure guess: If you compile gcc and binutils using "--with-build-sysroot", you will be able to supply the --sysroot argument to ld and gcc to indicate on each invocation, where it should look for its files. I haven't tried this yet, only read about it in the manuals.

 

Hope this helps, just a tiny bit.

 

/Paul

Share this post


Link to post
Share on other sites

Edit script works

 

Good to hear, thanks.

 

BY any chance would git-clone work better then update?

Hmm... I'm no git expert, but as far as I know git-clone is only meant for the initial cloning. After that git-pull must be used to keep things up-to-date. Anyone, feel free to correct me if I'm wrong :-).

 

BTW, does anyone know of an Eclipse plugin for the MSP430 toolchains? Would be nice to have something like the Eclipse AVR plugin

 

Cheers,

Paul

Share this post


Link to post
Share on other sites

keep in mind that xpg's script is for the latest non-release version of mspgcc, as it clones the repository... this is great when you want the latest of the latest, but if you need to have a stable release, and a release where you want to be able to give feedback on, it's better to have dated release version...

Share this post


Link to post
Share on other sites
keep in mind that xpg's script is for the latest non-release version of mspgcc, as it clones the repository... this is great when you want the latest of the latest, but if you need to have a stable release, and a release where you want to be able to give feedback on, it's better to have dated release version...

 

Very good point. Thank you for pointing this out!

 

Cheers,

Paul

Share this post


Link to post
Share on other sites

I suggest that you install mspgcc into the directory where you want it to be. You can use --prefix for that during the configure phase.

 

Hello Paul,

 

Clear. Thank you. I've recompiled feeding the final path to the configure scripts.

Now I've mspgcc working for some simple stuff like blinking Launchpad' LEDs with msp430g2452 :)

 

BTW, does anyone know of an Eclipse plugin for the MSP430 toolchains? Would be nice to have something like the Eclipse AVR plugin

Usual Eclipse CDT's "C/C++ GCC Cross Compiler Support" and "C/C++ GDB Hardware Debugging" works for me on Windows (mspgcc and msp430-gdb + msp430-gdbproxy).

Should work even better on Linux probably with mspdebug instead of gdbproxy.

 

BR

Andres

buildmspgcc-20110612.zip

Share this post


Link to post
Share on other sites

Clear. Thank you. I've recompiled feeding the final path to the configure scripts.

Now I've mspgcc working for some simple stuff like blinking Launchpad' LEDs with msp430g2452 :)

 

Great!

 

Usual Eclipse CDT's "C/C++ GCC Cross Compiler Support" and "C/C++ GDB Hardware Debugging" works for me on Windows (mspgcc and msp430-gdb + msp430-gdbproxy).

Should work even better on Linux probably with mspdebug instead of gdbproxy.

 

Well, it works. Just seems a bit clumpsy :-).

 

/Paul ;-)

Share this post


Link to post
Share on other sites

Sergio and other people writing Uniarch install scripts and guides,

 

as everyone and their grandma seems to trip over this trying-to-compile-libc-with-gcc3 issue, may I suggest to start your scripts/instructions with something along the lines of

 

PATH=${PREFIX}/bin:${PATH}

 

where PREFIX is (obviously :)) the path Uniarch will be installed into?

 

I am reasonably confident this will take care of all these ghost compilation failures (and will also possibly mask future issues, but those would be there without this not-solution anyway).

Share this post


Link to post
Share on other sites

Thanks Sergio!

 

One correction (to be applied a few times) is that to untar a .bz2 file, the 'tar' program

should be called with the 'j' option, not the 'z'.

 

Sitting here waiting for my binutils to compile...

 

-Rusty-

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
Sign in to follow this  

×