Sign in to follow this  
Followers 0
Rickta59

fix for msp430-elf-gcc iomacros.h and asm example

5 posts in this topic

I've been trying out the new msp430-elf-gcc compiler. I like that we have a supported platform from TI that is part of the standard gcc distribution. However, it seems to have a few nits.  If you try to compile a simple c++ program with msp430-elf-g++, it fails because of problems with iomacros.h.  I've reported this on the e2e.ti.com forums.  In the meantime I put together a fix that seems to work for me.

 

I threw together a gist so you can see how I addressed it:

 

gist.github.com/RickKimball/1303030#file-include-iomacros-h

 

As a bonus you get some assembler code that uses interrupts with the new msp430-elf-gcc to blink an led. You will have to copy my iomacros.h and in430.h into the directory where you downloaded the headers from TI. I've tested this with .c, .cpp and .S files.

 

[Links to e2e.ti.com discussions]

 

e2e.ti.com/support/development_tools/compiler/f/343/t/356902.aspx

 

-rick

Share this post


Link to post
Share on other sites

Thanks for tackling this. Maybe TI will pay more attention to you than they did to me when I noted the problems and provided fixes last December.

 

(For C++ it's pretty simple: all uses of those macros are within the extern "C" block provided in each header when C++ is enabled, so you don't even have to bother special-casing their definitions for C++.)

Share this post


Link to post
Share on other sites

Do you know who actually maintains the header files now? It didn't seem like the compiler team thinks it is their problem based on the response I got on e2e.ti.com.

 

-rick

Share this post


Link to post
Share on other sites

Do you know who actually maintains the header files now?

In a word: no.

 

More than one word would just get me all wound up. I'm just gonna go take a blood pressure pill and lie down for a while.

Share this post


Link to post
Share on other sites

I went to modify the code at the gist above, however github wouldn't allow me to update. The error message was complaining because I had directories in my gist. It seems directories are no longer allowed on gist.github.com.  I fixed the code for the latest msp430-elf-gcc and created a new repo:

https://gist.github.com/RickKimball/ead0b3b0f28f0dbf426c51f46ced59

BTW: iomacros.h is fixed now so I removed the custom version I had created.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0