NishanthMenon changed the topic of #openocd to: this is the place to discuss all things OpenOCD | Logs: https://libera.irclog.whitequark.org/openocd/
wingsorc has quit [Ping timeout: 240 seconds]
Hawk777 has joined #openocd
Hawk777 has quit [Quit: Leaving.]
zjason` is now known as zjason
Hawk777 has joined #openocd
nerozero has joined #openocd
xantoz has quit [Read error: Connection reset by peer]
Hawk777 has quit [Quit: Leaving.]
gnom has joined #openocd
Haohmaru has joined #openocd
Deneb has joined #openocd
PsySc0rpi0n has joined #openocd
Deneb has quit [Quit: Leaving]
embcla has joined #openocd
<embcla> hello everyone, hopefully this is the right place to ask. have got a local configuration that's able to manage (flash, reset, unlock) an STM32G0. I run it like "openocd -f unlock.cfg". Now how do I get it to to the same stuff remotely via gdb/vscode?
gnom has quit [Remote host closed the connection]
<karlp> _one_ method, is to make your script in your unlock a function instead,
<karlp> so you would have to use -f hoho.cfg -c "myfunction" at the command line,
<karlp> but then you could use "monitor myfunction"
<karlp> alternatively, you can make a gdb function def that just calls the monitor commands to execute each line of your script one by one.
<karlp> you _generally_ don't want to do things like flashing and reseting behind gdb's back, it can get confused about expected state
<embcla> thanks karlp, is the netiquette to write single lines? I don't remember IRC rules anymore, such a long time
<embcla> until recently I was using STMCubeProgrammer, STLink and ST IDE.
<embcla> Then I needed to move from my laptopt to the tools I have in the office and those run on arm, and the ST tools don't, so I can't use ST own tools.
<embcla> That's where openocd comes into the picture, and so I started hunting and found different scripts that I stitched together
<embcla> and that's where I am now: I can do the basics by directly calling openocd, and now I want to debug and step through code
<embcla> if my approach is not compatible with gdb, then how do I go at making it compatible?
<embcla> keep in mind I also have an architecture issue: my laptop runs amd64, the intermediate machine that's connected to the DUT is armv7, the target is cortex m0
<embcla> so on armv7 I have the cortex configuration and run openocd with an open socket for gdb to connect to
<embcla> then from my machine on amd64, I run vscode with cortex-debug, and connect to the remote session
<embcla> and that's where I'm having a ton of issues, cause gdb is not fully synchronized with all the things I need to do to the target, and I don't know how to sync it
<embcla> example: to start debugging, I need to unlock first, then flash, the image is a binary not an executable, so I need to say the offset. my scripts do these, but how should I do this within gdb and why?
<PaulFertser> embcla: I think with "monitor" command you can just "source /path/to/your/script"
<PaulFertser> embcla: basically if you run -f unlock.cfg then you should be able to "monitor source unlock.cfg"
<PaulFertser> embcla: but why do you need anything special at all? You can run any OpenOCD command with "mon <openocd tcl code>"
<karlp> oh yeah, source exists :)
<karlp> why doyou need to unlock first? if you're doing development, can you just leave it unlocked?
<PaulFertser> Good question :)
<karlp> anwway, otherwise, just use "load" in gdb, it will do reflash for you nicely, and keep things in sync
<PaulFertser> Yeah
<karlp> just "load; run" ad nauseum, it will pick up changed .elf files and reflash for you
<PaulFertser> load in GDB works for ELF files, and you do not need any manual offset specifications.
<embcla> well it's a prod firmware, so it has all sorts of normal company security measures. disabling all is not easy, because until now it was not worth the hassle of making arrangements to do so
<embcla> so what I need to flash is a bin that goes through a process where its stripped and then its own crc is appended to it, so no elf format
<embcla> and the software locks itself up during boot, which I can't easily disable, so I need to unlock before flashing
<embcla> so on vscode side I have everything (both the elf and the bin), but on target side I need the bin and I need to unlock
<embcla> and what's the best way of doing all of this with gdb and openocd in between is where I'm stuck
Haohmaru has quit [Ping timeout: 264 seconds]
PsySc0rpi0n has quit [Ping timeout: 248 seconds]
<PaulFertser> embcla: it's not normal to prevent end-user from reading out firmware...
peeps[work] has joined #openocd
gnom has joined #openocd
nerozero has quit [Ping timeout: 246 seconds]
shibboleth has joined #openocd
shibboleth has quit [Quit: shibboleth]
peeps[work] has quit [Remote host closed the connection]
peepsalot has joined #openocd
wingsorc has joined #openocd
peepsalot has quit [*.net *.split]
dliviu has quit [*.net *.split]
HelloShitty has quit [*.net *.split]
haxar has quit [*.net *.split]
dormito has quit [*.net *.split]
diddly has quit [*.net *.split]
PaulFertser has quit [*.net *.split]
sugarbeet has quit [*.net *.split]
kilobyte_ch has quit [*.net *.split]
diddly has joined #openocd
kilobyte_ch has joined #openocd
embcla has quit [Ping timeout: 240 seconds]
haxar has joined #openocd
HelloShitty has joined #openocd
PaulFertser has joined #openocd
dormito has joined #openocd
sugarbeet has joined #openocd
peepsalot has joined #openocd
dliviu has joined #openocd
gnom has quit [Read error: Connection reset by peer]
peepsalot has quit [Ping timeout: 240 seconds]
wingsorc has quit [Ping timeout: 240 seconds]