Dear developers, 

As you might know, I'm working in a startup building a new (free!) 
IDE for microcontrollers: Embeetle IDE. To flash code we generally 
use a combination of OpenOCD and GDB. Both are launched as targets 
from the makefile in two separate consoles. I was wondering if it's 
possible to flash from just one makefile target (in one console). 

Let me first explain the way we do it now. The makefile target 
openocd looks like this: 
.PHONY : openocd 
openocd : $(OUTPUT_FILENAME) .elf 
$(OCD) $(OCDFLAGS) 

with the following flags: 
OCDFLAGS_DASHBOARD = -f ../config/flash_config/openocd_probe.cfg \ 
-f ../config/flash_config/openocd_chip.cfg \ 
-s " $(dir OCD ) ../scripts " \ 
-c " init; reset halt " \ 


Target gdb looks like this: 
.PHONY : gdb 
gdb : $(OUTPUT_FILENAME) .elf 
$(GDB) $(GDBFLAGS) 

With the following flags: 
GDBFLAGS_DASHBOARD = -x ../config/flash_config/.gdbinit \ 

So if the user clicks the flash button, we first launch target openocd 
and then target gdb shortly after. GDB then runs its commands from 
.gdbinit , which actually instructs GDB to connect to OpenOCD and 
initiate the flash: 

# .gdbinit file 
target remote localhost: 3333 
monitor reset halt 
monitor flash erase_address 0x8000000 0x00200000 
monitor reset halt 
file foobar.elf 
load 
monitor reset run 
monitor shutdown 
quit 


Now is there a way to do all this from just one makefile target, and 
therefore also from one console? I heard about the possibility to 
launch OpenOCD from a GDB session, like: 

(gdb) target remote | openocd ... 

I tried it, but the console gets locked and no longer accepts gdb 
commands to be executed. 








_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to