Forums

IAR v1.26 to 4.11 conversion! * yikes *

Started by Darren Logan October 2, 2008
Howdy folks,

I need to convert an msp430 IAR v1.26 project to a IAR v4.11 project and i'm struggling to get it to run. :'-(

Using the migration guide, I've done the obvious of converting the interrupt syntax, but apart from that I'm not
sure what else to change.

I've got it to compile in v4.11, and i've uploaded it to the F149 target... but it doesn't run properly.
When I step the debugger, it gets to about the 5th line in Main() and then runs on it's own for some reason.
I.e. it's not debugging properly either.

Delay loops (simple for/loops with a _NOP in them) seem to take forever.

Could anyone help me on anything obvious I need to change / look for?

I'm using a stack of 250 (heap 80), which I know is pushing the total RAM usage to near it's max, but I don't think this is the problem.

My gut feeling is that there is an obvious major difference between the compiler versions which I do not know about... and I'm
hoping someone will point it out!?

Thanks

Regards,
Darren
This communication contains information which is confidential
and may also be privileged It is for the exclusive use of the
intended recipient(s). If you are not the intended recipient(s),
please note that any distribution, copying or use of this
communication or the information in it is strictly prohibited.
If you have received this communication in error, please
notify the sender immediately and then destroy any copies of it.

Beginning Microcontrollers with the MSP430

The obvious things to check would be the simple delay loops. They may
be optimized out since they don't do any obvious work. This doesn't
surprise me at all.

Is it always the same line that kills the program? If so, what are the
lines preceding the offending line and the lines after the offending
line.

Dan

________________________________

From: m... [mailto:m...] On Behalf
Of Darren Logan
Sent: Thursday, October 02, 2008 10:10 AM
To: m...
Subject: [msp430] IAR v1.26 to 4.11 conversion! * yikes *
Importance: High

Howdy folks,

I need to convert an msp430 IAR v1.26 project to a IAR v4.11 project and
i'm struggling to get it to run. :'-(

Using the migration guide, I've done the obvious of converting the
interrupt syntax, but apart from that I'm not
sure what else to change.

I've got it to compile in v4.11, and i've uploaded it to the F149
target... but it doesn't run properly.
When I step the debugger, it gets to about the 5th line in Main() and
then runs on it's own for some reason.
I.e. it's not debugging properly either.

Delay loops (simple for/loops with a _NOP in them) seem to take forever.

Could anyone help me on anything obvious I need to change / look for?

I'm using a stack of 250 (heap 80), which I know is pushing the total
RAM usage to near it's max, but I don't think this is the problem.

My gut feeling is that there is an obvious major difference between the
compiler versions which I do not know about... and I'm
hoping someone will point it out!?

Thanks

Regards,
Darren
This communication contains information which is confidential
and may also be privileged It is for the exclusive use of the
intended recipient(s). If you are not the intended recipient(s),
please note that any distribution, copying or use of this
communication or the information in it is strictly prohibited.
If you have received this communication in error, please
notify the sender immediately and then destroy any copies of it.




Probably this is not the source of your problem, but maybe it helps
anyway:

When I was migrating from V1.26B to V3.42A (I suppose the issue will
be the same with V4.xx) I stumbled over global variables.
In V1.26B I defined some global variables which I had to access from
outside via serial communication. So these variables had to be on a
fixed adress in RAM.
For example, I defined:
char c_var_1;
char c_var_2;
int n_var_1;
int n_var_2;
...
(of course keeping memory-alignment in mind!)

The result in RAM:
V1.26B
@200h c_var_1
@201h c_var_2
@202h n_var_1
@204h n_var_2 // fine ;-)

V3.42A
@200h n_var_1
@202h n_var_2
@203h c_var_1
@204h c_var_2 // I'm not amused!

V3.42A rearranged the variables on it's own, starting with ints.
So far I don't know why, because the original order was also well aligned!

The only way the get it right is:
1.) Manually set the adress of each variable with #pragma-directive or
@-operator
2.) Use structs