Re: [OpenOCD-devel] Launch OpenOCD from GDB in one console

2020-07-27 Thread Tommy Murphy
Great, glad it helped.

From: kristof.mul...@telenet.be 
Sent: Monday, July 27, 2020 11:37:57 AM
To: Tommy Murphy 
Cc: openocd-devel 
Subject: Re: Launch OpenOCD from GDB in one console

Hi @Tommy Murphy,

Thanks a lot. I've read the sections you suggested, and got it working!
All that needed to be done is modifying the first line in the .gdbinit file:

target extended-remote | openocd -f 
../config/flash_config/openocd_probe.cfg -f 
../config/flash_config/openocd_chip.cfg -s "C:/path/to/scripts" -c "gdb_port 
pipe; log_output openocd.log"
monitor reset halt
monitor flash erase_address 0x800 0x0020
monitor reset halt
file foobar.elf
load
monitor reset run
monitor shutdown
quit

Then I launch GDB in the usual way:

$arm-none-eabi-gdb -x ../config/flash_config/.gdbinit

Huray, it works! Thanks ^_^

Kind regards,
Kristof Mulier


Van: "Tommy Murphy" 
Aan: "openocd-devel" , "kristof mulier" 

Verzonden: Maandag 27 juli 2020 11:53:24
Onderwerp: Re: Launch OpenOCD from GDB in one console

Have you reviewed section 7.3 of the openocd users guide about using the pipe 
option and section 21.1 about using gdb in this context?

From: kristof.mul...@telenet.be 
Sent: Monday, July 27, 2020 10:29:10 AM
To: openocd-devel 
Subject: [OpenOCD-devel] Launch OpenOCD from GDB in one console

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:
monitor reset halt
monitor flash erase_address 0x800 0x0020
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


Re: [OpenOCD-devel] Launch OpenOCD from GDB in one console

2020-07-27 Thread kristof . mulier
Hi @Tommy Murphy, 

Thanks a lot. I've read the sections you suggested, and got it working! 
All that needed to be done is modifying the first line in the .gdbinit file: 

target extended-remote | openocd -f ../config/flash_config/openocd_probe.cfg -f 
../config/flash_config/openocd_chip.cfg -s "C:/path/to/scripts" -c "gdb_port 
pipe; log_output openocd.log" 
monitor reset halt 
monitor flash erase_address 0x800 0x0020 
monitor reset halt 
file foobar.elf 
load 
monitor reset run 
monitor shutdown 
quit 

Then I launch GDB in the usual way: 

$ arm-none-eabi-gdb -x ../config/flash_config/.gdbinit 

Huray, it works! Thanks ^_^ 

Kind regards, 
Kristof Mulier 


Van: "Tommy Murphy"  
Aan: "openocd-devel" , "kristof mulier" 
 
Verzonden: Maandag 27 juli 2020 11:53:24 
Onderwerp: Re: Launch OpenOCD from GDB in one console 

Have you reviewed section 7.3 of the openocd users guide about using the pipe 
option and section 21.1 about using gdb in this context? 

From: kristof.mul...@telenet.be  
Sent: Monday, July 27, 2020 10:29:10 AM 
To: openocd-devel  
Subject: [OpenOCD-devel] Launch OpenOCD from GDB in one console 
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:  
monitor reset halt 
monitor flash erase_address 0x800 0x0020 
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


Re: [OpenOCD-devel] Launch OpenOCD from GDB in one console

2020-07-27 Thread Tommy Murphy
Have you reviewed section 7.3 of the openocd users guide about using the pipe 
option and section 21.1 about using gdb in this context?

From: kristof.mul...@telenet.be 
Sent: Monday, July 27, 2020 10:29:10 AM
To: openocd-devel 
Subject: [OpenOCD-devel] Launch OpenOCD from GDB in one console

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:
monitor reset halt
monitor flash erase_address 0x800 0x0020
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


[OpenOCD-devel] Launch OpenOCD from GDB in one console

2020-07-27 Thread kristof . mulier
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:  
monitor reset halt 
monitor flash erase_address 0x800 0x0020 
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