Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Thread

Optimization problem

Optimization problem

2006-01-17 by andersryl

Hi,

I have a weird problem (hmmm, what problems aren't weird?) regarding 
the optimization flag in GCC.

I use GNUARN 4.0.1, Eclipse 3.0.1 and an board from Olimex for my 
project. The Olimex-uC talks to a PC-app via UART 1. Work is 
progreesing but then I got a Data Abort interrupt indicating 
something was wrong.

So my idea was to try to debug the uC-code from Eclipse with OCD 
Remote. If I do it with the code compiled with -03 (as it shouldn't 
be according to James P. Lynch's excellent guide) it starts up 
alright and the app talks with the PC. But when I set a breakpoint 
and try to single-step through the code I get the error "Target 
request failed: Target is not responding (timed out).".

OK, so lets compile the code using -O0 as the Lynch-guide tells me. 
Now the application no longer talks to the PC-app at all. 
Indications tells me that the UART1 clock is wrong.

Anyone that has ideas on why less optimization can cause problems 
for me? I know that the -Ox are "aliases" for a bunch of 
optimization-flag but I haven't looked into them.

And maybe someone can tell me why I get the error message when 
debugging and compiling using -O3.

/Anders

Re: [lpc2000] Optimization problem

2006-01-17 by Tom Walsh

andersryl wrote:

>Hi,
>
>I have a weird problem (hmmm, what problems aren't weird?) regarding 
>the optimization flag in GCC.
>
>I use GNUARN 4.0.1, Eclipse 3.0.1 and an board from Olimex for my 
>project. The Olimex-uC talks to a PC-app via UART 1. Work is 
>progreesing but then I got a Data Abort interrupt indicating 
>something was wrong.
>
>So my idea was to try to debug the uC-code from Eclipse with OCD 
>Remote. If I do it with the code compiled with -03 (as it shouldn't 
>be according to James P. Lynch's excellent guide) it starts up 
>alright and the app talks with the PC. But when I set a breakpoint 
>and try to single-step through the code I get the error "Target 
>request failed: Target is not responding (timed out).".
>
>OK, so lets compile the code using -O0 as the Lynch-guide tells me. 
>Now the application no longer talks to the PC-app at all. 
>Indications tells me that the UART1 clock is wrong.
>
>Anyone that has ideas on why less optimization can cause problems 
>for me? I know that the -Ox are "aliases" for a bunch of 
>optimization-flag but I haven't looked into them.
>
>And maybe someone can tell me why I get the error message when 
>debugging and compiling using -O3.
>
>  
>
IIRC, -O3 is a synonym for -Os, and if you can debug the code produced 
under -Os, more power to you!  If I need to debug a section of the 
program I'm working on, I turn off all optimizations: -O0.

TomW


>/Anders
>
>
>
>
>
> 
>Yahoo! Groups Links
>
>
>
> 
>
>
>  
>


-- 
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------

RE: [lpc2000] Optimization problem

2006-01-18 by Bruce Paterson

> I have a weird problem (hmmm, what problems aren't weird?) 
> regarding the optimization flag in GCC.
> 
...
> 
> So my idea was to try to debug the uC-code from Eclipse with 
> OCD Remote. If I do it with the code compiled with -03 (as it 
> shouldn't be according to James P. Lynch's excellent guide) 
> it starts up alright and the app talks with the PC. But when 
> I set a breakpoint and try to single-step through the code I 
> get the error "Target request failed: Target is not 
> responding (timed out).".

I get this error message now as well in Insight (or it thinks the target
has continued running) I think it correlates with moving to the newer
OCDremote which handles hardware breakpoints. So one step forward
(hardware breakpoint support) and one back (stuffed after 1 breakpoint).
I haven't had time to investigate further; it may be a hardware problem
with the PC I'm using as someone stole the PC I was using for debugging.

Cheers,
Bruce

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.