Arm Community
Site
Search
User
Site
Search
User
Support forums
Arm Development Studio forum
Debug build works but release
Jump...
Cancel
Locked
Locked
Replies
5 replies
Subscribers
119 subscribers
Views
4461 views
Users
0 members are here
Options
Share
More actions
Cancel
Related
How was your experience today?
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion
Debug build works but release
Yu Qiao
over 12 years ago
Note: This was originally posted on 19th January 2010 at
http://forums.arm.com
My code works on debug build ( -Otime -g+ )
But release build can't work ( -Otime -O2 -zo )
the code is the same. the compiler is ADS1.2
Do you guys have any idea or previous experience on such an issue?
Thanks.
Parents
Simon Craske
over 12 years ago
Note: This was originally posted on 19th January 2010 at
http://forums.arm.com
Presumably changing the "RAM settings" involves writing specific values to specific addresses;
compiling with "-O2 -g+" will have the effect of causing accesses to behave as though volatile, whilst this behaviour will be optimised out with "-O2 -Otime"; for example:
void foo(void)
{
unsigned char *f = (unsigned char *)0x100;
*f = 2;
*f = 4;
*f = 6;
}
Generates three write accesses with debug, but only writes "6" without debug enabled.
Declaring f as "volatile unsigned char*", will result in all three writes always being generated.
If you are talking to peripherals, are you sure you're using the volatile specifier correctly?
hth
s.
Cancel
Vote up
0
Vote down
Cancel
Reply
Simon Craske
over 12 years ago
Note: This was originally posted on 19th January 2010 at
http://forums.arm.com
Presumably changing the "RAM settings" involves writing specific values to specific addresses;
compiling with "-O2 -g+" will have the effect of causing accesses to behave as though volatile, whilst this behaviour will be optimised out with "-O2 -Otime"; for example:
void foo(void)
{
unsigned char *f = (unsigned char *)0x100;
*f = 2;
*f = 4;
*f = 6;
}
Generates three write accesses with debug, but only writes "6" without debug enabled.
Declaring f as "volatile unsigned char*", will result in all three writes always being generated.
If you are talking to peripherals, are you sure you're using the volatile specifier correctly?
hth
s.
Cancel
Vote up
0
Vote down
Cancel
Children
No data