2003-08-05 09:53:50 UTC
Many thanks for all your help. I have now got it working. I feel really stupid really. The problem I had was that I was linking the gdb_stub code into my main executeable. Now I have a mini gdb_stub program which I write to the on-chip flash. I can then connect gdb to my board and load the real program to RAM and run from there. DO I feel stupid or what ! :-)
I do have a question though. Once I connect to the target, I load an ini file to setup some of the registers to allow me access to external RAM, then load the program. Once it has loaded, execution stops at the very first line of code. GREAT. I can step through code, inspect registers and memory, set breakpoints. However, if I hit continue without having set a breakpoint to hit, the program sits there running. If I then hit stop in gdb, it times out saying it has lost connection to the host. What I wanted was to click stop and gdb to the show at what point the execution was so I can then continue debugging. Should I put a call to the gdb_stub that is called on a regular basis so that gdb can still communicate with the stub to allow this. I could place this on a timer, or even in the main execution loop since I have no OS and I am just running a single threaded app.
Any thoughts.
Cheers
James