op 21-05-14 15:59, Justin Smyth schreef:
I can now compile in lazarus , I have openocd working it detects my board.


I need to flash the elf file to my board , I have read open ocd can do , and
I read somewhere GBD can do it too


Whats the best way to do this ?


Also do I need to have openocd running first then compile my program ? (
then flash ??)


Kind Regards

Justin

Justin,

Compiling and debugging are separate processes. So you can e.g. compile somewhere, transfer the elf-file to your debugging station, flash your processor and debug. So no, openocd does not need to run to *compile*.

What I do (but hope to do with lazarus) :
Start openocd, it should detect your board. In another terminal-session, telnet to localhost port 4444. For my processor (but I think it should be for all processors) I do : "reset halt" to stop the processor. Then I erase the processor : "stm32f1x mass_erase 0" (that's specific for the stm32f1x-processors).
Then I can program : "flash write_image <your project.elf>"
After that you can start the processor : "reset"
Debugging should be done like this : start your arm-none-eabi-gdb. I used tui as parameter : TextUserInterface. I have a .gdbinit file in my home-directory containing :
"target extended-remote localhost:3333"
This connects gdb to openocd.
Unfortunately, I don't know text-based gdb enough to give more details.

Depending on your processor/debug-interface you could use Insight, that's a stand-alone GUI gdb. Unfortunately, I personally can't use it anymore because openocd 0.8 changed so gdb 6.8 (Insight's version of gdb) can't be used. And I need openocd 0.8 for my processor.
Openocd 0.7 has no problems with Insight though.

HTH.

Koenraad


--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to