So I am able to build and debug using:
Eclipse Juno
Eclipse GNU ARM tools
Zylin CDT
Yagarto 4.7.1
st-link (texane)
but when I am generically debugging, I run into messages like variable optimized
out and the cursor jumps when unexpectedly because of code minimization options.
So I changed the make file to use -O0, -O1, or not specifying an optimization level at
all.
When I do this, the code throws an exception before it gets to main(). The debugger
suspends in ctr0 @ __late_init(void) but I am not sure how it gets there. in my .gdbinit
I am setting a break point on ResetHandler but it never gets there.
-John Gentilin
Problem compiling ChibiOS with -O0 (no opt)
Moderators: RoccoMarco, lbednarz, tfAteba
Re: Problem compiling ChibiOS with -O0 (no opt)
Forgot to mention this is on a STM32 F4 Discovery board, running the vanilla board demo code
Re: Problem compiling ChibiOS with -O0 (no opt)
Hi John,
Looks like I've also faced such a problem while debugging with the F4 Discovery. But it occurs even with the default settings. The code goes into an exception just after reset. I didn't check the call trace that time, but can confirm it occurred before main method gets called.
I found out that in such cases, resetting the chip after where the code hangs can fix the issue. Once I pressed the reset button, I get the chip to a breakpoint at main. However I'm using Atollic's GDB server, so I'm not sure if it'll work. Would you mind trying?
Best Regards
Abhishek
Looks like I've also faced such a problem while debugging with the F4 Discovery. But it occurs even with the default settings. The code goes into an exception just after reset. I didn't check the call trace that time, but can confirm it occurred before main method gets called.
I found out that in such cases, resetting the chip after where the code hangs can fix the issue. Once I pressed the reset button, I get the chip to a breakpoint at main. However I'm using Atollic's GDB server, so I'm not sure if it'll work. Would you mind trying?
Best Regards
Abhishek
Re: Problem compiling ChibiOS with -O0 (no opt)
Interestingly I would of sworn this problem was the same with the command line version of GBD but after
re-reading the texane page, I saw that I needed to specify the target with extended-remote and not just
remote. This gave me the kill and run commands, now the command line works just fine and it also works
in http://www.affinic.com/?page_id=109 Debugger GUI. Eclipse is still failing with -O0, but works with -O2.
For the Eclipse - GDB bridge, I am using Xylin native Embedded Debug specifying the arm-none-eabi-gdb
debugger. If I use the standard GDB debugger profile, it looks like it wants to work but when it hits a
breakpoint, eclipse hangs saying "launching Project_name... 27%"
Abhishek, It appears that the Atollic GDB Server is only for Windows and I am running on a Mac...
-John Gentilin
re-reading the texane page, I saw that I needed to specify the target with extended-remote and not just
remote. This gave me the kill and run commands, now the command line works just fine and it also works
in http://www.affinic.com/?page_id=109 Debugger GUI. Eclipse is still failing with -O0, but works with -O2.
For the Eclipse - GDB bridge, I am using Xylin native Embedded Debug specifying the arm-none-eabi-gdb
debugger. If I use the standard GDB debugger profile, it looks like it wants to work but when it hits a
breakpoint, eclipse hangs saying "launching Project_name... 27%"
Abhishek, It appears that the Atollic GDB Server is only for Windows and I am running on a Mac...
-John Gentilin
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: Problem compiling ChibiOS with -O0 (no opt)
-O0 works for me using Yagarto 4.6.3, could you give it a try?
Giovanni
Giovanni
Re: Problem compiling ChibiOS with -O0 (no opt)
Wow I did not expect that to work.. SF only has 4.6.2 for the Mac as a download so I gave it a try
and it worked under Eclipse using the Zylin native CDT GDB connector.. The standard default C/C++
application run configuration sill fails..
4.7.1 works, it just doesn't work using the Zylin Native native run configuration in Eclipse. If I
use the command line 4.7.1 GDB or the Affnic GUI wrapper, 4.7.1 works fine. I was thinking it
was somehow the Eclipse adapter even though it uses the command line gdb program from yagarto.
thank you..
-John Gentilin
and it worked under Eclipse using the Zylin native CDT GDB connector.. The standard default C/C++
application run configuration sill fails..
4.7.1 works, it just doesn't work using the Zylin Native native run configuration in Eclipse. If I
use the command line 4.7.1 GDB or the Affnic GUI wrapper, 4.7.1 works fine. I was thinking it
was somehow the Eclipse adapter even though it uses the command line gdb program from yagarto.
thank you..
-John Gentilin
Re: Problem compiling ChibiOS with -O0 (no opt)
I now notice that the standard C/C++ run configuration hangs because st-util terminates
after the load command so it's waiting for a response from st-link from the run command.
My gdbinit is as follows.
file build/ch.elf
br main
target extended-remote 127.0.0.1:4242
load
load works, then st-util terminates on the run command. This is with Yagarto 4.6.2 or 4.7.1
-John Gentilin
after the load command so it's waiting for a response from st-link from the run command.
My gdbinit is as follows.
file build/ch.elf
br main
target extended-remote 127.0.0.1:4242
load
load works, then st-util terminates on the run command. This is with Yagarto 4.6.2 or 4.7.1
-John Gentilin