Forums

CCS linker and boot loader

Started by bhaltulpule April 17, 2010
I am new to CCS and TI MSP430. Have used Keil compiler before.

I am trying to use a bootloader in C which can get data from a serial port and update the Flash with application code.

I did this in Keil toolset by using simple linker commands to locate the App. code at always the same address. The bootloader copied the new code to this address and then could be signaled to jump to it..

I have read many of the posts but can't find how to do this on MSP430. Maybe that is because I can't find the CCS linker commands and how to tell the linker to do this..

Is this possible in CCS and MSP430 ?

Any help that anyone can provide would be much appreciated..

Thanks.

Bhal Tulpule

Beginning Microcontrollers with the MSP430

Better the devil you know, use Keil and do whatever you did before.
Or, use CCS and do whatever CCS allows you to do.

--- In m..., "bhaltulpule" wrote:
>
> I am new to CCS and TI MSP430. Have used Keil compiler before.
>
> I am trying to use a bootloader in C which can get data from a serial port and update the Flash with application code.
>
> I did this in Keil toolset by using simple linker commands to locate the App. code at always the same address. The bootloader copied the new code to this address and then could be signaled to jump to it..
>
> I have read many of the posts but can't find how to do this on MSP430. Maybe that is because I can't find the CCS linker commands and how to tell the linker to do this..
>
> Is this possible in CCS and MSP430 ?
>
> Any help that anyone can provide would be much appreciated..
>
> Thanks.
>
> Bhal Tulpule
>

Folks,
I have no choice but to use CCS because Keil does not support MSP430. So how about some constructive suggestions, if any ?
Bhal Tulpule

--- In m..., "old_cow_yellow" wrote:
>
> Better the devil you know, use Keil and do whatever you did before.
> Or, use CCS and do whatever CCS allows you to do.
>
> --- In m..., "bhaltulpule" wrote:
> >
> > I am new to CCS and TI MSP430. Have used Keil compiler before.
> >
> > I am trying to use a bootloader in C which can get data from a serial port and update the Flash with application code.
> >
> > I did this in Keil toolset by using simple linker commands to locate the App. code at always the same address. The bootloader copied the new code to this address and then could be signaled to jump to it..
> >
> > I have read many of the posts but can't find how to do this on MSP430. Maybe that is because I can't find the CCS linker commands and how to tell the linker to do this..
> >
> > Is this possible in CCS and MSP430 ?
> >
> > Any help that anyone can provide would be much appreciated..
> >
> > Thanks.
> >
> > Bhal Tulpule
>

On Sat, 17 Apr 2010 17:08:37 -0000, you wrote:

> I am new to CCS and TI MSP430. Have used Keil compiler
> before.

I've never used, nor downloaded even, CCS. Nor used the Keil
compiler, except just to verify one sample program, once.

** This does not qualify me as an expert here. **

> I am trying to use a bootloader in C which can get data from
> a serial port and update the Flash with application code.

I'll assume this is something you've already done for a
different processor, given the troubles you are discussing
here.

> I did this in Keil toolset by using simple linker commands
> to locate the App. code at always the same address. The
> bootloader copied the new code to this address and then
> could be signaled to jump to it..
>
> I have read many of the posts but can't find how to do this
> on MSP430.

I'm not sure, but the CCS manual does discuss being able to
make adjustments to the linker via Project/Build Options,
from the menu. Supposedly, that lets you change linker
options. Since I can't check, you'll have to see what is
there. Whether or not they apply to your situation is
another question.

It's been my experience that you need to specially name the
code segment and properly specify it also in a linker input
file. How this is done with a c compiler varies a great
deal. I did a quick search and readily found this link
potentially useful:

http://focus.ti.com/lit/ug/slau157k/slau157k.pdf

Specifically, look at B.3.3. That seems pretty clear to me,
as to naming code segments with CCS. I'm surprised you
didn't find it or, at least, mention finding it in your
query. It was easily discovered with google.

Once code is being properly placed into some named code
segment of your choosing, and the above appears to do that
much, you are then faced with letting the linker know about
it.

>Maybe that is because I can't find the CCS linker
>commands and how to tell the linker to do this..

Since I didn't know anything about CCS, google found this for
me right away:

http://focus.ti.com/lit/ug/slau132c/slau132c.pdf

Example 4-1 provides a clear example of one case of a linker
input file. Sadly, that PDF doesn't go into much detail
about it, though with a little care you could probably work
it out, anyway.

A second google search readily found this:

http://focus.ti.com/lit/ug/slau131d/slau131d.pdf

Sections 7.7 and 7.8 seem particularly useful.

> Is this possible in CCS and MSP430 ?

Seems so. Either I'm being too easily confused by what I've
read in the above links or else I'm just surprised you
weren't able to find this stuff on your own. It was trivial
to find and I don't use these tools, at all.

> Any help that anyone can provide would be much appreciated..

Well, take a look and see if I got something close for you.

> Thanks.
>
>Bhal Tulpule

Jon
Thanks for the Constructive suggestions.
I kept searching in the wrong places. This gives me a lot to go on.
Thanks.

Bhal

--- In m..., Jon Kirwan wrote:
>
> On Sat, 17 Apr 2010 17:08:37 -0000, you wrote:
>
> > I am new to CCS and TI MSP430. Have used Keil compiler
> > before.
>
> I've never used, nor downloaded even, CCS. Nor used the Keil
> compiler, except just to verify one sample program, once.
>
> ** This does not qualify me as an expert here. **
>
> > I am trying to use a bootloader in C which can get data from
> > a serial port and update the Flash with application code.
>
> I'll assume this is something you've already done for a
> different processor, given the troubles you are discussing
> here.
>
> > I did this in Keil toolset by using simple linker commands
> > to locate the App. code at always the same address. The
> > bootloader copied the new code to this address and then
> > could be signaled to jump to it..
> >
> > I have read many of the posts but can't find how to do this
> > on MSP430.
>
> I'm not sure, but the CCS manual does discuss being able to
> make adjustments to the linker via Project/Build Options,
> from the menu. Supposedly, that lets you change linker
> options. Since I can't check, you'll have to see what is
> there. Whether or not they apply to your situation is
> another question.
>
> It's been my experience that you need to specially name the
> code segment and properly specify it also in a linker input
> file. How this is done with a c compiler varies a great
> deal. I did a quick search and readily found this link
> potentially useful:
>
> http://focus.ti.com/lit/ug/slau157k/slau157k.pdf
>
> Specifically, look at B.3.3. That seems pretty clear to me,
> as to naming code segments with CCS. I'm surprised you
> didn't find it or, at least, mention finding it in your
> query. It was easily discovered with google.
>
> Once code is being properly placed into some named code
> segment of your choosing, and the above appears to do that
> much, you are then faced with letting the linker know about
> it.
>
> >Maybe that is because I can't find the CCS linker
> >commands and how to tell the linker to do this..
>
> Since I didn't know anything about CCS, google found this for
> me right away:
>
> http://focus.ti.com/lit/ug/slau132c/slau132c.pdf
>
> Example 4-1 provides a clear example of one case of a linker
> input file. Sadly, that PDF doesn't go into much detail
> about it, though with a little care you could probably work
> it out, anyway.
>
> A second google search readily found this:
>
> http://focus.ti.com/lit/ug/slau131d/slau131d.pdf
>
> Sections 7.7 and 7.8 seem particularly useful.
>
> > Is this possible in CCS and MSP430 ?
>
> Seems so. Either I'm being too easily confused by what I've
> read in the above links or else I'm just surprised you
> weren't able to find this stuff on your own. It was trivial
> to find and I don't use these tools, at all.
>
> > Any help that anyone can provide would be much appreciated..
>
> Well, take a look and see if I got something close for you.
>
> > Thanks.
> >
> >Bhal Tulpule
>
> Jon
>

On Sat, 17 Apr 2010 21:36:21 -0000, you wrote:

> Thanks for the Constructive suggestions.

You are, of course, welcome.

> I kept searching in the wrong places.

I wish I understood why, though.

I immediately went to the right places, one after another. It
was, as I said earlier, trivial. I didn't time myself, but
it seemed like less than 10 minutes to do the very few
searches required, grab the PDFs that were quickly identified
that way, zap to the pages that looked correct, and compose
the email. I was intentionally cutting myself short, in
fact.

What caused you trouble when you actually are using these
tools and have past experience elsewhere and then also didn't
cause me trouble when I don't use any of these tools at all,
remains a question you might wish to explore on your own.

> This gives me a lot to go on.
> Thanks.

Best of luck from here on out.

>Bhal

Jon

>
>--- In m..., Jon Kirwan wrote:
>>
>> On Sat, 17 Apr 2010 17:08:37 -0000, you wrote:
>>
>> > I am new to CCS and TI MSP430. Have used Keil compiler
>> > before.
>>
>> I've never used, nor downloaded even, CCS. Nor used the Keil
>> compiler, except just to verify one sample program, once.
>>
>> ** This does not qualify me as an expert here. **
>>
>> > I am trying to use a bootloader in C which can get data from
>> > a serial port and update the Flash with application code.
>>
>> I'll assume this is something you've already done for a
>> different processor, given the troubles you are discussing
>> here.
>>
>> > I did this in Keil toolset by using simple linker commands
>> > to locate the App. code at always the same address. The
>> > bootloader copied the new code to this address and then
>> > could be signaled to jump to it..
>> >
>> > I have read many of the posts but can't find how to do this
>> > on MSP430.
>>
>> I'm not sure, but the CCS manual does discuss being able to
>> make adjustments to the linker via Project/Build Options,
>> from the menu. Supposedly, that lets you change linker
>> options. Since I can't check, you'll have to see what is
>> there. Whether or not they apply to your situation is
>> another question.
>>
>> It's been my experience that you need to specially name the
>> code segment and properly specify it also in a linker input
>> file. How this is done with a c compiler varies a great
>> deal. I did a quick search and readily found this link
>> potentially useful:
>>
>> http://focus.ti.com/lit/ug/slau157k/slau157k.pdf
>>
>> Specifically, look at B.3.3. That seems pretty clear to me,
>> as to naming code segments with CCS. I'm surprised you
>> didn't find it or, at least, mention finding it in your
>> query. It was easily discovered with google.
>>
>> Once code is being properly placed into some named code
>> segment of your choosing, and the above appears to do that
>> much, you are then faced with letting the linker know about
>> it.
>>
>> >Maybe that is because I can't find the CCS linker
>> >commands and how to tell the linker to do this..
>>
>> Since I didn't know anything about CCS, google found this for
>> me right away:
>>
>> http://focus.ti.com/lit/ug/slau132c/slau132c.pdf
>>
>> Example 4-1 provides a clear example of one case of a linker
>> input file. Sadly, that PDF doesn't go into much detail
>> about it, though with a little care you could probably work
>> it out, anyway.
>>
>> A second google search readily found this:
>>
>> http://focus.ti.com/lit/ug/slau131d/slau131d.pdf
>>
>> Sections 7.7 and 7.8 seem particularly useful.
>>
>> > Is this possible in CCS and MSP430 ?
>>
>> Seems so. Either I'm being too easily confused by what I've
>> read in the above links or else I'm just surprised you
>> weren't able to find this stuff on your own. It was trivial
>> to find and I don't use these tools, at all.
>>
>> > Any help that anyone can provide would be much appreciated..
>>
>> Well, take a look and see if I got something close for you.
>>
>> > Thanks.
>> >
>> >Bhal Tulpule
>>
>> Jon
>