OpenOCD + GDB + AT91SAM7S64 gdb_memory_map

Hello,

I’m trying to debug program stored in FLASH or in RAM (or both according to code speed needed). GDB should be able to decide which breakpoint type to use (HW or SW) according to breakpoint location (FLASH or RAM). But when I try to use command gdb_memory_map enable the OpenOCD exit with some error

Debug: 151 10 command.c:133 script_debug(): command - gdb_memory_map ocd_gdb_memory_map enable
Debug: 153 10 command.c:133 script_debug(): command - ocd_command ocd_command type ocd_usage gdb_memory_map
Debug: 154 10 command.c:133 script_debug(): command - usage ocd_usage gdb_memory_map
User : 159 10 command.c:909 command_help_show_wrap(): 
User : 160 10 command.c:824 openocd_jim_vfprintf(): Command handler execution failed
User : 163 10 command.c:824 openocd_jim_vfprintf(): 
User : 165 10 command.c:824 openocd_jim_vfprintf(): 
User : 168 10 command.c:824 openocd_jim_vfprintf(): 
User : 170 10 command.c:824 openocd_jim_vfprintf():

I’m using OpenOCD version 0.4.0

Command is placed in configuration script before init

without this gdb_memory_map I’m forced to use only HW breakpoints (gdb_breakpoint_override hard) which I have only two in AT91SAM7S64.

Does someone have any solution for this ?

Thanks for help.

Petr.

Petr,

Just had a quick look and that a bug in openocd - i will push a fix shortly.

For info sending the memory map is the default and so that cmd is not required.

If your memory map is correct then gdb will choose the correct breakpoint type - no other cmds should be required.

Cheers

Spen

Hello Spen,

Thanks for your help, Please post here when/where or which revision I should download so that this bug is not present.

I’m beginner in this issue so its sometimes hard even when things are working according to the User’s Guide.

Breakpoints were not working automatically so I tried to solve it by some settings I found in the User’s Guide and by studying configurations I found on the Internet. Unfortunately most of them were absolutely useless because they were for older OpenOCD versions.

I don’t know if it’s useful information for you, but I’m compiling it for Windows platform using Msys/MinGW, but I suppose that this should have no influence on this problem.

Thanks again and I’m looking forward to testing the new version :slight_smile:

I appreciate the work done by OpenOCD programmers.

Have a nice day.

Petr.

The latest git version now has the fix, even though an error was reported it did not effect the behaviour.

http://openocd.git.sourceforge.net/git/ … e57f093aee

You will have to enable a full debug log to get more info:

openocd -d 3 -l openocd.log ....

Cheers

Spen

Hello Spen,

Thanks for help, I will try to download that newest version using GIT as soon as possible and keep you posted whether it worked for me.

Right now I can’t give it a try because I have no GIT system running under Windows.

Best regards Petr.

Hello again,

Finally after some hours of fighting it seems to be working as supposed :smiley:

New version of OpenOCD accepts the the gdb_… commands as described in manual.

Other problem was to convince the code to run from memory location 0x00100000

and not from reset vector 0x00000000 :slight_smile:

(which worked fine but GDB don’t considered this location as FLASH :roll: ).

Now breakpoints are separated to hardware and software type correctly :twisted: :lol:

again thank you Spen for finding that bug in OpenOCD earlier version - I would lost much more time trying to figure out what I’m doing wrong.

Best regards Petr.