The purpose of this group is to foster exchange of information on the Texas Instruments MSP430 family of microcontrollers and related tools. Everyone welcome, all levels of familiarity/expertise.
Re: Help needed getting-started with msp430-gcc as an assembler/link - David Feldman - Aug 13 9:53:33 2009
Dan,
Thank you very much for the pointers - it is getting me closer to solving
the problem I'm working on.
I think the main thing I'm puzzled by is how to relocate the object file
into the 430's flash memory space. As you pointed out, and I discovered,
"org" does not fix that - it just creates a giant pile of zero-value bytes
in the resulting .text section.
The thing I'm still missing is where/how to supply the absolute start
address for the object code. I agree it should be the same between C and
assembly source, but I couldn't find an example yet. Would you be able to
send an example so I can narrow my search of the documentation?
Very thanks,
Dave
###
>5c. Re: Help needed getting-started with msp430-gcc as an assembler/link
> Posted by: "Dan Bloomquist" y...@lakeweb.net lakeweb
> Date: Wed Aug 12, 2009 11:39 pm ((PDT))
> ...
>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?)
> ...
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
Re: Re: Help needed getting-started with msp430-gcc as an assembler/link - Howard Hansen - Aug 13 11:05:10 2009
The book "MSP430 Microcontroller Basics: says on page 76 and 77: "In the
MSP430 the address of the first instruction to be executed is stored in
a specific location in flash memory, rather than the instruction
itself. This address is called the reset vector, occupies the highest 2
bytes of the vector table at 0xFFFE.FFFF.
The book "MSP Microcontroller Basics" may be downloaded for free.
Several Bit Torrent sites and Rapid Share have it. But be warned some
of the Bit Torrent sites also push pornography. Chapter 4 has some
simple programs written in both C and assembly language. The programs
although written using IAR Kickstart IDE may provide a few hints. Like
possibly using RSEG in place of ORG to specify where code should be
placed in memory.
Howard
David Feldman wrote:
>
>
> Dan,
>
> Thank you very much for the pointers - it is getting me closer to solving
> the problem I'm working on.
>
> I think the main thing I'm puzzled by is how to relocate the object file
> into the 430's flash memory space. As you pointed out, and I discovered,
> "org" does not fix that - it just creates a giant pile of zero-value bytes
> in the resulting .text section.
>
> The thing I'm still missing is where/how to supply the absolute start
> address for the object code. I agree it should be the same between C and
> assembly source, but I couldn't find an example yet. Would you be able to
> send an example so I can narrow my search of the documentation?
>
> Very thanks,
>
> Dave
>
> ###
>
> >5c. Re: Help needed getting-started with msp430-gcc as an assembler/link
> > Posted by: "Dan Bloomquist" y...@lakeweb.net
>
lakeweb
> > Date: Wed Aug 12, 2009 11:39 pm ((PDT))
> > ...
> >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?)
> > ...
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: Re: Help needed getting-started with msp430-gcc as an assembler/link - Bart Oegema - Aug 13 11:59:11 2009
I'm not aware of a legal way to download the book for free. If it is a
worthwhile resource (as it seems to be), why not pay for it? It's $45
with free shipping on Amazon, and I'm sure there are other sources
worldwide since it's published by Elsevier.
- Bart
On Thu, Aug 13, 2009 at 8:05 AM, Howard Hansen
wrote:
>
> The book "MSP Microcontroller Basics" may be downloaded for free.
> Several Bit Torrent sites and Rapid Share have it. But be warned some
> of the Bit Torrent sites also push pornography. Chapter 4 has some
> simple programs written in both C and assembly language. The programs
> although written using IAR Kickstart IDE may provide a few hints. Like
> possibly using RSEG in place of ORG to specify where code should be
> placed in memory.
>
> Howard
>
> David Feldman wrote:
>> Dan,
>>
>> Thank you very much for the pointers - it is getting me closer to solving
>> the problem I'm working on.
>>
>> I think the main thing I'm puzzled by is how to relocate the object file
>> into the 430's flash memory space. As you pointed out, and I discovered,
>> "org" does not fix that - it just creates a giant pile of zero-value bytes
>> in the resulting .text section.
>>
>> The thing I'm still missing is where/how to supply the absolute start
>> address for the object code. I agree it should be the same between C and
>> assembly source, but I couldn't find an example yet. Would you be able to
>> send an example so I can narrow my search of the documentation?
>>
>> Very thanks,
>>
>> Dave
>>
>> ###
>>
>> >5c. Re: Help needed getting-started with msp430-gcc as an assembler/link
>> > Posted by: "Dan Bloomquist" y...@lakeweb.net
>> lakeweb
>> > Date: Wed Aug 12, 2009 11:39 pm ((PDT))
>> > ...
>> >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?)
>> > ...
------------------------------------
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: Re: Help needed getting-started with msp430-gcc as an assembler/link - Dan Bloomquist - Aug 13 13:06:44 2009
David Feldman wrote:
> Dan,
>
> Thank you very much for the pointers - it is getting me closer to solving
> the problem I'm working on.
>
> I think the main thing I'm puzzled by is how to relocate the object file
> into the 430's flash memory space. As you pointed out, and I discovered,
> "org" does not fix that - it just creates a giant pile of zero-value bytes
> in the resulting .text section.
>
> The thing I'm still missing is where/how to supply the absolute start
> address for the object code. I agree it should be the same between C and
> assembly source, but I couldn't find an example yet. Would you be able to
> send an example so I can narrow my search of the documentation?
>
Hi Dave,
Quick search and I found this:
http://www.motherboardpoint.com/msp430-using-assembler-only-mspgcc-t89711.html
So I tried the example, with just an empty main, like:
msp430-gcc -mmcu=msp430x1121 -mendup-at=main -S "temp.c" -save-temps
msp430-gcc -mmcu=msp430x1121 -mendup-at=main -v "temp.s" -save-temps
msp430-objdump -D a.out >temp.lst
And it works like a charm. The code in the dump is located correctly. So
in the temp.s there is:
.arch msp430x1121
.text
And it is a guess, but .arch tells the assembler where to put the code
and set the vector table according to the device.
I'm curious, why do you want to everything in assembly? C is so much
easier, that is one reason it was invented.
Best, Dan.
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
Re: Re: Help needed getting-started with msp430-gcc as an assembler/link - Howard Hansen - Aug 13 13:13:00 2009
I learned about the availability of the download from the message
"Download very useful MSP430 learning and programming book" dated July
25, 2009 sent to members of this Yahoo mail group and I am just
repeating information previously sent to members of this mail group.
For the record I bought a copy of the "MSP Microcontroller Basics" book
on Jul;y 23, 2009 from Amazon.
Howard
Bart Oegema wrote:
>
>
> I'm not aware of a legal way to download the book for free. If it is a
> worthwhile resource (as it seems to be), why not pay for it? It's $45
> with free shipping on Amazon, and I'm sure there are other sources
> worldwide since it's published by Elsevier.
>
> - Bart
>
> On Thu, Aug 13, 2009 at 8:05 AM, Howard Hansen
>
> wrote:
> >
> > The book "MSP Microcontroller Basics" may be downloaded for free.
> > Several Bit Torrent sites and Rapid Share have it. But be warned some
> > of the Bit Torrent sites also push pornography. Chapter 4 has some
> > simple programs written in both C and assembly language. The programs
> > although written using IAR Kickstart IDE may provide a few hints. Like
> > possibly using RSEG in place of ORG to specify where code should be
> > placed in memory.
> >
> > Howard
>
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )