GCC MSP430

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

GCC MSP430

Ilya Dmitrichenko
Hi,

I have just built the toolchain and it mostly works, but the newlib is not
exactly multi-target, it only has "430x" subdirectory. The question is
whether it's just a build issue or 430x is all what newlib currently
supports?

Cheers,
--
Ilya

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: GCC MSP430

Ilya Dmitrichenko
It is actually a bit more odd then I thought:

% cat test.c
#include <msp430fr5739.h>

int main() { return 0; };

% msp430-elf-gcc -mmcu=msp430fr5739 test.c
-I/home/ilya/msp430/msp430-elf-21092013-0/msp430-elf/include/msp430
/home/ilya/msp430/msp430-elf-21092013-0/bin/../lib/gcc/msp430-elf/4.9.0/../../../../msp430-elf/bin/ld:
error: /tmp/cc5edjEZ.o uses MSP430X instructions but
/home/ilya/msp430/msp430-elf-21092013-0/bin/../lib/gcc/msp430-elf/4.9.0/../../../../msp430-elf/lib/crt0.o
uses MSP430
/home/ilya/msp430/msp430-elf-21092013-0/bin/../lib/gcc/msp430-elf/4.9.0/../../../../msp430-elf/bin/ld:
failed to merge target specific data of file /tmp/cc5edjEZ.o
collect2: error: ld returned 1 exit status

Perhaps I was wrong in blaming newlib, not sure what's missing
actually... May be this is the clue:

% msp430-elf-ld -mmcpu=msp430x
msp430-elf-ld: unrecognised emulation mode: mcpu=msp430x
Supported emulations: msp430x110 msp430x112 msp430x1101 msp430x1111
msp430x1121 msp430x1122 msp430x1132 msp430x122 msp430x123 msp430x1222
msp430x1232 msp430x133 msp430x135 msp430x1331 msp430x1351 msp430x147
msp430x148 msp430x149 msp430x155 msp430x156 msp430x157 msp430x167
msp430x168 msp430x169 msp430x1610 msp430x1611 msp430x1612 msp430x2101
msp430x2111 msp430x2121 msp430x2131 msp430x311 msp430x312 msp430x313
msp430x314 msp430x315 msp430x323 msp430x325 msp430x336 msp430x337
msp430x412 msp430x413 msp430x415 msp430x417 msp430xE423 msp430xE425
msp430xE427 msp430xW423 msp430xW425 msp430xW427 msp430xG437
msp430xG438 msp430xG439 msp430x435 msp430x436 msp430x437 msp430x447
msp430x448 msp430x449 msp430X

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: GCC MSP430

Eric Decker
you should be doing something like -mmcu=msp430fr5739

i'm not sure what -mmcu=msp430x does


On Mon, Sep 23, 2013 at 3:38 AM, Ilya Dmitrichenko <[hidden email]
> wrote:

> It is actually a bit more odd then I thought:
>
> % cat test.c
> #include <msp430fr5739.h>
>
> int main() { return 0; };
>
> % msp430-elf-gcc -mmcu=msp430fr5739 test.c
> -I/home/ilya/msp430/msp430-elf-21092013-0/msp430-elf/include/msp430
>
> /home/ilya/msp430/msp430-elf-21092013-0/bin/../lib/gcc/msp430-elf/4.9.0/../../../../msp430-elf/bin/ld:
> error: /tmp/cc5edjEZ.o uses MSP430X instructions but
>
> /home/ilya/msp430/msp430-elf-21092013-0/bin/../lib/gcc/msp430-elf/4.9.0/../../../../msp430-elf/lib/crt0.o
> uses MSP430
>
> /home/ilya/msp430/msp430-elf-21092013-0/bin/../lib/gcc/msp430-elf/4.9.0/../../../../msp430-elf/bin/ld:
> failed to merge target specific data of file /tmp/cc5edjEZ.o
> collect2: error: ld returned 1 exit status
>
> Perhaps I was wrong in blaming newlib, not sure what's missing
> actually... May be this is the clue:
>
> % msp430-elf-ld -mmcpu=msp430x
> msp430-elf-ld: unrecognised emulation mode: mcpu=msp430x
> Supported emulations: msp430x110 msp430x112 msp430x1101 msp430x1111
> msp430x1121 msp430x1122 msp430x1132 msp430x122 msp430x123 msp430x1222
> msp430x1232 msp430x133 msp430x135 msp430x1331 msp430x1351 msp430x147
> msp430x148 msp430x149 msp430x155 msp430x156 msp430x157 msp430x167
> msp430x168 msp430x169 msp430x1610 msp430x1611 msp430x1612 msp430x2101
> msp430x2111 msp430x2121 msp430x2131 msp430x311 msp430x312 msp430x313
> msp430x314 msp430x315 msp430x323 msp430x325 msp430x336 msp430x337
> msp430x412 msp430x413 msp430x415 msp430x417 msp430xE423 msp430xE425
> msp430xE427 msp430xW423 msp430xW425 msp430xW427 msp430xG437
> msp430xG438 msp430xG439 msp430x435 msp430x436 msp430x437 msp430x447
> msp430x448 msp430x449 msp430X
>
>
> ------------------------------------------------------------------------------
> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8,
> SharePoint
> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack
> includes
> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
> _______________________________________________
> Mspgcc-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>


--
Eric B. Decker
Senior (over 50 :-) Researcher

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: GCC MSP430

Peter Bigot-4
In reply to this post by Ilya Dmitrichenko
That output looks like an mspgcc build before I took over and replaced the
hard-coded genericized MCU list with the full set of MCUs.  Specifically,
it looks possibly like an msp430x branch mspgcc.

Dunno if msp430 gcc happened to follow that practice: I truly hope it
didn't.

Peter


On Mon, Sep 23, 2013 at 5:38 AM, Ilya Dmitrichenko <[hidden email]
> wrote:

> It is actually a bit more odd then I thought:
>
> % cat test.c
> #include <msp430fr5739.h>
>
> int main() { return 0; };
>
> % msp430-elf-gcc -mmcu=msp430fr5739 test.c
> -I/home/ilya/msp430/msp430-elf-21092013-0/msp430-elf/include/msp430
>
> /home/ilya/msp430/msp430-elf-21092013-0/bin/../lib/gcc/msp430-elf/4.9.0/../../../../msp430-elf/bin/ld:
> error: /tmp/cc5edjEZ.o uses MSP430X instructions but
>
> /home/ilya/msp430/msp430-elf-21092013-0/bin/../lib/gcc/msp430-elf/4.9.0/../../../../msp430-elf/lib/crt0.o
> uses MSP430
>
> /home/ilya/msp430/msp430-elf-21092013-0/bin/../lib/gcc/msp430-elf/4.9.0/../../../../msp430-elf/bin/ld:
> failed to merge target specific data of file /tmp/cc5edjEZ.o
> collect2: error: ld returned 1 exit status
>
> Perhaps I was wrong in blaming newlib, not sure what's missing
> actually... May be this is the clue:
>
> % msp430-elf-ld -mmcpu=msp430x
> msp430-elf-ld: unrecognised emulation mode: mcpu=msp430x
> Supported emulations: msp430x110 msp430x112 msp430x1101 msp430x1111
> msp430x1121 msp430x1122 msp430x1132 msp430x122 msp430x123 msp430x1222
> msp430x1232 msp430x133 msp430x135 msp430x1331 msp430x1351 msp430x147
> msp430x148 msp430x149 msp430x155 msp430x156 msp430x157 msp430x167
> msp430x168 msp430x169 msp430x1610 msp430x1611 msp430x1612 msp430x2101
> msp430x2111 msp430x2121 msp430x2131 msp430x311 msp430x312 msp430x313
> msp430x314 msp430x315 msp430x323 msp430x325 msp430x336 msp430x337
> msp430x412 msp430x413 msp430x415 msp430x417 msp430xE423 msp430xE425
> msp430xE427 msp430xW423 msp430xW425 msp430xW427 msp430xG437
> msp430xG438 msp430xG439 msp430x435 msp430x436 msp430x437 msp430x447
> msp430x448 msp430x449 msp430X
>
>
> ------------------------------------------------------------------------------
> LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
> 1,500+ hours of tutorials including VisualStudio 2012, Windows 8,
> SharePoint
> 2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack
> includes
> Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
> http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
> _______________________________________________
> Mspgcc-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: GCC MSP430

Ilya Dmitrichenko
On 23 September 2013 12:15, Peter Bigot <[hidden email]> wrote:
> That output looks like an mspgcc build before I took over and replaced the
> hard-coded genericized MCU list with the full set of MCUs.  Specifically, it
> looks possibly like an msp430x branch mspgcc.
>
> Dunno if msp430 gcc happened to follow that practice: I truly hope it
> didn't.

I have built binutils from binutils master branch found in
git://sourceware.org/git/binutils.git
with HEAD being e1926926db.

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: GCC MSP430

Ilya Dmitrichenko
In reply to this post by Eric Decker
On 23 September 2013 12:05, Eric Decker <[hidden email]> wrote:

> you should be doing something like -mmcu=msp430fr5739

Sure, actually this produces the same output. I just pasted the wrong thing.

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: GCC MSP430

Peter Bigot-4
In reply to this post by Ilya Dmitrichenko
On Mon, Sep 23, 2013 at 6:24 AM, Ilya Dmitrichenko <[hidden email]
> wrote:

> On 23 September 2013 12:15, Peter Bigot <[hidden email]> wrote:
> > That output looks like an mspgcc build before I took over and replaced
> the
> > hard-coded genericized MCU list with the full set of MCUs.
>  Specifically, it
> > looks possibly like an msp430x branch mspgcc.
> >
> > Dunno if msp430 gcc happened to follow that practice: I truly hope it
> > didn't.
>
> I have built binutils from binutils master branch found in
> git://sourceware.org/git/binutils.git
> with HEAD being e1926926db.
>
OK.  I'd forgotten that back in 2003 or so part of mspgcc got pushed
upstream into binutils and that it would look roughly like what you've
shown.

I have no idea how you're supposed to specify the target characteristics in
msp430 gcc.  DJ or somebody from TI will have to answer.

Peter

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: GCC MSP430

Ilya Dmitrichenko
Ok, I got this issue figured out. Seems like a dull parameter parsing bug:

% msp430-elf-gcc -mmcu=msp430 test.c
-I/home/ilya/msp430/msp430-elf-21092013-0/msp430-elf/include/msp430 -c
% msp430-elf-objdump -x test.o | grep -i arch
architecture: msp:11, flags 0x00000010:

% msp430-elf-gcc -mmcu=msp430x test.c
-I/home/ilya/msp430/msp430-elf-21092013-0/msp430-elf/include/msp430 -c
% msp430-elf-objdump -x test.o | grep -i arch
architecture: msp:430X, flags 0x00000010:

% msp430-elf-gcc -mmcu=msp430fr5739 test.c
-I/home/ilya/msp430/msp430-elf-21092013-0/msp430-elf/include/msp430 -c
% msp430-elf-objdump -x test.o | grep -i arch
architecture: msp:430X, flags 0x00000010:

So I just need to stick with generic MCU name for the time being :)

Nick/DJ, should I report this on a bug tracker?

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: GCC MSP430

nick clifton
Hi Ilya,
> So I just need to stick with generic MCU name for the time being :)
>
> Nick/DJ, should I report this on a bug tracker?

Yes please. :-)

Cheers
   Nick



------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: GCC MSP430

Ilya Dmitrichenko
Submitted: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58507

------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13.
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: GCC MSP430

DJ Delorie
In reply to this post by Ilya Dmitrichenko

There are three multilibs that are built:

430 - the "default" so it doesn't have a subdir - is for all non-430X processors.

430x - for 430X series processors, but still using 16-bit pointers.

430x/large - for 430X series processors using 20-bit pointers.


For each of those, newlib is built using a "common subset" so it works
for any (I hope) processor in that category.

GCC (msp430-elf-gcc, not mspgcc) has two options it looks at:

  -mmcu=<whatever> - if <whatever> has "430x" or "430X" in it, you get
   the 430x family.  Default is the 430 family.

  -mlarge - enables 20-bit pointers.

IIRC there's also -mcpu= which specifies the family (430/430x)
directly, for when the MCU name doesn't match the pattern.


Also, keep in mind that newlib is not targetted specifically to the
430's needs.  It's a generic runtime library so tends to be more "one
size fits all" than "one variant per chip" like mspgcc's library.

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users
Reply | Threaded
Open this post in threaded view
|

Re: GCC MSP430

Peter Bigot-4
To correct the mistaken description how mspgcc's library works without
getting into details you don't want to know:

mspgcc does not have one variant per chip, but the libraries do have
variants across the axes that affect code generation: three meaningful CPU
architectures (two used for libraries), hardware multiplier support (five
variants, but only two affect libraries), and memory model which supports
four binary options (7 variants are built, but six only apply to CPUX).

Comes down to 16 total variants, supporting 434 distinct MCUs.  Doesn't
take too long to build or too much space since msp430-libc isn't as large
as newlib.

Peter

On Mon, Sep 23, 2013 at 12:27 PM, DJ Delorie <[hidden email]> wrote:

>
> There are three multilibs that are built:
>
> 430 - the "default" so it doesn't have a subdir - is for all non-430X
> processors.
>
> 430x - for 430X series processors, but still using 16-bit pointers.
>
> 430x/large - for 430X series processors using 20-bit pointers.
>
>
> For each of those, newlib is built using a "common subset" so it works
> for any (I hope) processor in that category.
>
> GCC (msp430-elf-gcc, not mspgcc) has two options it looks at:
>
>   -mmcu=<whatever> - if <whatever> has "430x" or "430X" in it, you get
>    the 430x family.  Default is the 430 family.
>
>   -mlarge - enables 20-bit pointers.
>
> IIRC there's also -mcpu= which specifies the family (430/430x)
> directly, for when the MCU name doesn't match the pattern.
>
>
> Also, keep in mind that newlib is not targetted specifically to the
> 430's needs.  It's a generic runtime library so tends to be more "one
> size fits all" than "one variant per chip" like mspgcc's library.
>
>
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most
> from
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
> _______________________________________________
> Mspgcc-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users