# Programming and debuging in flash

**URL:** <https://community.sparkfun.com/t/programming-and-debuging-in-flash/3923>\
**Category:** MicroMod\
**Tags:** arm-lpc\
**Created:** [March 18, 2007, 4:25pm UTC](https://community.sparkfun.com/t/programming-and-debuging-in-flash/3923 "2007-03-18T16:25:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![djurodrljaca](https://avatars.discourse-cdn.com/v4/letter/d/9f8e36/32.png) [@djurodrljaca](https://community.sparkfun.com/u/djurodrljaca)\
**Post date:** [March 18, 2007, 4:25pm UTC](https://community.sparkfun.com/t/programming-and-debuging-in-flash/3923/1 "2007-03-18T16:25:03Z")

</div>

I need some help.

I would like to flash my LPC2148 board with Wiggler in Eclipse, but so far I can only debug programs in RAM (from the YAGARTO tutorial).

I think that I need the config files for OpenOCD, commands for Eclipse, linker file (.ld), make file and if there is something else, than I’ll take that too. 🙂

So, I would like to write a program, debug it (preferably in flash), download it to flash and run it without JTAG (it should run when you connect it to power supply).

If someone has a “LED blinky” in Eclipse with everything set up, please send it to me or on the forum.

---

<div class="post-metadata">

**Author:** ![leon\_heller](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/leon_heller/32/7602_2.png) [@leon\_heller](https://community.sparkfun.com/u/leon_heller)\
**Post date:** [March 18, 2007, 6:20pm UTC](https://community.sparkfun.com/t/programming-and-debuging-in-flash/3923/2 "2007-03-18T18:20:48Z")

</div>

Eclipse probably doesn’t debug programs in flash. One debugger that does is the Crossworks one.

Leon

---

<div class="post-metadata">

**Author:** ![djurodrljaca](https://avatars.discourse-cdn.com/v4/letter/d/9f8e36/32.png) [@djurodrljaca](https://community.sparkfun.com/u/djurodrljaca)\
**Post date:** [March 18, 2007, 8:00pm UTC](https://community.sparkfun.com/t/programming-and-debuging-in-flash/3923/3 "2007-03-18T20:00:12Z")

</div>

Can I at least flash the program with Eclipse/OpenOCD and how do I do that.

---

<div class="post-metadata">

**Author:** ![Dominic](https://avatars.discourse-cdn.com/v4/letter/d/13edae/32.png) [@Dominic](https://community.sparkfun.com/u/Dominic)\
**Post date:** [March 19, 2007, 10:01am UTC](https://community.sparkfun.com/t/programming-and-debuging-in-flash/3923/4 "2007-03-19T10:01:28Z")

</div>

Eclipse is capable of debugging programs in flash, and I’ve done it once to verify that it works, but haven’t used it for more than a year.

On the OpenOCD side, you have to make sure to force hardware breakpoints (Eclipse is going to request SW bkpts):

monitor arm7\_9 force\_hw\_bkpts enable

You can do that either in a gdb-init file or in the Eclipse debugger initialization commands.

Regards,

Dominic

---

<div class="post-metadata">

**Author:** ![Polux\_rsv](https://avatars.discourse-cdn.com/v4/letter/p/b5e925/32.png) [@Polux\_rsv](https://community.sparkfun.com/u/Polux_rsv)\
**Post date:** [March 19, 2007, 3:58pm UTC](https://community.sparkfun.com/t/programming-and-debuging-in-flash/3923/5 "2007-03-19T15:58:18Z")

</div>

I can also confirm that Eclipse can debug in flash. I can only use this because my software is bigger than ram capacity. I have uC/os+esfl on LPC2138.

I have one configuration that flash the software only. I can then run it.

And I have a second one wich launch the debugger and stop the software at the main() entry. I can then continue, stop it, inspect variables, stack,…

The only bad point is that you can only have one breakpoint. And you have to remove it if you want to proceed with single line stepping. I have an old version of OpenOCD with possible wrong parameters. Probably I could use the second hardware breakpoint, but as long as it work “as is”, it is good for me.

Angelo

---

<div class="post-metadata">

**Author:** ![djurodrljaca](https://avatars.discourse-cdn.com/v4/letter/d/9f8e36/32.png) [@djurodrljaca](https://community.sparkfun.com/u/djurodrljaca)\
**Post date:** [March 19, 2007, 6:39pm UTC](https://community.sparkfun.com/t/programming-and-debuging-in-flash/3923/6 "2007-03-19T18:39:46Z")

</div>

Can you post your configuration files and Eclipse debugger initialization commands?

---

<div class="post-metadata">

**Author:** ![lynchzilla](https://avatars.discourse-cdn.com/v4/letter/l/2acd7d/32.png) [@lynchzilla](https://community.sparkfun.com/u/lynchzilla)\
**Post date:** [March 19, 2007, 7:33pm UTC](https://community.sparkfun.com/t/programming-and-debuging-in-flash/3923/7 "2007-03-19T19:33:54Z")

</div>

May I suggest that you read my tutorial on the Atmel web site “Using Open Source Tools for AT91SAM Cross Development”. Just go to the Atmel AT91 support web site [www.at91.com](http://www.at91.com) and search through the documents section for it. There’s a zip file to be downloaded that has the pdf version of the tutorial plus some sample Eclipse projects and OpenOCD configuration files.

While the tutorial is targeted for the AT91 ARM chips, the approach uses the YAGARTO system is is fairly easy to download and install.

When debugging applications in flash, you may only set two hardware breakpoints. More than that will cause the debugger to fail.

I’m working on a new revision of the tutorial that has an improved IRQ handler and addresses the two debug initialization/run windows used to run the start-up OpenOCD commands. In any case, the current tutorial is loaded with good information on how to debug applications in flash and RAM.

Cheers,

Jim Lynch

---

<div class="post-metadata">

**Author:** ![djurodrljaca](https://avatars.discourse-cdn.com/v4/letter/d/9f8e36/32.png) [@djurodrljaca](https://community.sparkfun.com/u/djurodrljaca)\
**Post date:** [March 19, 2007, 8:17pm UTC](https://community.sparkfun.com/t/programming-and-debuging-in-flash/3923/8 "2007-03-19T20:17:15Z")

</div>

Thanx for the tip. I’ll try to make it work later this week (I’m a bit busy at the moment). When I succeed making a project in Eclipse that works with flash, I’ll post it here.
