-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inline assembly broken in IAR 5.5x #4
Comments
I've tested a patch that is backward compatible with IAR 5.4x and will merge it shortly. |
The patch for IAR 5.5x is ready; check out the |
I got an error with both the volatile keyword and the label using the kickstarter version of IAR (5.52). |
@impedimentToProgress Can you be more specific about what you did and what happened? |
For simplicity I added your code to the blinky LED example that comes with IAR and attepmted to compile it. Here are the error messages when I leave in the volatile keyword, msp430x2xx_fet_1.c Done. 1 error(s), 0 warning(s) Here is the error message that I get when I remove the volatile keyword, but leave the rest of the code intact, msp430x2xx_fet_1.c Done. 4 error(s), 0 warning(s) |
This code compiles correctly, asm( Note the addition of the colon. Volatile still causes an error. Also not that if we wanted to have code before the label, we would have to make sure the label is on the left margin: asm( or else IAR doesn't recognize it as a label. |
Thanks for those extra details. You are right that volatile is a no-no and that labels need special formatting (left justification and trailing colon); my original suggestion in the first comment was incorrect. I am about to merge the iar550 branch into master; it already incorporates these corrections. |
For the 5.5x and later versions of their compiler, IAR changed the rules for inline assembly such that you can no longer do things like this:
You get an error message like
The fix will be to tidy up the parts of the WISP firmware that have
asm
statements referencing labels created in otherasm
statements. Where possible, collapse runs ofasm
statements into one. The above would become:The text was updated successfully, but these errors were encountered: