EmbeddedRelated.com
Forums
Memfault Beyond the Launch

How to convert projects from TI in IAR format to work with them in CrossStudio

Started by lvagasi March 10, 2009
HI All,

First of all the new 2.0 version of CrossStudio is really cool. Thanks for Rowley's team for the great job.

I hope some one has already faced to a similar problem and can help.
Ti is kind enough to provide sample projects for their's gadgets like the MSP430-RF2500 modules but it is available only for IAR tools.
I'm personally prefer RA's tool so I'd like to use it for experimenting with the modules.

What I have already did is: Started a new project copied all the .c and .h files under the project dir, added the .c files to the project. I have kept the dir hierarchy from IAR so I had to add all the necessary dirs to the System include directories property of CrossStudio.

Now it does not complains about missing headers but still cannot resolve some function names etc. (i.e. I got error message missing prototype.)

So I think it is time to ask for help from someone more experienced or who has already did such a conversion earlier. I would appreciate any kind of help. A link to a document to follow is the best. :-)

Some of my questions are follows:
1. Should I define which is the project's main file to start compile and build with. If yes how should I do this.
2. How can I tell the linker to use a library (.lib) provided by TI.
3. There were some "defines" in several .dat files in IAR I just have added some #define statements to one of my files. Is that correct, or there is a more elegant way to do this.
4. What should I do with the MODEL assembly directive which were used in IAR?
5. The same question with the error directives?

Sorry for the long post.
I really appreciate any help regarding this issue.
Thanks in advance.

Best regards,
Blaise

Beginning Microcontrollers with the MSP430

I thought c is easy to port.

--- In m..., "lvagasi" wrote:
>
> HI All,
>
> First of all the new 2.0 version of CrossStudio is really cool. Thanks for Rowley's team for the great job.
>
> I hope some one has already faced to a similar problem and can help.
> Ti is kind enough to provide sample projects for their's gadgets like the MSP430-RF2500 modules but it is available only for IAR tools.
> I'm personally prefer RA's tool so I'd like to use it for experimenting with the modules.
>
> What I have already did is: Started a new project copied all the .c and .h files under the project dir, added the .c files to the project. I have kept the dir hierarchy from IAR so I had to add all the necessary dirs to the System include directories property of CrossStudio.
>
> Now it does not complains about missing headers but still cannot resolve some function names etc. (i.e. I got error message missing prototype.)
>
> So I think it is time to ask for help from someone more experienced or who has already did such a conversion earlier. I would appreciate any kind of help. A link to a document to follow is the best. :-)
>
> Some of my questions are follows:
> 1. Should I define which is the project's main file to start compile and build with. If yes how should I do this.
> 2. How can I tell the linker to use a library (.lib) provided by TI.
> 3. There were some "defines" in several .dat files in IAR I just have added some #define statements to one of my files. Is that correct, or there is a more elegant way to do this.
> 4. What should I do with the MODEL assembly directive which were used in IAR?
> 5. The same question with the error directives?
>
> Sorry for the long post.
> I really appreciate any help regarding this issue.
> Thanks in advance.
>
> Best regards,
> Blaise
>

Just added "./" (the current path) to the include dir. (you will have the
headers in the same path as the c-files).
I think you can not use the .lib file from iar (but have never tried it
myself). Would be much better from TI to provide the code in source (at least
assembler!).

M.

"lvagasi" :

> HI All,
>
> First of all the new 2.0 version of CrossStudio is really cool. Thanks
> for Rowley's team for the great job.
>
> I hope some one has already faced to a similar problem and can help.
> Ti is kind enough to provide sample projects for their's gadgets like
> the MSP430-RF2500 modules but it is available only for IAR tools. I'm
> personally prefer RA's tool so I'd like to use it for experimenting with
> the modules.
>
> What I have already did is: Started a new project copied all the .c and
> .h files under the project dir, added the .c files to the project. I
> have kept the dir hierarchy from IAR so I had to add all the necessary
> dirs to the System include directories property of CrossStudio.
>
> Now it does not complains about missing headers but still cannot resolve
> some function names etc. (i.e. I got error message missing prototype.)
>
> So I think it is time to ask for help from someone more experienced or
> who has already did such a conversion earlier. I would appreciate any
> kind of help. A link to a document to follow is the best. :-)
>
> Some of my questions are follows:
> 1. Should I define which is the project's main file to start compile and
> build with. If yes how should I do this. 2. How can I tell the linker to
> use a library (.lib) provided by TI. 3. There were some "defines" in
> several .dat files in IAR I just have added some #define statements to
> one of my files. Is that correct, or there is a more elegant way to do
> this. 4. What should I do with the MODEL assembly directive which were
> used in IAR? 5. The same question with the error directives?
>
> Sorry for the long post.
> I really appreciate any help regarding this issue.
> Thanks in advance.
>
> Best regards,
> Blaise
>

--- In m..., "old_cow_yellow" wrote:
>
> I thought c is easy to port.

I thought either, but it not seems to be the case.

I think IAR uses some special "features" which are not or differently supported by the gcc used by Rowley.

The other problem comes from the fact that IAR uses some information somehow built into the project related files. It seems not straight forward to implement in a different environment.

Earlier I have tried to do the same with TI's CCE but I stucked as well and gave up becouse of lack of time.

Anyway thanks for your comment.
BR,
Blaise
> --- In m..., "lvagasi" wrote:
> >
> > HI All,
> >
> > First of all the new 2.0 version of CrossStudio is really cool. Thanks for Rowley's team for the great job.
> >
> > I hope some one has already faced to a similar problem and can help.
> > Ti is kind enough to provide sample projects for their's gadgets like the MSP430-RF2500 modules but it is available only for IAR tools.
> > I'm personally prefer RA's tool so I'd like to use it for experimenting with the modules.
> >
> > What I have already did is: Started a new project copied all the .c and .h files under the project dir, added the .c files to the project. I have kept the dir hierarchy from IAR so I had to add all the necessary dirs to the System include directories property of CrossStudio.
> >
> > Now it does not complains about missing headers but still cannot resolve some function names etc. (i.e. I got error message missing prototype.)
> >
> > So I think it is time to ask for help from someone more experienced or who has already did such a conversion earlier. I would appreciate any kind of help. A link to a document to follow is the best. :-)
> >
> > Some of my questions are follows:
> > 1. Should I define which is the project's main file to start compile and build with. If yes how should I do this.
> > 2. How can I tell the linker to use a library (.lib) provided by TI.
> > 3. There were some "defines" in several .dat files in IAR I just have added some #define statements to one of my files. Is that correct, or there is a more elegant way to do this.
> > 4. What should I do with the MODEL assembly directive which were used in IAR?
> > 5. The same question with the error directives?
> >
> > Sorry for the long post.
> > I really appreciate any help regarding this issue.
> > Thanks in advance.
> >
> > Best regards,
> > Blaise
>

Blaise,

Although I'm certainly NOT qualified to do so, it seems if I were making and selling a compiler for TI chips, I would furnish a document that shows how to adapt TI code to work on my compiler. Have you asked Rowley?
Regards,
mike Raines

________________________________
From: m... [mailto:m...] On Behalf Of lvagasi
Sent: Wednesday, March 11, 2009 1:35 PM
To: m...
Subject: [msp430] Re: How to convert projects from TI in IAR format to work with them in CrossStudio
--- In m..., "old_cow_yellow" wrote:
>
> I thought c is easy to port.

I thought either, but it not seems to be the case.

I think IAR uses some special "features" which are not or differently supported by the gcc used by Rowley.

The other problem comes from the fact that IAR uses some information somehow built into the project related files. It seems not straight forward to implement in a different environment.

Earlier I have tried to do the same with TI's CCE but I stucked as well and gave up becouse of lack of time.

Anyway thanks for your comment.
BR,
Blaise

> --- In m..., "lvagasi" wrote:
> >
> > HI All,
> >
> > First of all the new 2.0 version of CrossStudio is really cool. Thanks for Rowley's team for the great job.
> >
> > I hope some one has already faced to a similar problem and can help.
> > Ti is kind enough to provide sample projects for their's gadgets like the MSP430-RF2500 modules but it is available only for IAR tools.
> > I'm personally prefer RA's tool so I'd like to use it for experimenting with the modules.
> >
> > What I have already did is: Started a new project copied all the .c and .h files under the project dir, added the .c files to the project. I have kept the dir hierarchy from IAR so I had to add all the necessary dirs to the System include directories property of CrossStudio.
> >
> > Now it does not complains about missing headers but still cannot resolve some function names etc. (i.e. I got error message missing prototype.)
> >
> > So I think it is time to ask for help from someone more experienced or who has already did such a conversion earlier. I would appreciate any kind of help. A link to a document to follow is the best. :-)
> >
> > Some of my questions are follows:
> > 1. Should I define which is the project's main file to start compile and build with. If yes how should I do this.
> > 2. How can I tell the linker to use a library (.lib) provided by TI.
> > 3. There were some "defines" in several .dat files in IAR I just have added some #define statements to one of my files. Is that correct, or there is a more elegant way to do this.
> > 4. What should I do with the MODEL assembly directive which were used in IAR?
> > 5. The same question with the error directives?
> >
> > Sorry for the long post.
> > I really appreciate any help regarding this issue.
> > Thanks in advance.
> >
> > Best regards,
> > Blaise
>


Hi Mike,

thanks for your reply. You are absolutely right and no I did not contacted Rowley directly yet. AFAIK one of their really helpful and kind representative (Paul) is also a member of this group.

Anyway I do not want to blame anyone regarding my difficulties. I do not think it's Rowley's task to take care of TI's code to be compiled with their tool if TI does nothing in this situation.

TI does even not supports it's own tool CCE at the same level as IAR ones. If it theirs policy and they happy with excluding hobby developers and small companies who do not want (may) pay $1000s for a compiler tool from IAR (the code limited one is useless for RF projects) then please do.

I do not know anyone from TI Germany where MSP430 is developed, but comparing this behaviour with TI France where the OMAP family has grown up and the support given to the community built around the Beagleboard project (based on OMAP3530) I think there is something to learn from the French.

In my opinion having a very useful tool like CCE available for an affordable price (~$500) and providing so pour support for it is just let the money down the drain.

Back to the original topic. Now I have some progress but there are still some problems. If I'll be so lucky to be able to complete this task I'll try to put together at least a short description about the steps I have made.

Thanks.
Best regards,
Blaise

--- In m..., Mike Raines wrote:
>
> Blaise,
>
> Although I'm certainly NOT qualified to do so, it seems if I were making and selling a compiler for TI chips, I would furnish a document that shows how to adapt TI code to work on my compiler. Have you asked Rowley?
> Regards,
> mike Raines
>
> ________________________________
> From: m... [mailto:m...] On Behalf Of lvagasi
> Sent: Wednesday, March 11, 2009 1:35 PM
> To: m...
> Subject: [msp430] Re: How to convert projects from TI in IAR format to work with them in CrossStudio
> --- In m..., "old_cow_yellow" wrote:
> >
> > I thought c is easy to port.
>
> I thought either, but it not seems to be the case.
>
> I think IAR uses some special "features" which are not or differently supported by the gcc used by Rowley.
>
> The other problem comes from the fact that IAR uses some information somehow built into the project related files. It seems not straight forward to implement in a different environment.
>
> Earlier I have tried to do the same with TI's CCE but I stucked as well and gave up becouse of lack of time.
>
> Anyway thanks for your comment.
> BR,
> Blaise
>
> > --- In m..., "lvagasi" wrote:
> > >
> > > HI All,
> > >
> > > First of all the new 2.0 version of CrossStudio is really cool. Thanks for Rowley's team for the great job.
> > >
> > > I hope some one has already faced to a similar problem and can help.
> > > Ti is kind enough to provide sample projects for their's gadgets like the MSP430-RF2500 modules but it is available only for IAR tools.
> > > I'm personally prefer RA's tool so I'd like to use it for experimenting with the modules.
> > >
> > > What I have already did is: Started a new project copied all the .c and .h files under the project dir, added the .c files to the project. I have kept the dir hierarchy from IAR so I had to add all the necessary dirs to the System include directories property of CrossStudio.
> > >
> > > Now it does not complains about missing headers but still cannot resolve some function names etc. (i.e. I got error message missing prototype.)
> > >
> > > So I think it is time to ask for help from someone more experienced or who has already did such a conversion earlier. I would appreciate any kind of help. A link to a document to follow is the best. :-)
> > >
> > > Some of my questions are follows:
> > > 1. Should I define which is the project's main file to start compile and build with. If yes how should I do this.
> > > 2. How can I tell the linker to use a library (.lib) provided by TI.
> > > 3. There were some "defines" in several .dat files in IAR I just have added some #define statements to one of my files. Is that correct, or there is a more elegant way to do this.
> > > 4. What should I do with the MODEL assembly directive which were used in IAR?
> > > 5. The same question with the error directives?
> > >
> > > Sorry for the long post.
> > > I really appreciate any help regarding this issue.
> > > Thanks in advance.
> > >
> > > Best regards,
> > > Blaise
> > >
> >
>

Mike,

> Although I'm certainly NOT qualified to do so, it seems if I
> were making and selling a compiler for TI chips, I would furnish a
document
> that shows how to adapt TI code to work on my compiler. Have you asked
> Rowley?

We've done what TI have done--effectively match a selected set of pragmas so
that TI can maintain a single source code base. It means all those small TI
examples that demonstrate the MSP430 now compile without any change.

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors

Hi,

> thanks for your reply. You are absolutely right and no I did not contacted
> Rowley directly yet. AFAIK one of their really helpful and kind
> representative (Paul) is also a member of this group.

Well, he is. Whether I am a helpful and kind representative is a matter of
viewpoint.

> Anyway I do not want to blame anyone regarding my difficulties. I do not
> think it's Rowley's task to take care of TI's code to be compiled with
> their tool if TI does nothing in this situation.

It's a fact of life that TI won't provide any real visibility to anything
other than EW and CCE.

> TI does even not supports it's own tool CCE at the same level as IAR ones.
> If it theirs policy and they happy with excluding hobby developers and
> small companies who do not want (may) pay $1000s for a compiler tool from
> IAR (the code limited one is useless for RF projects) then please do.

Heck, $150 for CrossWorks is an absolute bargain for hobby developers isn't
it? A full blown tool without size or functionality restrictions. However,
if you have a library you need to link with in object code only, then you're
right out of luck. If you have full source code, then you're in a great
position.

> Back to the original topic. Now I have some progress but there are still
> some problems. If I'll be so lucky to be able to complete this task I'll
> try to put together at least a short description about the steps I have
> made.

Perhaps I should take a look at providing CrossWorks project files that you
can just drop into the sources from TI.

--
Paul Curtis, Rowley Associates Ltd http://www.rowley.co.uk
CrossWorks for ARM, MSP430, AVR, MAXQ, and now Cortex-M3 processors

C code is portable but libraries are not. Its the linker that isn't
portable. The linker converts the C source to object modules and may
contain info that is proprietary to the company that created it.
Ray
I forgot to add that the compiler writers can do anything they want to
create C source commands (called pragmas) that are passed to the linker.
This is where the innovation ( or lack of) takes place.
Ray

Memfault Beyond the Launch