Basic question, probably related to my server script

I am new to openocd, this is my first day using it, so sorry if the below is a basic question.

I have just installed openocd (Windows 2000) and am connecting through a montec USB jtagKey to an OKI ARM7TDMI. My code is already in flash/sram. I am not trying to program the flash, simply trying to do a hw break and some singlestepping.

I can start the server running one of the scripts that comes with it :

openocd -f jtagkey-arm7-flash.cfg

I start GDB and do a

target remote localhost:3333

So far so good. It prints out the current address (0xd0013d8c) and gives me a prompt. I can do “info registers” and stuff like that just fine.

At this point, I would expect to just be able to issue a ‘c’ command. However, when doing that, I take a breakpoint at an exception vector (not the same every time, but often a prefetch exception.

This code runs fine without any debugging, so the JTAG (“non intrusive”) debug is somehow messing it up.

Any suggestions ?

Hi,

please run the OpenOCD with -d -l , and send me the log file and the .cfg file you used, together with the input/output of GDB (Dominic.Rath gmx.de). Which version of the OpenOCD did you use? You can get a current one precompiled for windows from Michael Fischer’s www.yagarto.de.

Is your board a little- or a big-endian target?

If the code you’re running is in flash, you have to force the OpenOCD to use hardware breakpoints, because GDB requests software breakpoints by default: monitor arm7_9 force_hw_bkpts enable

If your code is running in RAM, you have to enable software breakpoints (they’re disabled by default, to free one of the two hardware breakpoints which is used for software breakpoints): monitor arm7_9 sw_bkpts enable

Regards,

Dominic

Thanks for you help. Enabling software breakpoints came in useful after I figured out the startup issue. Turns out the ARM7TDMI kept the watchdog timer running when I took my initial break, so it triggered another reset immediately after I issued the GDB ‘c’ command. I really think watchdog should stop counting after taking a JTAG break. Anyway, after disabling watchdog, it worked out.

Thanks again,

Anders

Watchdogs can cause a problem when debugging as often thay are left running - as are other perpherals.

Have a look in your device data as a lot of devices allow the clocks to be stretched when the core is stopped.

Cheers

Spen