(embedded) unable to open openocd.gdb

!newbie here!
Trying to automate the gdb session on an stm32 board

.cargo/config

[build]
# Pick ONE of these compilation targets
# target = "thumbv6m-none-eabi"    # Cortex-M0 and Cortex-M0+
target = "thumbv7m-none-eabi"    # Cortex-M3
# target = "thumbv7em-none-eabi"   # Cortex-M4 and Cortex-M7 (no FPU)
# target = "thumbv7em-none-eabihf" # Cortex-M4F and Cortex-M7F (with FPU)

[target.thumbv7m-none-eabi]
# tried all ways (the file is one dir down on the project root)  <-------------
#runner = "arm-none-eabi-gdb -q"
runner = "arm-none-eabi-gdb -q -x ../openocd.gdb"
#runner = "arm-none-eabi-gdb -q -x openocd.gdb"

rustflags = [ 
# use the Tlink.x scrip from the cortex-m-rt crate
"-C", "link-arg=-Tlink.x" 
]

and openocd.gdb

target remote :3333
set print asm-demangle on
monitor arm semihosting enable

# detect unhandled exceptions, hard faults and panics
break DefaultHandler
break HardFault
break rust_begin_unwind

load

then I got -------

 % cargo run
 Finished dev [unoptimized + debuginfo] target(s) in 0.13s
 Running `arm-none-eabi-gdb -q -x openocd.gdb <dir>/target/thumbv7m-none-eabi/debug/stm32-sample`
 Reading symbols from <dir>/target/thumbv7m-none-eabi/debug/stm32-sample...done.
 openocd.gdb: No such file or directory.
 gdb$

always unable to read the gdb configuration file!
openocd is running!
runner always open gdb

any help please

if i rename the gdb file to ".gdbinit" works fine... an weird path problem!
anyway there is some magic here! I saw pages with situations where it doesn't need the "../" in front of the gdb config file!
How does rust infer the memory.x|openocd.gdb|... path? How could I change the current file location?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.