EmbeddedRelated.com
Forums
Memfault Beyond the Launch

IAR V2.10

Started by Martijn Broens April 28, 2003
Hi all,
 
Any one else using V2.10 of IAR?? What are you're findings?? My code
used to run but now it doesn't anymore does anyone have any
suggestions???
 
thanks,
Martijn
 





Beginning Microcontrollers with the MSP430

If at all possible, ditch IAR, and use GCC or Imagecraft.  I have
personally
found the IAR C-Spy to be more a hindrance than a benefit.
 
    --John
 

-----Original Message-----
From: Martijn Broens [mailto:martijn@mart...]
Sent: Monday, April 28, 2003 09:46
To: msp430@msp4...
Subject: [msp430] IAR V2.10


Hi all,

Any one else using V2.10 of IAR?? What are you're findings?? My code
used to run but now it doesn't anymore does anyone have any
suggestions???

thanks,
Martijn







Yahoo! Groups Sponsor	
	
 
<http://us.adserver.yahoo.com/l?M"9633.3212141.4526654.2595810/D=egroupmai
l/S=:HM/A56779/randg0336474> 	

.



">http://docs.yahoo.com/info/terms/> . 







>
> Any one else using V2.10 of IAR?? What are
you're findings?? My code
> used to run but now it doesn't anymore does anyone have any
> suggestions???
>
I've been using v2.10a for about 4 weeks now.

The porting from v1.26b to v2.10a was quite a problem. I found several bugs
in the io430x14x.h header file. Some serious, some not such a problem.

For example the register definitions for ME2 register were wrong so the UART
was never being enabled.

The jmpbuf definition is wrong and can lead to variable being overwritten.


However, I now have my code ported to v2.10a and it's running fine.

What sort of problems are you having?

Have you downloaded the latest header files from the support website? There
is an update available.

Failing that v2.20a is due to be released on 9th May.

Stephen



Hi Stephen,
 
Thanks (John to) the problems I'm having is that for some reason I can
set breakpoint practically anywhere, but in one file, and, yep you guest
it, that's the file that I don't trust. Further if I let It run freely
then after receiving data over one comport the whole thing resets.
Pretty annoying.
 
Futher John, I've just setup a linux system but I'm new here, I found
some code sample form the SOS which look nice to try, but I don't know
where to start using gnu, have you got any suggestions??
 
 
thanks,
Martijn
-----Oorspronkelijk bericht-----
Van: Stephen Bashford [mailto:sbashford@sbas...] 
Verzonden: maandag 28 april 2003 16:29
Aan: msp430@msp4...
Onderwerp: Re: [msp430] IAR V2.10
 
>
> Any one else using V2.10 of IAR?? What are you're findings?? My code
> used to run but now it doesn't anymore does anyone have any
> suggestions???
>
I've been using v2.10a for about 4 weeks now.

The porting from v1.26b to v2.10a was quite a problem. I found several
bugs
in the io430x14x.h header file. Some serious, some not such a problem.

For example the register definitions for ME2 register were wrong so the
UART
was never being enabled.

The jmpbuf definition is wrong and can lead to variable being
overwritten.


However, I now have my code ported to v2.10a and it's running fine.

What sort of problems are you having?

Have you downloaded the latest header files from the support website?
There
is an update available.

Failing that v2.20a is due to be released on 9th May.

Stephen





Yahoo! Groups Sponsor
 
<http://rd.yahoo.com/M"9633.3212141.4526654.2595810/D=egroupweb/S05
005378:HM/A56779/R=0/*http:/shop.store.yahoo.com/cgi-bin/clink?ftd2+s
hopping:dmad/M"9633.3212141.4526654.2595810/D=egroupweb/S05005378:H
M/A56779/R=1/1051540124+http://www.ftd.co" target="_blank" rel="nofollow">http://us.rmi.yahoo.com/rmi/http://www.ftd.co
m/rmi-framed-url/http://www.ftd.com/yahoo36> 
 
<http://us.adserver.yahoo.com/l?M"9633.3212141.4526654.2595810/D=egrou
pmail/S=:HM/A56779/randb1084411> 

.



">http://docs.yahoo.com/info/terms/> . 





> Thanks (John to) the problems I'm having is that for some reason
I can
> set breakpoint practically anywhere, but in one
file, and, yep you guest
> it, that's the file that I don't trust. Further if I let It run
freely
> then after receiving data over one comport the whole thing resets.
> Pretty annoying.
>
I too have had some problems setting breakpoints but I believe that this
is
related to the fact that I'm not actually editing the source from within
Embedded Workbench. I'm using an external editor and makefile to build.

I find that if C-Spy has some source files open and I download some new code
then it doesn't always reload the updated source file. If I close all the
windows and continue stepping through my code then the breakpoints work as
expected.

You say that the whold whing resets, is this because of the watchdog
barking?

Have you tried the other com port?

On our MSP430F149 we're using both com ports and haven't had any
problems
like your describing.

Regards,

    Stephen



Martijn,

    Create a directory on your Linux box, something like /home/msp430.  Save
this script to a file, and then run it with ``sh buildmsp`` (or whatever you
named it).  This will get all the current sources from GNU and Sourceforge,
and build the toolchain and MSP430 libraries.

	If you browse Sourceforges CVS tree, you'll see some examples in the
examples directory.  They should be sufficient to get you started. 

	Remember that when you use the tools, you need to modify your path
to include ``/usr/local/msp430/bin`` (if you're using the ``bash`` shell,
you can type ``export PATH=/usr/local/msp430/bin:$PATH``.  To prove that you
compile something, you can just create a program that doesn't do anything,
such as the following:

#include <msp430x14x.h>
#include <string.h>

int main (void)
{
   const char *s = "This is a string";
   char buffer [32];

   while (1)
      strcpy (buffer, s); 
}

Compile this with:

	msp430-gcc -W -Wall -mmcu=msp430x147 -O2 -g -c testfile.c -o
testfile.o
	msp430-gcc -W -Wall -mmcu=msp430x147 -O2 -g -o testfile testfile.o 
	msp430-objcopy -O ihex testfile testfile.hex
	msp430-objdump -dSt testfile > testfile.lst

You can then use ``more`` or ``vi`` to browse ``testfile.lst`` and see some
produced code.  You can then create some code tailored to your hardware to
blink a LED or something to get started.

	--John

---------------------------- Cut Here
---
#!/bin/sh -e

#
#  Written by J.C. Wren, jcwren@jcwr...,http://tinymicros.com
#  No rights reserved, use as you see fit. I am not responsible for 
#  any damage incurred for any reason as a direct or indirect result
#  of this script.  However, if you make millions as a result, you
#  could always PayPal me a few bucks :)  2003/04/28 JCW
#

#
#  This is the directory where the tools will wind up
#
export PREFIXROOT=/usr/local/msp430
export PATH=$PREFIXROOT/bin:$PATH

#
#  Gotta be root for installs
#
if [ ! $UID == 0 ] ; then
        echo "Must be root to do this (installs require it)"
        exit
fi

#
#  Make sure we've got wget, so we can fetch the binutils and gcc sources
#
command -V wget >/dev/null 2>&1 ; retval=$? ; if [ $retval -ne 0 ] ;
then
        echo "Can't find wget! (I need this to get the GCC and
binutils
sources)" 
        exit 1
fi

#
#  Blow away the old version, if it exists.  Safest thing to do, according
to Dmitry
#
\rm -rf $PREFIXROOT

#
#  In theory, you can do an update to make the CVS pull more efficient.
Safer this way, tho
#
\rm -rf gcc
\rm -rf binutils
\rm -rf msp430-libc

#
#  If these already exist, don't fetch again
#
if [ ! -s gcc-core-3.2.2.tar.bz2 ] ; then
        wget
http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-3.2.2/gcc-core-3.2.2.
tar.bz2
fi

if [ ! -s binutils-2.11.tar.bz2 ] ; then
        wget
ftp://sources.redhat.com/pub/binutils/releases/binutils-2.11.tar.bz2
fi

#
#  Login to CVS, pull the patches down
#
echo "Hit <return> when prompted for password"
cvs -d:pserver:anonymous@anon...:/cvsroot/mspgcc login
cvs -z3 -d:pserver:anonymous@anon...:/cvsroot/mspgcc co
gcc
cvs -z3 -d:pserver:anonymous@anon...:/cvsroot/mspgcc co
binutils
cvs -z3 -d:pserver:anonymous@anon...:/cvsroot/mspgcc co
msp430-libc

#
#  Build the binutils and install
#
if [ ! -s binutils-2.11.tar.bz2 ] ; then
        echo "Eeek!  Where did the binutils-2.11.tar.bz2 file go?!?"
        exit
fi

\rm -rf binutils-2.11
tar --bzip2 -xf binutils-2.11.tar.bz2 || exit
\cp -a binutils/binutils-2.11/* binutils-2.11
cd binutils-2.11
./configure --target=msp430 --prefix=$PREFIXROOT
(make && make install) || exit
cd ..

#
#  Build the compiler and install
#
if [ ! -s gcc-core-3.2.2.tar.bz2 ] ; then
        echo "Eeek!  Where did the gcc-core-3.2.2.tar.bz2 go?!?"
        exit
fi

\rm -rf gcc-3.2.2
tar --bzip2 -xf gcc-core-3.2.2.tar.bz2 || exit
\cp -a gcc/gcc-3.3/gcc/* gcc-3.2.2/gcc
cd gcc-3.2.2
./configure --target=msp430 --prefix=$PREFIXROOT
(make && make install) || exit
cd ..

#
#  Build the libraries and install
#
cd msp430-libc/src
sed -e "s#^prefix[ ]*=.*#prefix=$PREFIXROOT#" Makefile
>Makefile.tmp
\mv Makefile.tmp Makefile
(make && make install) || exit
cd ../..

#
#  We should be OK to go
#
echo ""
echo ""
echo "It appears we completed with no errors.  MSP430 version of GCC
is"
echo "installed in $PREFIXROOT.  Create a simple test program,"
echo "then compile with:"
echo ""
echo "   $PREFIXROOT/bin/msp430-gcc mytest.c -o mytest"
echo "   $PREFIXROOT/bin/msp430-objdump mytest"
echo ""
--------------------------------- Cut Here
---

-----Original Message-----
From: Martijn Broens [mailto:martijn@mart...]
Sent: Monday, April 28, 2003 10:48
To: msp430@msp4...
Subject: RE: [msp430] IAR V2.10


Hi Stephen,

Thanks (John to) the problems I'm having is that for some reason I can
set breakpoint practically anywhere, but in one file, and, yep you guest
it, that's the file that I don't trust. Further if I let It run freely
then after receiving data over one comport the whole thing resets.
Pretty annoying.

Futher John, I've just setup a linux system but I'm new here, I found
some code sample form the SOS which look nice to try, but I don't know
where to start using gnu, have you got any suggestions??


thanks,
Martijn
-----Oorspronkelijk bericht-----
Van: Stephen Bashford [mailto:sbashford@sbas...] 
Verzonden: maandag 28 april 2003 16:29
Aan: msp430@msp4...
Onderwerp: Re: [msp430] IAR V2.10

>
> Any one else using V2.10 of IAR?? What are you're findings?? My code
> used to run but now it doesn't anymore does anyone have any
> suggestions???
>
I've been using v2.10a for about 4 weeks now.

The porting from v1.26b to v2.10a was quite a problem. I found several
bugs
in the io430x14x.h header file. Some serious, some not such a problem.

For example the register definitions for ME2 register were wrong so the
UART
was never being enabled.

The jmpbuf definition is wrong and can lead to variable being
overwritten.


However, I now have my code ported to v2.10a and it's running fine.

What sort of problems are you having?

Have you downloaded the latest header files from the support website?
There
is an update available.

Failing that v2.20a is due to be released on 9th May.

Stephen





Yahoo! Groups Sponsor

<http://rd.yahoo.com/M"9633.3212141.4526654.2595810/D=egroupweb/S05
005378:HM/A56779/R=0/*http:/shop.store.yahoo.com/cgi-bin/clink?ftd2+s
hopping:dmad/M"9633.3212141.4526654.2595810/D=egroupweb/S05005378:H
M/A56779/R=1/1051540124+http://www.ftd.co" target="_blank" rel="nofollow">http://us.rmi.yahoo.com/rmi/http://www.ftd.co
m/rmi-framed-url/http://www.ftd.com/yahoo36> 

<http://us.adserver.yahoo.com/l?M"9633.3212141.4526654.2595810/D=egrou
pmail/S=:HM/A56779/randb1084411> 

.



">http://docs.yahoo.com/info/terms/> . 





Yahoo! Groups Sponsor



.



 





At 03:35 PM 4/28/2003 -0400, you wrote:
>Martijn,
>
>     Create a directory on your Linux box, something like /home/msp430. 
Save
>this script to a file, and then run it with ``sh buildmsp`` (or whatever you
>named it).  This will get all the current sources from GNU and Sourceforge,
>and build the toolchain and MSP430 libraries.
>
>...

Hey John, the linewraps screw up the shell script. Best to upload it to the 
Yahoo file area or something.


// richard <http://www.imagecraft.com> 
<http://www.dragonsgate.net/mailman/listinfo>
On-line orders, support, and listservers available on web site.
[ For technical support on ImageCraft products, please include all previous 
replies in your msgs. ] 


I've created a web page at http://tinymicros.com/msp430.  You can
download
"buildmsp.txt" from there.  I dunno about this Yahoo uploading stuff.

    --John

  -----Original Message-----
  From: Richard F. Man [mailto:richard@rich...]
  Sent: Monday, April 28, 2003 16:02
  To: msp430@msp4...
  Subject: Re: [msp430] Transitioning from IAR V2.10 to GCC


  At 03:35 PM 4/28/2003 -0400, you wrote:
  >Martijn,
  >
  >     Create a directory on your Linux box, something like /home/msp430.
Save
  >this script to a file, and then run it with ``sh buildmsp`` (or whatever
you
  >named it).  This will get all the current sources from GNU and
Sourceforge,
  >and build the toolchain and MSP430 libraries.
  >
  >...

  Hey John, the linewraps screw up the shell script. Best to upload it to
the
  Yahoo file area or something.


  // richard <http://www.imagecraft.com>
  <http://www.dragonsgate.net/mailman/listinfo>
  On-line orders, support, and listservers available on web site.
  [ For technical support on ImageCraft products, please include all
previous
  replies in your msgs. ]


        Yahoo! Groups Sponsor



  .



  





Hi John,
 
Thanks for the reply, I'm still trying to get linux on my laptop, (I
don't understand  the installation part about the partitions) but
anyway, I'll try this as soon as I get it running. One more question
though; how do you upload the code in to the msp? And how do you debug,
do you still use Cspy??
 
thanks,
Martijn
-----Oorspronkelijk bericht-----
Van: J.C.Wren [mailto:jcwren@jcwr...] 
Verzonden: maandag 28 april 2003 21:35
Aan: msp430@msp4...
Onderwerp: [msp430] Transitioning from IAR V2.10 to GCC
 
Martijn,

    Create a directory on your Linux box, something like /home/msp430.
Save
this script to a file, and then run it with ``sh buildmsp`` (or whatever
you
named it).  This will get all the current sources from GNU and
Sourceforge,
and build the toolchain and MSP430 libraries.

      If you browse Sourceforges CVS tree, you'll see some examples in
the
examples directory.  They should be sufficient to get you started. 

      Remember that when you use the tools, you need to modify your path
to include ``/usr/local/msp430/bin`` (if you're using the ``bash``
shell,
you can type ``export PATH=/usr/local/msp430/bin:$PATH``.  To prove that
you
compile something, you can just create a program that doesn't do
anything,
such as the following:

#include <msp430x14x.h>
#include <string.h>

int main (void)
{
   const char *s = "This is a string";
   char buffer [32];

   while (1)
      strcpy (buffer, s); 
}

Compile this with:

      msp430-gcc -W -Wall -mmcu=msp430x147 -O2 -g -c testfile.c -o
testfile.o
      msp430-gcc -W -Wall -mmcu=msp430x147 -O2 -g -o testfile testfile.o

      msp430-objcopy -O ihex testfile testfile.hex
      msp430-objdump -dSt testfile > testfile.lst

You can then use ``more`` or ``vi`` to browse ``testfile.lst`` and see
some
produced code.  You can then create some code tailored to your hardware
to
blink a LED or something to get started.

      --John

---------------------------- Cut Here
---
#!/bin/sh -e

#
#  Written by J.C. Wren, jcwren@jcwr...,http://tinymicros.com
#  No rights reserved, use as you see fit. I am not responsible for 
#  any damage incurred for any reason as a direct or indirect result
#  of this script.  However, if you make millions as a result, you
#  could always PayPal me a few bucks :)  2003/04/28 JCW
#

#
#  This is the directory where the tools will wind up
#
export PREFIXROOT=/usr/local/msp430
export PATH=$PREFIXROOT/bin:$PATH

#
#  Gotta be root for installs
#
if [ ! $UID == 0 ] ; then
        echo "Must be root to do this (installs require it)"
        exit
fi

#
#  Make sure we've got wget, so we can fetch the binutils and gcc
sources
#
command -V wget >/dev/null 2>&1 ; retval=$? ; if [ $retval -ne 0 ] ;
then
        echo "Can't find wget! (I need this to get the GCC and
binutils
sources)" 
        exit 1
fi

#
#  Blow away the old version, if it exists.  Safest thing to do,
according
to Dmitry
#
\rm -rf $PREFIXROOT

#
#  In theory, you can do an update to make the CVS pull more efficient.
Safer this way, tho
#
\rm -rf gcc
\rm -rf binutils
\rm -rf msp430-libc

#
#  If these already exist, don't fetch again
#
if [ ! -s gcc-core-3.2.2.tar.bz2 ] ; then
        wget
http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-3.2.2/gcc-core-3.
2.2.
tar.bz2
fi

if [ ! -s binutils-2.11.tar.bz2 ] ; then
        wget
ftp://sources.redhat.com/pub/binutils/releases/binutils-2.11.tar.bz2
fi

#
#  Login to CVS, pull the patches down
#
echo "Hit <return> when prompted for password"
cvs -d:pserver:anonymous@anon...:/cvsroot/mspgcc
login
cvs -z3 -d:pserver:anonymous@anon...:/cvsroot/mspgcc
co
gcc
cvs -z3 -d:pserver:anonymous@anon...:/cvsroot/mspgcc
co
binutils
cvs -z3 -d:pserver:anonymous@anon...:/cvsroot/mspgcc
co
msp430-libc

#
#  Build the binutils and install
#
if [ ! -s binutils-2.11.tar.bz2 ] ; then
        echo "Eeek!  Where did the binutils-2.11.tar.bz2 file go?!?"
        exit
fi

\rm -rf binutils-2.11
tar --bzip2 -xf binutils-2.11.tar.bz2 || exit
\cp -a binutils/binutils-2.11/* binutils-2.11
cd binutils-2.11
./configure --target=msp430 --prefix=$PREFIXROOT
(make && make install) || exit
cd ..

#
#  Build the compiler and install
#
if [ ! -s gcc-core-3.2.2.tar.bz2 ] ; then
        echo "Eeek!  Where did the gcc-core-3.2.2.tar.bz2 go?!?"
        exit
fi

\rm -rf gcc-3.2.2
tar --bzip2 -xf gcc-core-3.2.2.tar.bz2 || exit
\cp -a gcc/gcc-3.3/gcc/* gcc-3.2.2/gcc
cd gcc-3.2.2
./configure --target=msp430 --prefix=$PREFIXROOT
(make && make install) || exit
cd ..

#
#  Build the libraries and install
#
cd msp430-libc/src
sed -e "s#^prefix[ ]*=.*#prefix=$PREFIXROOT#" Makefile
>Makefile.tmp
\mv Makefile.tmp Makefile
(make && make install) || exit
cd ../..

#
#  We should be OK to go
#
echo ""
echo ""
echo "It appears we completed with no errors.  MSP430 version of GCC
is"
echo "installed in $PREFIXROOT.  Create a simple test program,"
echo "then compile with:"
echo ""
echo "   $PREFIXROOT/bin/msp430-gcc mytest.c -o mytest"
echo "   $PREFIXROOT/bin/msp430-objdump mytest"
echo ""
--------------------------------- Cut Here
---

-----Original Message-----
From: Martijn Broens [mailto:martijn@mart...]
Sent: Monday, April 28, 2003 10:48
To: msp430@msp4...
Subject: RE: [msp430] IAR V2.10


Hi Stephen,

Thanks (John to) the problems I'm having is that for some reason I can
set breakpoint practically anywhere, but in one file, and, yep you guest
it, that's the file that I don't trust. Further if I let It run freely
then after receiving data over one comport the whole thing resets.
Pretty annoying.

Futher John, I've just setup a linux system but I'm new here, I found
some code sample form the SOS which look nice to try, but I don't know
where to start using gnu, have you got any suggestions??


thanks,
Martijn
-----Oorspronkelijk bericht-----
Van: Stephen Bashford [mailto:sbashford@sbas...] 
Verzonden: maandag 28 april 2003 16:29
Aan: msp430@msp4...
Onderwerp: Re: [msp430] IAR V2.10

>
> Any one else using V2.10 of IAR?? What are you're findings?? My code
> used to run but now it doesn't anymore does anyone have any
> suggestions???
>
I've been using v2.10a for about 4 weeks now.

The porting from v1.26b to v2.10a was quite a problem. I found several
bugs
in the io430x14x.h header file. Some serious, some not such a problem.

For example the register definitions for ME2 register were wrong so the
UART
was never being enabled.

The jmpbuf definition is wrong and can lead to variable being
overwritten.


However, I now have my code ported to v2.10a and it's running fine.

What sort of problems are you having?

Have you downloaded the latest header files from the support website?
There
is an update available.

Failing that v2.20a is due to be released on 9th May.

Stephen





Yahoo! Groups Sponsor

<http://rd.yahoo.com/M"9633.3212141.4526654.2595810/D=egroupweb/S05
005378:HM/A56779/R=0/*http:/shop.store.yahoo.com/cgi-bin/clink?ftd2+s
hopping:dmad/M"9633.3212141.4526654.2595810/D=egroupweb/S05005378:H
M/A56779/R=1/1051540124+http://www.ftd.co" target="_blank" rel="nofollow">http://us.rmi.yahoo.com/rmi/http://www.ftd.co
<http://us.rmi.yahoo.com/rmi/http:/www.ftd.co> 
m/rmi-framed-url/http://www.ftd.com/yahoo36> 

<http://us.adserver.yahoo.com/l?M"9633.3212141.4526654.2595810/D=egrou
pmail/S=:HM/A56779/randb1084411> 

.



">http://docs.yahoo.com/info/terms/> . 





Yahoo! Groups Sponsor



.



">http://docs.yahoo.com/info/terms/> . 





Martijn,
 
    In the CVS tree (
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/mspgcc/pyjtag/
<http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/mspgcc/pyjtag/> ), pyjtag
will allow you to use a FET dongle to program parts via JTAG.  There is also
pybsl ( http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/mspgcc/pybsl/
<http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/mspgcc/pybsl/> ) for using
the serial port loader on a MSP (I built my own hardware, I dunno what
you're supposed to use as an adapter, normally).  These both work pretty
well.  
 
    As far as debugging, I use printfs, LEDs, and occasionally the
oscilloscope.  I've tried GDB, but I find that overall, I despise it.
However, that's just my opinion.  Some people swear by it (I generally
swear
*at* it).  Since almost all my projects use the serial port in one form or
another, the printf() (or puts()) debugging works quite well for me.
 
    Incidently, your best bet for partitions is to create a swap partition
that's 1 to 2 times the amount of RAM you have in your laptop, but is at
least 256MB.  Make the rest of the disk a single partition, and select
'ext3' as your file system for it.  This is the same as ext2, but has
journalling.  ext3 is readable under ext2, if you have to take the drive
out, or boot from a floppy, or such.  reiserfs works well also, but doesn't
have that luxury.  
 
    For drives less than 30 or 40GB, I really don't see the point in
splitting them into multiple paritions.
 
    --John

-----Original Message-----
From: Martijn Broens [mailto:martijn@mart...]
Sent: Tuesday, April 29, 2003 09:57
To: msp430@msp4...
Subject: RE: [msp430] Transitioning from IAR V2.10 to GCC


Hi John,

Thanks for the reply, I'm still trying to get linux on my laptop, (I
don't understand  the installation part about the partitions) but
anyway, I'll try this as soon as I get it running. One more question
though; how do you upload the code in to the msp? And how do you debug,
do you still use Cspy??

thanks,
Martijn
-----Oorspronkelijk bericht-----
Van: J.C.Wren [mailto:jcwren@jcwr...] 
Verzonden: maandag 28 april 2003 21:35
Aan: msp430@msp4...
Onderwerp: [msp430] Transitioning from IAR V2.10 to GCC

Martijn,

    Create a directory on your Linux box, something like /home/msp430.
Save
this script to a file, and then run it with ``sh buildmsp`` (or whatever
you
named it).  This will get all the current sources from GNU and
Sourceforge,
and build the toolchain and MSP430 libraries.

      If you browse Sourceforges CVS tree, you'll see some examples in
the
examples directory.  They should be sufficient to get you started. 

      Remember that when you use the tools, you need to modify your path
to include ``/usr/local/msp430/bin`` (if you're using the ``bash``
shell,
you can type ``export PATH=/usr/local/msp430/bin:$PATH``.  To prove that
you
compile something, you can just create a program that doesn't do
anything,
such as the following:

#include <msp430x14x.h>
#include <string.h>

int main (void)
{
   const char *s = "This is a string";
   char buffer [32];

   while (1)
      strcpy (buffer, s); 
}

Compile this with:

      msp430-gcc -W -Wall -mmcu=msp430x147 -O2 -g -c testfile.c -o
testfile.o
      msp430-gcc -W -Wall -mmcu=msp430x147 -O2 -g -o testfile testfile.o

      msp430-objcopy -O ihex testfile testfile.hex
      msp430-objdump -dSt testfile > testfile.lst

You can then use ``more`` or ``vi`` to browse ``testfile.lst`` and see
some
produced code.  You can then create some code tailored to your hardware
to
blink a LED or something to get started.

      --John

---------------------------- Cut Here
---
#!/bin/sh -e

#
#  Written by J.C. Wren, jcwren@jcwr..., http://tinymicros.com
<http://tinymicros.com> 
#  No rights reserved, use as you see fit. I am not responsible for 
#  any damage incurred for any reason as a direct or indirect result
#  of this script.  However, if you make millions as a result, you
#  could always PayPal me a few bucks :)  2003/04/28 JCW
#

#
#  This is the directory where the tools will wind up
#
export PREFIXROOT=/usr/local/msp430
export PATH=$PREFIXROOT/bin:$PATH

#
#  Gotta be root for installs
#
if [ ! $UID == 0 ] ; then
        echo "Must be root to do this (installs require it)"
        exit
fi

#
#  Make sure we've got wget, so we can fetch the binutils and gcc
sources
#
command -V wget >/dev/null 2>&1 ; retval=$? ; if [ $retval -ne 0 ] ;
then
        echo "Can't find wget! (I need this to get the GCC and
binutils
sources)" 
        exit 1
fi

#
#  Blow away the old version, if it exists.  Safest thing to do,
according
to Dmitry
#
\rm -rf $PREFIXROOT

#
#  In theory, you can do an update to make the CVS pull more efficient.
Safer this way, tho
#
\rm -rf gcc
\rm -rf binutils
\rm -rf msp430-libc

#
#  If these already exist, don't fetch again
#
if [ ! -s gcc-core-3.2.2.tar.bz2 ] ; then
        wget
http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-3.2.2/gcc-core-3.
<http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-3.2.2/gcc-core-3.>

2.2.
tar.bz2
fi

if [ ! -s binutils-2.11.tar.bz2 ] ; then
        wget
ftp://sources.redhat.com/pub/binutils/releases/binutils-2.11.tar.bz2
<ftp://sources.redhat.com/pub/binutils/releases/binutils-2.11.tar.bz2> 
fi

#
#  Login to CVS, pull the patches down
#
echo "Hit <return> when prompted for password"
cvs -d:pserver:anonymous@anon...:/cvsroot/mspgcc
login
cvs -z3 -d:pserver:anonymous@anon...:/cvsroot/mspgcc
co
gcc
cvs -z3 -d:pserver:anonymous@anon...:/cvsroot/mspgcc
co
binutils
cvs -z3 -d:pserver:anonymous@anon...:/cvsroot/mspgcc
co
msp430-libc

#
#  Build the binutils and install
#
if [ ! -s binutils-2.11.tar.bz2 ] ; then
        echo "Eeek!  Where did the binutils-2.11.tar.bz2 file go?!?"
        exit
fi

\rm -rf binutils-2.11
tar --bzip2 -xf binutils-2.11.tar.bz2 || exit
\cp -a binutils/binutils-2.11/* binutils-2.11
cd binutils-2.11
./configure --target=msp430 --prefix=$PREFIXROOT
(make && make install) || exit
cd ..

#
#  Build the compiler and install
#
if [ ! -s gcc-core-3.2.2.tar.bz2 ] ; then
        echo "Eeek!  Where did the gcc-core-3.2.2.tar.bz2 go?!?"
        exit
fi

\rm -rf gcc-3.2.2
tar --bzip2 -xf gcc-core-3.2.2.tar.bz2 || exit
\cp -a gcc/gcc-3.3/gcc/* gcc-3.2.2/gcc
cd gcc-3.2.2
./configure --target=msp430 --prefix=$PREFIXROOT
(make && make install) || exit
cd ..

#
#  Build the libraries and install
#
cd msp430-libc/src
sed -e "s#^prefix[ ]*=.*#prefix=$PREFIXROOT#" Makefile
>Makefile.tmp
\mv Makefile.tmp Makefile
(make && make install) || exit
cd ../..

#
#  We should be OK to go
#
echo ""
echo ""
echo "It appears we completed with no errors.  MSP430 version of GCC
is"
echo "installed in $PREFIXROOT.  Create a simple test program,"
echo "then compile with:"
echo ""
echo "   $PREFIXROOT/bin/msp430-gcc mytest.c -o mytest"
echo "   $PREFIXROOT/bin/msp430-objdump mytest"
echo ""
--------------------------------- Cut Here
---

-----Original Message-----
From: Martijn Broens [mailto:martijn@mart...]
Sent: Monday, April 28, 2003 10:48
To: msp430@msp4...
Subject: RE: [msp430] IAR V2.10


Hi Stephen,

Thanks (John to) the problems I'm having is that for some reason I can
set breakpoint practically anywhere, but in one file, and, yep you guest
it, that's the file that I don't trust. Further if I let It run freely
then after receiving data over one comport the whole thing resets.
Pretty annoying.

Futher John, I've just setup a linux system but I'm new here, I found
some code sample form the SOS which look nice to try, but I don't know
where to start using gnu, have you got any suggestions??


thanks,
Martijn
-----Oorspronkelijk bericht-----
Van: Stephen Bashford [mailto:sbashford@sbas...] 
Verzonden: maandag 28 april 2003 16:29
Aan: msp430@msp4...
Onderwerp: Re: [msp430] IAR V2.10

>
> Any one else using V2.10 of IAR?? What are you're findings?? My code
> used to run but now it doesn't anymore does anyone have any
> suggestions???
>
I've been using v2.10a for about 4 weeks now.

The porting from v1.26b to v2.10a was quite a problem. I found several
bugs
in the io430x14x.h header file. Some serious, some not such a problem.

For example the register definitions for ME2 register were wrong so the
UART
was never being enabled.

The jmpbuf definition is wrong and can lead to variable being
overwritten.


However, I now have my code ported to v2.10a and it's running fine.

What sort of problems are you having?

Have you downloaded the latest header files from the support website?
There
is an update available.

Failing that v2.20a is due to be released on 9th May.

Stephen





Yahoo! Groups Sponsor

< http://rd.yahoo.com/M"9633.3212141.4526654.2595810/D=egroupweb/S05
<http://rd.yahoo.com/M"9633.3212141.4526654.2595810/D=egroupweb/S05> 
005378:HM/A56779/R=0/*http:/shop.store.yahoo.com/cgi-bin/clink?ftd2+s
hopping:dmad/M"9633.3212141.4526654.2595810/D=egroupweb/S05005378:H
M/A56779/R=1/1051540124+ http://www.ftd.co" target="_blank" rel="nofollow">http://us.rmi.yahoo.com/rmi/http://www.ftd.co
<http://www.ftd.co>" target="_blank" rel="nofollow">http://us.rmi.yahoo.com/rmi/http://www.ftd.co> 
< http://us.rmi.yahoo.com/rmi/http:/www.ftd.co
<http://us.rmi.yahoo.com/rmi/http:/www.ftd.co> > 
m/rmi-framed-url/ http://www.ftd.com/yahoo36 <http://www.ftd.com/yahoo36>
> 

< http://us.adserver.yahoo.com/l?M"9633.3212141.4526654.2595810/D=egrou
<http://us.adserver.yahoo.com/l?M"9633.3212141.4526654.2595810/D=egrou> 
pmail/S=:HM/A56779/randb1084411> 

.



">http://docs.yahoo.com/info/terms/ <http://docs.yahoo.com/info/terms/>
> . 





Yahoo! Groups Sponsor



.



">http://docs.yahoo.com/info/terms/ <http://docs.yahoo.com/info/terms/>
> . 






Yahoo! Groups Sponsor	
	
 
<http://us.adserver.yahoo.com/l?M"9633.3212141.4526654.2595810/D=egroupmai
l/S=:HM/A56779/randH3749359> 	

.



">http://docs.yahoo.com/info/terms/> . 








Memfault Beyond the Launch