NishanthMenon changed the topic of #openocd to: this is the place to discuss all things OpenOCD | Logs: https://libera.irclog.whitequark.org/openocd/
tlwoerner has quit [Ping timeout: 240 seconds]
tlwoerner has joined #openocd
tsal has quit [Ping timeout: 240 seconds]
tsal has joined #openocd
wingsorc__ has quit [Quit: Leaving]
wingsorc has joined #openocd
urja has quit [Ping timeout: 276 seconds]
urja has joined #openocd
tlwoerner has quit [Quit: Leaving]
Hawk777 has joined #openocd
<rue_mohr> hello?
<Xogium> rue_mohr: not to be rude but, can you please stop asking for people every time the channel is silent ? People have lives, they don't necessarily live in the same timezone as you either
<Xogium> just saying
<rue_mohr> sure
<rue_mohr> hey, do you know a lot about crafting jtag transactions?
<Xogium> I don't :/ I wish I knew though, it'd save my life sometimes
<rue_mohr> hmm
<rue_mohr> it looks like not a lot of people do
<Xogium> well jtag is kind of a low level thing
<rue_mohr> I think whitequark does, but if you want to talk about busy people thats quite the place to start
<Xogium> ^^
<rue_mohr> what I dont know, is how to get openocd to do the state changes I want
<rue_mohr> I tried chatgpt too, but it cant come up with even ONE valid openocd command
<Xogium> yeah chatgpt is good for not specialized use cases
<Xogium> try to get on an edge case and it won't be able to help
<rue_mohr> it drew me an awesome SVG horse
<Xogium> as for me, I've been stuck for 3 days in a row trying to do sntp with mbed-os
<rue_mohr> er no,
<rue_mohr> lets try that again...
<rue_mohr> ^^ tag path I think will work?
<Xogium> I haven't followed what it is you're trying to do exactly, so I can't say
<Xogium> is this a design of your own ?
<rue_mohr> thats the normal state machine for jtag, I'm trying to use it to load data into a set of 74hc595 shift registers
<Xogium> oh
<Xogium> yeah that's way above my head unfortunately
<Xogium> my stuff with jtag was mostly done on arm boards with jtag pins and already present in openocd
<rue_mohr> you know what bothers me most
<Xogium> rue_mohr: do tell
<rue_mohr> is that, it could take me a week to work this out, then someone will say "oh do it like this" and give me a totally better answer from the ground up
<Xogium> yeah :/ I had this happen so many times myself. It's always jsut as bad
<rue_mohr> it seems to me that openocd is just a bunch of empty boxes with labels, that you fill with whatever the label says is for
<rue_mohr> then it tires to apply the contents of the boxes to a process
<rue_mohr> which I suppse is the state machine
<rue_mohr> but
<rue_mohr> mmm
<rue_mohr> I should take a break and write an arduino tester for the CD4006
<Hawk777> I wouldn’t be surprised if you couldn’t do this with OpenOCD. After all, a 74HC595 doesn’t actually speak JTAG. JTAG defines things like the instruction register and the data register and TMS sequences to get access to them; a 74HC595 has nothing like that, you’re really just looking for a basic synchronous serial port.
<Hawk777> Looking at <https://openocd.org/doc-release/html/JTAG-Commands.html>, OpenOCD’s idea of “low level” is irscan, drscan, and TAP state machine path moves.
<Hawk777> If you have an FTDI-based JTAG adapter, have you considered using one of the FTDI libraries to do the job instead?
<rue_mohr> but I dont ahve to write a by-the-book command sequence
<Hawk777> I don’t understand what you mean by that.
<rue_mohr> Hawk777, I do not want to write a custom program for it
<rue_mohr> well, I use a command sequence that only uses drscan, and pulls lots of resets in the middle I'm ok with that
<Hawk777> Well, if you’ve found something that works, then what’s the problem?
<rue_mohr> state machine wise I think I know what I want to do, but I dont know how to express it as openocd commands
<rue_mohr> and I have been getting errors that abort the command seuqence I think
<rue_mohr> bascialyl I cant translate from bus waveforms to openocd commands
<rue_mohr> I still have no answer if drscan # is in bits or bytes
<PaulFertser> In bits
<rue_mohr> and I dont know if the first number is the number of the device in the chain or the bit count
<rue_mohr> thanks
<PaulFertser> @deffn {Command} {drscan} tap [numbits value]+ [@option{-endstate} tap_state]
<PaulFertser> Right from the doc
<rue_mohr> loggin into machine
<rue_mohr> openocd -f interface/ftdi/um232h.cfg -c "transport select jtag; adapter speed 10; jtag newtap foo bs -irlen 1 ; init; irscan foo.bs 1; exit "
<rue_mohr> I have one 595 set up, so its a single 8 bit shift register
<rue_mohr> it says Warn : Haven't made progress in mpsse_flush() for 2002ms.
<Hawk777> If I understand your diagram right, you want to sort of stay in drscan forever, just shifting and shifting and shifting, and maybe once in a while going through exit and pause but not update? Are you aware that those state transitions are accomplished by sending clock pulses with TMS set to relevant values, which assuming you just hooked up clock to your shift register input, means when you do state transitions you’ll also be advancin
<Hawk777> g the data in the shift register?
<rue_mohr> huh ok
<rue_mohr> so your saying I should use reset and not TMS to latch the data into the output register of the 595
<Hawk777> Maybe that would be better.
<rue_mohr> dr is less critical about how many bits I have, right?
<Hawk777> I’m not sure if drscan accepts DRSHIFT as its endstate, and if you can issue another drscan *starting in* DRSHIFT and have it not make any state transitions at all. If OpenOCD is OK with both of those things, I guess you could just use drscan with -endstate DRSHIFT over and over, interleaved with pulsing reset.
<rue_mohr> its ok, if I can get the data into the register and then abort with a reset,, that works for me
<Hawk777> True, I guess after doing a parallel load you don’t care if you do some extra clock cycles before the start of the next data.
<Hawk777> They’ll just get shifted out the end.
<rue_mohr> openocd -f interface/ftdi/um232h.cfg -c "transport select jtag; adapter speed 10; jtag newtap foo bs -irlen 1 ; init; drscan foo.bs 8 -endstate DRSHIFT; exit "
<rue_mohr> Haven't made progress in mpsse_flush() for 2002ms.
<rue_mohr> not sure where I put my data...
<rue_mohr> is 8 my number of bits or my data?
<Hawk777> Per the docs for drscan, the parameters are TAP name (foo.bs), then bit width (8), then data (you left that out), then optionally more instances of the preceding two, then -endstate if you wish.
<Hawk777> That part is right there in the manual <https://openocd.org/doc-release/html/JTAG-Commands.html>
<rue_mohr> ok
<rue_mohr> openocd -f interface/ftdi/um232h.cfg -c "transport select jtag; adapter speed 10; jtag newtap foo bs -irlen 1 ; init; drscan foo.bs 8 0x55 -endstate DRSHIFT; exit "
<rue_mohr> Warn : Haven't made progress in mpsse_flush() for 2002ms. <-- what is that?
<Hawk777> I believe it means the USB side of your FTDI chip is stuck in some way.
<rue_mohr> oh ok!
<Hawk777> MPSSE is the part of an FTDI chip that speaks JTAG (and a few other protocols).
<rue_mohr> ok so, if I put on some leds, that might work
<Hawk777> (FTDI chips can also speak SPI, which would probably be more appropriate for what you want here, but you’d have to write a bit of code or find a different tool to use them, since I don’t think OpenOCD supports it)
<Hawk777> Maybe?
<rue_mohr> I'm looking to standard dirt to do this
<rue_mohr> if openocd can be shoehorned into pulling it off, then I'm wonderfully happy
<rue_mohr> and I think it can
<rue_mohr> of all you people who know things, nobody has said impossible
<Hawk777> OK, not saying don’t do it, just beware that it’s a very screwdriver-shaped hammer :)
<rue_mohr> yup
<rue_mohr> but everyone has that screwdriver
<rue_mohr> its a sears screwdriver
<rue_mohr> Error: libusb_handle_events() failed with LIBUSB_ERROR_INTERRUPTED
<rue_mohr> hmmm
<rue_mohr> I'm gonna do a disconnect/reconnect on that adapter...
<rue_mohr> aha
<rue_mohr> Info : TAP foo.bs does not have valid IDCODE (idcode=0xffffff00)
<rue_mohr> Info : TAP auto0.tap does not have valid IDCODE (idcode=0xffffff80)
<rue_mohr> Info : TAP auto1.tap does not have valid IDCODE (idcode=0xffffffc0)
<rue_mohr> ...
<rue_mohr> what can you tell me about this.
<rue_mohr> openocd -f interface/ftdi/um232h.cfg -c "transport select jtag; adapter speed 1000; jtag newtap foo bs -irlen 8 ; init; drscan foo.bs 8 0x55 -endstate DRSHIFT; exit "
<rue_mohr> I think it got stuck when I set irlen to 0
<rue_mohr> ... quite a while ago
<rue_mohr> or when I set the speed to 0
<rue_mohr> Warn : Bypassing JTAG setup events due to errors
<rue_mohr> Warn : gdb services need one or more targets defined
<rue_mohr> Warn : drscan with unsafe endstate "DRSHIFT"
<rue_mohr> oh, maybe it did move on
<rue_mohr> I dont get why I cant set the id code to ffffff00 and have it not complain
nerozero has joined #openocd
<PaulFertser> rue_mohr: complaining doesn't matter, it doesn't prevent commands after that
<rue_mohr> if nobody is talking, do you mind if I paste a bit of a flood?
<rue_mohr> openocd: src/jtag/drivers/driver.c:177: interface_jtag_add_dr_scan: Assertion `field == out_fields + scan->num_fields' failed.
<PaulFertser> Please do not paste OpenOOCD output.
<PaulFertser> What drscan command gave that assertion?
<rue_mohr> openocd -f interface/ftdi/um232h.cfg -c "transport select jtag; adapter speed 10; jtag newtap foo bs -irlen 1 ; init; drscan foo.bs 8 0x55 -endstate DRSHIFT; exit "
<rue_mohr> :] the silence is deafening
<PaulFertser> I need time to reprodouce
<rue_mohr> dont we all
<rue_mohr> I dont have anything hooked up to the output latch yet (reset or tms) its just an 8 bit shift register between tdi and tdo
<rue_mohr> so tdi, tdo, and clk
<PaulFertser> rue_mohr: and a logic analyser too I hope?
marcusmae has quit [Ping timeout: 240 seconds]
<PaulFertser> rue_mohr: I think the problem is that somehow auto<N>.tap are not getting accounted for properly, and that leads to assertion. I don't have time atm to debug that though. And I think there's no easy way to disable that autodetection. Keep in mind that OpenOCD will add 0 bit for all /other than drscan/ taps as it would be trying to put all them in BYPASS and DR length in bypass is 1.
<rue_mohr> I have one
<rue_mohr> I'm trying to get openocd to accept the commands first
<PaulFertser> That assertion there is apparently a bug, but this code path isn't getting exercised often.
<PaulFertser> Your idea of abusing JTAG adapter is unorthodox enough to be uncommon.
<rue_mohr> :]
<rue_mohr> thats the definition of my name
<rue_mohr> hmm
<rue_mohr> question, can I get openocd to think its succeeded at one tap?
<rue_mohr> I need to return a 1 dont I?
<PaulFertser> rue_mohr: also if your register is shorter than 32 bits I'd use irscan rather than drscan.
<PaulFertser> irscan doesn't give that assertion.
<rue_mohr> ok, but then, to my understanding I need to be longer than 10 bits
<PaulFertser> This doesn't assert: openocd -c "interface dummy" -c "transport select jtag; adapter speed 10; jtag newtap foo bs -irlen 32; init; irscan foo.bs 1 ; exit"
<PaulFertser> 32 bits
<PaulFertser> No, it doesn't need to be longer than 10 bits, there're many real JTAG targets with e.g. irlen 4.
<rue_mohr> ok
<rue_mohr> hey, idea
<rue_mohr> what if I had a chain that had a real jtag device before or after the 595?
<rue_mohr> I'd rather not, but
<rue_mohr> openocd -f interface/ftdi/um232h.cfg -c "transport select jtag; adapter speed 10; jtag newtap foo bs -irlen 8; init; irscan foo.bs 0x55 -endstate IRSHIFT; exit"
<rue_mohr> ?
<rue_mohr> I think I need to see if it did it...
<rue_mohr> how do I get it to send a reset?
<rue_mohr> I'll throw in a 74ls165 for some led testing and worry about the strobe later
<rue_mohr> no 164
<rue_mohr> normal power, tdi is 1&2, tdo is 13, clk is 8, tie 9 high
marcusmae has joined #openocd
Fleck has quit [Ping timeout: 256 seconds]
Fleck has joined #openocd
Hawk777 has quit [Quit: Leaving.]
Fleck has quit [Ping timeout: 250 seconds]
Flecks has joined #openocd
<PaulFertser> rue_mohr: hm, an idea, if you just need to put data into a shift register, you can bitbang them via srst (e.g. MOSI) and trst (CLK) signals with "adapter reset" command :)
<PaulFertser> And with ftdi-based adapters you can define additional signals and then use ftdi_set_signal or whatever it's called to manually control all them.
wearyhacker has joined #openocd
wearyhacker has quit [Quit: Leaving]
diddly has joined #openocd
tlwoerner has joined #openocd
tlwoerner has quit [Ping timeout: 264 seconds]
tlwoerner has joined #openocd
nerozero has quit [Ping timeout: 240 seconds]
shibboleth has joined #openocd
wingsorc__ has joined #openocd
wingsorc has quit [Remote host closed the connection]
shibboleth has quit [Quit: shibboleth]
<rue_mohr> ooo
<rue_mohr> how do I SVF with openocd?
marcusmae has quit [Ping timeout: 246 seconds]
<PaulFertser> rue_mohr: let me put it this way: what's unclear about the svf command as described by the OpenOCD User Manual?
<rue_mohr> yes I'm completely green
<rue_mohr> rememmber, I'm not trying to do standard things
<rue_mohr> I'm the 4 component, 2 wire, LM555 LED flasher Rue. (as seen on the internet)
<rue_mohr> SDR 8 TDI (55) SMASK (FF);
<rue_mohr> ?
<rue_mohr> I dont want the spec, I want an example
<PaulFertser> Why irscan isn't working for your purpose?
<rue_mohr> there seems to be rules about not having pracitcal examples in a spec
<PaulFertser> What exactly isn't happening right with irscan?
<rue_mohr> I was running into errors, I cant find the terminal... ugh
<PaulFertser> You showed no errors for your irscan attempt.
<PaulFertser> (no errors running irscan that is)
<rue_mohr> I thought your last words were "thats a bug that only comes up because of your non-standard usage"
<PaulFertser> A bug with drscan, yes.
<PaulFertser> So I suggested using irscan instead.
<rue_mohr> ah
<rue_mohr> openocd -f interface/ftdi/um232h.cfg -c "transport select jtag; adapter speed 10; jtag newtap foo bs -irlen 8; init; irscan foo.bs 0x55 -endstate IRSHIFT; exit"
<rue_mohr> was my last attempt
<rue_mohr> Info : TAP foo.bs does not have valid IDCODE (idcode=0xffffff00)
<rue_mohr> Info : TAP auto0.tap does not have valid IDCODE (idcode=0xffffff80)
<rue_mohr> Info : TAP auto1.tap does not have valid IDCODE (idcode=0xffffffc0)
<PaulFertser> Yes, I saw no errors there.
<PaulFertser> That's not a problem.
<rue_mohr> Error: foo.bs: IR capture error; saw 0x0 not 0x1 and this?
<PaulFertser> It goes past init and runs irscan.
<PaulFertser> It runs your irscan eventually.
<rue_mohr> mm k, maybe I should watch my bits then
marcusmae has joined #openocd
<rue_shop3> it looks like your wrong, it does not seem to be sending the bits
<rue_shop3> heh, i'm gonna have to reverse engineer openocd
<rue_shop3> thats gonna add a lot of time to this project...
<rue_shop3> oh well
<rue_shop3> then I'll know more than everyone
<rue_shop3> king of another hill nobody cares about, hahahaha
<rue_shop3> so if you ever want the real words to louie louie...
<rue_shop3> haha
<PaulFertser> Do you have a trace from LA?
zjason`` has joined #openocd
zjason` has quit [Ping timeout: 265 seconds]
Flecks has quit [Ping timeout: 246 seconds]
<rue_shop3> will do that next
<rue_shop3> I'll degress into working out waveforms for each openocd command and documenting it all in a big openocd RE project
<rue_shop3> you should have seen what i had to go thru to use the shift register in a 6522 for serial! :]
<rue_shop3> crazy undocumented stuff back to the orin of the chip and its hand typed datasheet