2013-03-18 03:51 AM
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 #optimization2013-03-18 04:07 AM
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.2013-03-18 05:03 AM
Why can't you use the debugger? Does it report some kind of error, if so it might be helpful to specify it?
2013-03-18 05:21 AM
''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?
2013-03-18 05:25 AM
''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...2013-03-18 05:57 AM
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.
2013-03-19 05:29 AM
2013-03-19 05:51 AM
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...2013-03-19 07:33 AM
when i use ''No optimization'' I can't use debugger
still no answer, WHY???Erik
2013-03-19 08:06 AM
because code size limit exceeded.