Programming and debuging in flash

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. :slight_smile:

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.

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

Leon

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

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

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

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

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 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

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.