NishanthMenon changed the topic of #openocd to: this is the place to discuss all things OpenOCD | Logs: https://libera.irclog.whitequark.org/openocd/
tsal has quit [Ping timeout: 246 seconds]
tsal has joined #openocd
Hawk777 has joined #openocd
renrelkha has quit [Quit: bye]
renrelkha has joined #openocd
nerozero has joined #openocd
indy has quit [Ping timeout: 244 seconds]
diddly has quit [Ping timeout: 252 seconds]
diddly has joined #openocd
Haohmaru has joined #openocd
Hawk777 has quit [Quit: Leaving.]
<PaulFertser> karlp1: I'd say yes, as it's breaking assumptions of the flash driver and do not ensure consistent hardware state.
slobodan has joined #openocd
manawyrm has joined #openocd
<manawyrm> Hey folks :)
<manawyrm> I've been working with OpenOCDs remote-bitbang driver over the last couple of days very successfully, but the hardware I'm using also has support to do JTAG natively, which would increase performance pretty significantly, I'd hope.
<manawyrm> Is there a similar TCP (or otherwise networked) protocol in OpenOCD that I could implement to get a higher layer JTAG interface?
<manawyrm> (at least higher layer than direct bitbanging)
<manawyrm> As my performance bottleneck is between the TCP receiver and the device under test, I almost thought about implementing a custom JTAG "sink" in software, parsing the bitbanging commands back into instruction/data and so on, but that sounds overly complex and fragile
<clever> manawyrm: was just asking this very question a few days ago!
<clever> ah, the search is hiding a lot of context
<clever> skipping to a timestamp is better
<manawyrm> clever: aww :/
<manawyrm> yeah, that's pretty mch what I want and those answers look like what I already gathered from looking at the source code
<manawyrm> That's pretty sad, so I guess I'd either have to invent something myself
<manawyrm> (and upstream that)
<manawyrm> or just live with the current state
<clever> i need to dig into it more, but i think there was something about the jlink driver supporting tcp?
<manawyrm> yeah, but the jlink is a propritary device
<manawyrm> i mean -- the protocol is probably documented somewhat inside of openocd
<manawyrm> so I might be able to do that
<manawyrm> but ... well....
<clever> yeah
<clever> in my case, the goal is to have a pico-w expose jtag over wifi
<clever> so i can debug a remote target
<manawyrm> in my case, there is no real actual hardware JTAG lines, it's virtual inside of a remote machine
<clever> ahhh
<manawyrm> I have a little daemon accepting remote-bitbang connections rn
<manawyrm> and it's then writing into magic registers, etc.
<clever> i suspect that the rpi has those same magic registers internally, and it can mux the jtag to physical pins or the magic regs
<manawyrm> clever: yeah, I'm using a AST2500 (one of those server remote management chips here)
<manawyrm> but it's basically a rpi chip after all
<manawyrm> currently I'm bitbanging the GPIO registers over a UART repl/shell, you can imagine how slow that is
<clever> yeah
<clever> the magic regs in the rpi, seem to include automatic shifting
<clever> manawyrm: my best guess as to how they work, is that you load some data into TDI and TMS, then you tell it to clock out 32 bits
<clever> and then a reply will appear in TDO
<clever> once BUSY clears itself
<manawyrm> clever: yeah, that seems very similar to the peripheral in my chip
<manawyrm> (altough I do have full docs, so that's nice)
<clever> on second look, i dont see an option to shift 35 bits
<clever> and i think arm is heavily based on 35bit transfers?
<clever> but there is a fishy 0 bit shift, and 34, so maybe off by one?
<clever> keep me updated if you make something tcp based, and i can try to implement your stuff in my pico-w project
<clever> i need to get off to bed
crabbedhaloablut has quit []
crabbedhaloablut has joined #openocd
slobodan has quit [Ping timeout: 260 seconds]
crabbedhaloablut has quit []
crabbedhaloablut has joined #openocd
<PaulFertser> manawyrm: the jlink documentation for the lower level protocol was freely available to the public
<PaulFertser> manawyrm: but probably the USBIP way is really making sense for your usecase too?
<manawyrm> PaulFertser: the USBIP way is batshit insane, i'm sorry
<manawyrm> there's no actual hardware involved anywhere
<manawyrm> Emulating a virtual USB device on a virtual HCI to speak JTAG?
<manawyrm> That's just crazy
<PaulFertser> manawyrm: good point. As with any generic solution it's suboptimal for any specific application, agreed.
d_olex has quit [Ping timeout: 252 seconds]
<karlp1> manawyrm: would https://review.openocd.org/c/openocd/+/6867 be helpful at all?
<karlp1> potentially better than remote bitbang, potentially just another square peg in a round hole?
<manawyrm> karlp1: yes, indeed, that already looks better :)
<manawyrm> I'll have to check the implementation of the JTAG peripheral and see if I can map this properly, but removing the multiple writes required for a single state transition should already improve speeds by orders of magnitude
d_olex has joined #openocd
ericonr has quit [Ping timeout: 264 seconds]
ericonr has joined #openocd
urja has quit [Read error: Connection reset by peer]
urja has joined #openocd
Haohmaru has quit [Quit: saionara]
nerozero has quit [Ping timeout: 252 seconds]
rgr has joined #openocd
rgr has quit [Client Quit]
rgr has joined #openocd
rgr has quit [Client Quit]
rgr has joined #openocd
rgr has quit [Quit: ERC 5.6.1-git (IRC client for GNU Emacs 31.0.50)]
rgr has joined #openocd
rgr has quit [Client Quit]
rgr has joined #openocd
rgr has quit [Quit: ERC 5.6.1-git (IRC client for GNU Emacs 31.0.50)]
rgr has joined #openocd
rgr has quit [Quit: ERC 5.6.1-git (IRC client for GNU Emacs 31.0.50)]
PlasmaHH has quit [Ping timeout: 264 seconds]
rgr has joined #openocd
rgr has quit [Remote host closed the connection]
Deneb has joined #openocd
Deneb has quit [Client Quit]
<clever> manawyrm: one thought i came to, the arm jtag protocol involves sending a 35bit command to the cpu, and receiving a 35bit reply back
<clever> and within that reply, is a WAIT flag, meaning the 2nd last command is still busy, the last command you just gave it wasnt accepted, and to discard the reply you saw WAIT in
<clever> so you can just keep repeating that command until its accepted
<clever> so in theory, openocd can fire off a list of commands, saying to write something to the IR register, or to write a series of things to the special 35bit DR register
<clever> and then the remote device can walk that whole list of commands, and retry when needed, building up a list of 35bit replies
<clever> and once its done, fire the entire set of replies back off to openocd
<jn> manawyrm: oh hi :)
<clever> jn: ah, hello!
<jn> hi clever :)