cancel
Showing results for 
Search instead for 
Did you mean: 

OPTIMIZATION

aymen
Associate II
Posted on March 18, 2013 at 11:51

hi

in my project with RIDE7, when i use ''No optimization'' I can't use debugger but when i use size optimization I have a problem in some functions . can I use No optimization juste when I call this functions?

#flawed-code #insufficient-information #optimization
13 REPLIES 13
frankmeyer9
Associate II
Posted on March 18, 2013 at 12:07

Those ''problems'' are normal, as the compiler reorders your expressions as he sees fit, when you switch on optimization. This is not bound to RIDE7.

But to disable optimization on function level, you need to consult your IDE's/compiler documentation. Some compiler have #pragmas, to switch optimization (or other features) on and off arbitrarily.

Usually, one can define optimizations on file level, i.e. having different settings for individual source files. But that is a matter of YOUR toolchain, and it's handling of project settings.

Maybe some RIDE7/ARM user can give you a more detailed answer.

Posted on March 18, 2013 at 13:03

Why can't you use the debugger? Does it report some kind of error, if so it might be helpful to specify it?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Andrew Neil
Evangelist
Posted on March 18, 2013 at 13:21

''when i use 'No optimization' I can't use debugger''

Why can't you? What, exactly, prevents you?

''when i use size optimization I have a problem''

 

Again, what ''problem'', exactly, do you have?

How do you expect people to help to resolve your problem(s) when you don't even say what the problem actually is?!

''in some functions''

 

Only some? What distinguishes the ones where you do have ''problem(s)'' from those where you don't? What do you deduce from that?

Andrew Neil
Evangelist
Posted on March 18, 2013 at 13:25

''Maybe some RIDE7/ARM user can give you a more detailed answer''

Why not ask Raisonance themselves?!

Of course, they, too, will need you to provide adequate information...

frankmeyer9
Associate II
Posted on March 18, 2013 at 13:57

Why not ask Raisonance themselves?!

 

That's a valid option.

The only downside - long delays, because of heavy forum moderation (censorship ?).

Used it last year, for a STM8 derivate. But not before I checked all available offline and online documentation. ... no need for RTFM answers.

aymen
Associate II
Posted on March 19, 2013 at 13:29

I found that after __Initdata () variables are not initialized correctly.

(I use stm3210c-eval (mcu: stm32f107vct ))

frankmeyer9
Associate II
Posted on March 19, 2013 at 13:51

With optimization, the compiler may have decided to remove the variable alltogether, or initialize it at a later point. Debugging with optimizations on can be really confusing.

When verifying the semantical correctness of your code, it might be better to turn off optimizations.

You can turn on optimization later, and delve into a whole new class of subtle issues...

emalund
Associate III
Posted on March 19, 2013 at 15:33

 when i use ''No optimization'' I can't use debugger

still no answer, WHY???

Erik

aymen
Associate II
Posted on March 19, 2013 at 16:06

because code size limit exceeded.