Debugging from flash

Is there any way of debug my program running from flash with gdb?? I think it’s impossible because openocd programs the flash with binaries files only, and I’m not sure if gdb can write to flash. Anyway, if there is a way it would be great, since I have only a few kB’s of ram, which will not be enough for my code.

Thanks

lmariano:
Is there any way of debug my program running from flash with gdb?? I think it’s impossible because openocd programs the flash with binaries files only, and I’m not sure if gdb can write to flash. Anyway, if there is a way it would be great, since I have only a few kB’s of ram, which will not be enough for my code.

Thanks

  1. Yes you can.

  2. No, it is not impossible.

Your question concerning programming FLASH with binary data is rather curious since binary data is all that is loaded into ARM memory whether you are debugging in RAM or FLASH? The symbol tables and other debugging data are all kept in the debugging PC’s memory in either case.

Since this is the second time you have asked this same question, then perhaps you should have a look at Jim Lynch’s fine tutorial. It contains a section on programming the FLASH with OpenOCD, and another section on debugging in FLASH. You will be limited to two breakpoints on any ARM7 when debugging in FLASH, since that the number of hardware breakpoint registers available in the EmbeddedICE.

Here is one place to look for Jim Lynch’s tutorial.

http://www.olimex.com/dev/armtutorial.html

–Dave

the yahoo briefcase login is incorrect, is this tutorial available somewhere else?

I have here a 153 pages tutorial called “ARM Cross Develpment with Eclipse” by James P. Lynch, but I think the tutorial you are talking about is another one.

lmariano:
the yahoo briefcase login is incorrect, is this tutorial available somewhere else?

I have here a 153 pages tutorial called “ARM Cross Develpment with Eclipse” by James P. Lynch, but I think the tutorial you are talking about is another one.

Here is a quote from Jim Lynch in another thread:

There’s a zip file in the “Documents” section of www.at91.com; here is the link:

http://www.atmel.com/dyn/resources/prod … source.zip

The specific project for a p64 board is: demo_at91sam7_p64_blink_flash.

Cheers,

Jim Lynch

P.S. make sure you do a “Clean” followed by a “BUild All”

This for a different ARM7 based chip, but since your questions are more related to generic ARM7 and tools issues, it should answer all your questions. I took a quick look at it, and it does cover programming and debugging from FLASH. The actual FLASH setup on Atmel is different from LPC, but as long as OpenOCD has the support for both then it is still possible. I have programmed and debugged in FLASH using OpenOCD and the NoICE debugger and building with the YAGARTO toolchain, so it should also be possible with the GNU debuggers too. Maybe Jim Lynch will see your question here and offer you more specific help.

–Dave

Thanks a lot Dave, the debugger is working perfectly now :smiley:

lmariano:
Thanks a lot Dave, the debugger is working perfectly now :smiley:

You are welcome!!!

I am sorry that I was able to give you more specific help, but I was trying to make sure that you knew it was possible to debug in FLASH. Jim’s tutorials are great for getting started with the open source tools for ARM.

–Dave