<JoseT>
Hi, My openocd code is working well with telnet client for flashing, however on the gdb same image is throwing segmentation fault. I dont have issue in flashing smaller files(~30-50kb), but with bigger images ~200-300kb. I do have a flash size of 512kb. So far couldnt find anything obvious from debugging. Double checked the config files for all
<JoseT>
memory definitions and looks good. Does anyone have any siggestions on how to debug this on gdb?
<Haohmaru>
files below 64k are okay? any uint16_ts anywhere?
<Haohmaru>
can't you run it thru the debugger to see where it crashes?
<Haohmaru>
i mean, it turns into debuggeroverflow, but...
<Haohmaru>
you're running your own modified openocd, connecting to it thru gdb to it to flash some target, and... openocd crashes when the file is too big?
<Haohmaru>
doing the same thru telnet instead of thru gdb doesn't crash?
<JoseT>
Its working well when I am using telnet client and use program but fails in gdb when I use load. Same thing happening when I trued running in VS code
<Haohmaru>
mmm
<Haohmaru>
"program" can be used thru gdb too btw, not that that answers any question.. just saying
<Haohmaru>
well, at least i think it can
<Haohmaru>
the more familiar folks here shall say something
* Haohmaru
hides
<JoseT>
I am aware of only load in gdb, but anyway thanks for your suggestions. I will explore more gdb client to interact with OpenOCD.
<JoseT>
If there are other suggestions from anyone please do let me know
<Haohmaru>
"monitor <xyz>" and the shorter "mon <xyz>" in gdb would send the command <xyz> to openocd
<Haohmaru>
thus i'd think "mon program blah.elf" might be legit
Haohmaru has quit [Quit: saionara]
<JoseT>
yes, sure, thanks
<JoseT>
"mon program blah.elf" this also goes through, but still it fails in vs code /load
JoseT has quit [Quit: Client closed]
JoseT has joined #openocd
JoseT has quit [Client Quit]
JoseT has joined #openocd
JoseT has quit [Client Quit]
JoseT has joined #openocd
Hawk777 has joined #openocd
JoseT has quit [Client Quit]
JoseT has joined #openocd
JoseT has quit [Client Quit]
<PaulFertser>
:/ why JoseT left
<PaulFertser>
I'd tell to start in GDB and provide "bt all"
<PaulFertser>
Also, full log from openocd -d3 crashing.
<antto>
i'd guess... "weefee"
mithro has quit [Ping timeout: 260 seconds]
key2 has quit [Ping timeout: 260 seconds]
zapb__ has joined #openocd
dnm has quit [Ping timeout: 260 seconds]
NishanthMenon has quit [Ping timeout: 260 seconds]
Henry_Nguyen_ has quit [Ping timeout: 260 seconds]
Steffanx has quit [Ping timeout: 260 seconds]
Henry_Nguyen_ has joined #openocd
zapb_ has quit [Ping timeout: 260 seconds]
dnm has joined #openocd
mithro has joined #openocd
NishanthMenon has joined #openocd
key2 has joined #openocd
Steffanx has joined #openocd
Deneb has quit [Quit: Leaving]
JoseT has joined #openocd
<antto>
JoseT, you missed some messages earlier
<antto>
check logs
JoseT has quit [Ping timeout: 240 seconds]
JoseT has joined #openocd
JoseT has quit [Client Quit]
JoseT has joined #openocd
JoseT has quit [Client Quit]
JoseT has joined #openocd
<JoseT>
Sorry, I had to step out :)
<JoseT>
I couldnt find anything from -d
<JoseT>
Debug: 1061 44916 arm_adi_v5.c:1120 dap_put_ap(): refcount AP#0x2 put 0
<JoseT>
Debug: 1062 44916 arm_adi_v5.c:1095 dap_get_ap(): refcount AP#0x2 get 1
<JoseT>
Debug: 1063 44918 arm_adi_v5.c:1120 dap_put_ap(): refcount AP#0x2 put 0
<antto>
btw, don't paste such long walls of text directly here, use a pastebin site and paste the link instead
<JoseT>
Sorry for that. will do that
russ has quit [Remote host closed the connection]
<cambrian_invader>
JoseT: do you have an openocd compiled with debug info?
<cambrian_invader>
if you have gotten it from a distro repo, have you installed e.g. openocd-dbg ?
<cambrian_invader>
(the package name may be different depening on your distro)
JakeSays is now known as JakeSayss
<JoseT>
I havent used openocd-dbg, but thats a good direction for me to check
JoseT has quit [Quit: Client closed]
nerozero has quit [Ping timeout: 248 seconds]
JoseT has joined #openocd
<PaulFertser>
JoseT: hi
<PaulFertser>
JoseT: hm, how do you build openocd and how do you start it?
<PaulFertser>
JoseT: I suggest to run openocd itself under gdb and then use another gdb to try load.
<PaulFertser>
JoseT: also paste your current diff to upstream somewhere
<JoseT>
Hi, I have added my flash driver and config updates on an openocd version
<JoseT>
Open On-Chip Debugger 0.12.0+dev-gac8ef2ccb-dirty (2025-01-13-09:02)
<JoseT>
Is it possible to enable dbg on my version?
<PaulFertser>
JoseT: yes, please paste your full diff somewhere. Run OpenOCD itself under GDB, get it to segfault and how the backtrace.
<PaulFertser>
JoseT: it's enabled by default in the default build, just start it under GDB from src/openocd binary
<JoseT>
okay I will try, thanks
<PaulFertser>
cambrian_invader: by default OpenOCD is built with enough debug info, it's just stripped by "make install" but the original binary has it.
<PaulFertser>
JoseT: if you can do it within like 15 minutes I should be able to help.
<cambrian_invader>
PaulFertser: if he's using a distro openocd it will have been stripped
<JoseT>
tanks, I am just going to start on it
<PaulFertser>
cambrian_invader: right, but that's not the case
<cambrian_invader>
hence the "if"
<PaulFertser>
JoseT is in the process of developing a new flash driver, right?
<JoseT>
ys PaulFertser, we have a AP based flashing mechanism to be supported through openocd
JakeSayss is now known as JakeSays
JoseT has quit [Quit: Client closed]
<karlp>
is the ti_ccfg lma correct, and is it presented correctly to gdb?
<karlp>
but yeah, you need to gdb openocd, and make sure it's built with symbols, and have the "other" gdb to try and load your firmware.
key2 has quit [Quit: Connection closed for inactivity]