Forums

Help needed getting-started with msp430-gcc as an assembler/linker

Started by David Feldman August 13, 2009
I'm struggling to get started with msp430-gcc (on a Ubuntu 9.04 machine) as a cross-assembler/linker with target of msp430. I do not intend to use an IDE (no eclipse can be used as access to my development system is solely via ssh/telnet), so all is happening at command line. Source code is MSP430 assembly language (my target is MSP430F1232) and expected output from assembly/link is intel hex format (my msp430f1232 target has a small loader expecting intel hex on the serial port). I am having trouble figuring out the correct command line options or assembly language source directives so that my program ends up starting it's code at E000 hex (right now, it appears my command line parameters to msp430-gcc leave the binary output with all "0000" hex at any place where a symbol should be resolved - not usable!)

Anyone able to lend a hand in terms of simple source code example and msp430-gcc command line parameters?

Very tks,

Dave

Beginning Microcontrollers with the MSP430

You may want to try: m...@lists.sourceforge.net

--- In m..., "David Feldman" wrote:
>
> I'm struggling to get started with msp430-gcc (on a Ubuntu 9.04 machine) as a cross-assembler/linker with target of msp430. I do not intend to use an IDE (no eclipse can be used as access to my development system is solely via ssh/telnet), so all is happening at command line. Source code is MSP430 assembly language (my target is MSP430F1232) and expected output from assembly/link is intel hex format (my msp430f1232 target has a small loader expecting intel hex on the serial port). I am having trouble figuring out the correct command line options or assembly language source directives so that my program ends up starting it's code at E000 hex (right now, it appears my command line parameters to msp430-gcc leave the binary output with all "0000" hex at any place where a symbol should be resolved - not usable!)
>
> Anyone able to lend a hand in terms of simple source code example and msp430-gcc command line parameters?
>
> Very tks,
>
> Dave
>
old_cow_yellow wrote:
> You may want to try: m...@lists.sourceforge.net
>
Hay oyc,
He has been there!

> --- In m..., "David Feldman" wrote:
>
>> I'm struggling to get started with msp430-gcc (on a Ubuntu 9.04 machine) as a cross-assembler/linker with target of msp430. I do not intend to use an IDE (no eclipse can be used as access to my development system is solely via ssh/telnet), so all is happening at command line. Source code is MSP430 assembly language (my target is MSP430F1232) and expected output from assembly/link is intel hex format (my msp430f1232 target has a small loader expecting intel hex on the serial port). I am having trouble figuring out the correct command line options or assembly language source directives so that my program ends up starting it's code at E000 hex (right now, it appears my command line parameters to msp430-gcc leave the binary output with all "0000" hex at any place where a symbol should be resolved - not usable!)
>>
>> Anyone able to lend a hand in terms of simple source code example and msp430-gcc command line parameters?
>>

I'm not sure why you are having troubles as I have never tried to
assemble directly with 'that' tool. (As I recall you are trying to use
the assembler directly.) I do know that you can assemble fine with
msp430-gcc. Here is a typical line for a .s file:

msp430-gcc -mmcu=msp430x1612 -v -x assembler-with-cpp
-IC:/cpp/mspgcc/msp430/include -o "setdco.o" "../setdco.s" -g -O0
-D_GNU_ASSEMBLER_ -nostdlib

Of course this creates relative object code. Now, if you want to build
for absolute memory you will, as has been recommended, use directives
much like the compiler would do*. (and is that not as simple as .org?*
[or] take the device directives from the headers and use them like the
compiler would?)

And if you follow my link, you will see there is no reason, I can see,
that your includes from the C headers can not be used for assembly. I
think your out of the gate troubles, on that issue, is using the wrong
tool. I don't know, but the C preprocessor may be required for C
headers, does this make sense to you?



I still don't see your need to wrap a 'main' with assembly. The gcc
compiler can do this fine for you. But if you must, and has been pointed
out, do what the compiler would do so you don't have to re-invent that
wheel*.

Free energy folks can't seem to ditch the preconceived ideas fed to
them. If you are to be successful at what you do, you will need to come
to the dark side.....

Now, I use the command line compiler, so I don't use an IDE on that end.
I will as often switch to notpad++ to edit my code. But I see a pile of
work, and getting use to, for a command line debugger. I mean, there is
so much going on when you develop on a device and you will want all that
information at your fingertips. I seriously recommend you develop as
much as you can on something local using eclipse, (gads, it is so
cheap!). There is no point in rubbing sticks together when you can use
an electronic cigarette lighter.

Well, this has been fun. I have a feeling you won't get there from here
unless you listen to your sounding board(s)...

*and as has been pointed out, dump some compiler code and see what the
complier does, without a problem.

Best, Dan.