Jump to content
43oh

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


Recommended Posts

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

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++.)

Link to post
Share on other sites
  • 3 years later...

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.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...