OpenOCD unable to debug using gdb, bug?

My Debian have just updated my OpenOCD to 0.3.0 from 0.2.0.

I’ve read 0.3.0 was broken and I passed to the last version in the repository:

Open On-Chip Debugger 0.4.0-dev-00563-gb621090 (2009-11-25-09:37)

Well, I have an AT91SAM7S256 in a Olimex-DevBoard, I was able to debug using gdb with the 0.2.0 version, but now i have the next issue (with 0.3.0 and with the last version).

When i assign a breakpoint i recieve the next from OpenOCD:

accepting ‘gdb’ connection from 0

acknowledgment received, but no packet pending

Unable to set thumb software breakpoint at address 00000656 - check that memory is read/writable

Unable to set thumb software breakpoint at address 0000072c - check that memory is read/writable

Some idea of what is going wrong?

pd:

flash info 0

#0 : at91sam7 at 0x00100000, size 0x00040000, buswidth 4, chipwidth 0

0: 0x00000000 (0x4000 16kB) not protected

1: 0x00004000 (0x4000 16kB) not protected

2: 0x00008000 (0x4000 16kB) not protected

3: 0x0000c000 (0x4000 16kB) not protected

4: 0x00010000 (0x4000 16kB) not protected

5: 0x00014000 (0x4000 16kB) not protected

6: 0x00018000 (0x4000 16kB) not protected

7: 0x0001c000 (0x4000 16kB) not protected

8: 0x00020000 (0x4000 16kB) not protected

9: 0x00024000 (0x4000 16kB) not protected

10: 0x00028000 (0x4000 16kB) not protected

11: 0x0002c000 (0x4000 16kB) not protected

12: 0x00030000 (0x4000 16kB) not protected

13: 0x00034000 (0x4000 16kB) not protected

14: 0x00038000 (0x4000 16kB) not protected

15: 0x0003c000 (0x4000 16kB) not protected

at91sam7 driver information: Chip is AT91SAM7S256

Cidr: 0x270d0940 | Arch: 0x0070 | Eproc: ARM7TDMI | Version: 0x000 | Flashsize: 0x00040000

Master clock (estimated): 48054 KHz | External clock: 18432 KHz

Pagesize: 256 bytes | Lockbits(16): 0 0x0000 | Pages in lock region: 0

Securitybit: 0 | Nvmbits(2): 0 0x0

The memory is not protected, actually I can read and write it with the commands flash_erase flash_write_bank

Try using 0.3.1 and not the developement branch.

4/3!!

Well, I tried it at http://developer.berlios.de/project/sho … up_id=4148

but it seems like the links are broken, I can’t download a valid one, only 15Kb files.

I’ve just downloaded all three types - the files are fine. If berlios doesn’t work for you, you can try sourceforge - http://sourceforge.net/projects/openocd/files/

4/3!!

Thank you very much, i’ve just done it.

I successfully compiled the 0.3.1, and the same error when i try to set a breakpoints states.

I started gdb with:

gdb --symbols=main.out

(gdb) target remote localhost:3333

(gdb) b myfunction

(gdb) c

and the error happens.

Also, if I try to set the breakpoint using telnet

bp 0x0000015e 0x2

Unable to set thumb software breakpoint at address 0000015e - check that memory is read/writable

By the way,

I think in a previous version I was adding HW breakpoints with gdb, but currently it seems not.

How can I add HW breakpoints using gdb?

If i want a HW breakpoint (flash address) at “myfunction”. How can I do it?

Thanks in advance.

Well, I solved it, using ‘hb’ command.

But now i can’t access to volatile and static variables… another story… xD

Maybe using *.out file not *.elf causes your problems? I use it via Eclipse with *.elf files which are loaded to target (and debugger) with “load” and everything works fine.

4/3!!

Solved again, it was a context problem xD.

I broke my mind until I found that only the ‘si’ works when you are debugging in Flash.

Freddie, are you loading an .elf in an ARM7? , I’m passing from .elf to .bin after linking.

There’s no difference in the core for me - for GDB sessions I use *.elf files. You can also load *.elf files directly via OpenOCD. *.bin is not so good (with slightly broken linker scripts they tend to be like 2GB in size <: ), in rare cases (like using on-chip bootloaders) I prefer *.hex

4/3!!

@noether

Solved again, it was a context problem xD.

I broke my mind until I found that only the ‘si’ works when you are debugging in Flash.

how did you solve yor problem ? what is ‘si’ ?

i have the same problem. if connect gdb with OpenOCD i get following error message.

(gdb) target remote localhost:3333

(gdb) break start_kernel : kernel

(gdb) continue

Continuing.

Unable to set 32 bit software breakpoint at address c05ee48c - check that memory is read/writable

pls any hints