#garfield Logs
Mar 26 2023
#garfield Calendar
02:20 PM aandrew: rue_mohr: what are you trying to do?
02:30 PM aandrew: if you just want to drive the JTAG lines send an SVF file, it's super simple and has no "protocol" so you can use it to shift arbitrary data using any adapter openocd can drive
02:54 PM rue_mohr: how do I run a svf with openocd?
03:01 PM aandrew: playsvf or something like that
03:01 PM aandrew: it's real easy
03:01 PM aandrew: SVF *is* JTAG
03:01 PM aandrew: it just specifies the bitstream as a raw script
03:20 PM rue_shop4: but you dont need to adhere to the state transitions properly do you?
03:35 PM aandrew: there really are no state transitions
03:36 PM aandrew: JTAG is just a clock and data in/out. TMS/TRST are outputs that if you don't need them then you ignore them
03:36 PM rue_shop3: its not working
03:36 PM rue_shop3: aandrew, you know I'm trying to connect a 74ls595 to a jtag programmer eh?
03:37 PM aandrew: I know what you're doing, and if all you want to do is shift out, that should work just fine
03:37 PM aandrew: what does the start of your svf look like?
03:37 PM rue_shop3: right now i have a 74ls164 so I dont have to worry about a latch signal
03:37 PM rue_shop3: I been herded into trying to use command line on another thread
03:38 PM aandrew: heh
03:38 PM rue_shop3: openocd -f interface/ftdi/um232h.cfg -c "transport select jtag; adapter speed 1; jtag newtap foo bs -irlen 8 ; init; irscan foo.bs 8 0x55 -endstate IRSHIFT; exit "
03:38 PM rue_shop3: openocd told me to use
03:38 PM aandrew: you might have to ignore the tap or specify one where you say to ignore the ID
03:38 PM rue_shop3: er, openai told me to use
03:38 PM rue_shop3: SIR 8 TDI (55) SMASK (FF);
03:39 PM rue_shop3: ok, how do I tell it to ignore the id?
03:40 PM rue_shop3: google just keeps giving me the same useless documents
03:40 PM aandrew: actually just specify the ID as 0xffffffff
03:40 PM aandrew: that's what you'll shift in anyway
03:40 PM rue_shop3: tried that, didn't work
03:40 PM rue_shop3: I'll try again
03:41 PM aandrew: svf foo.svf -ignore_error maybe
03:42 PM rue_shop3: expect id goes in newtap
03:42 PM aandrew: also you might have to play with teh ir/dr length or specify a shift command
03:42 PM rue_shop3: Info : TAP foo.bs does not have valid IDCODE (idcode=0xffffff00)
03:42 PM rue_shop3: Info : TAP auto0.tap does not have valid IDCODE (idcode=0xffffff80)
03:42 PM rue_shop3: Info : TAP auto1.tap does not have valid IDCODE (idcode=0xffffffc0)
03:42 PM rue_shop3: Info : TAP auto2.tap does not have valid IDCODE (idcode=0xffffffe0)
03:42 PM rue_shop3: Info : TAP auto3.tap does not have valid IDCODE (idcode=0xfffffff0)
03:42 PM rue_shop3: Info : TAP auto4.tap does not have valid IDCODE (idcode=0xfffffff8)
03:42 PM rue_shop3: Info : TAP auto5.tap does not have valid IDCODE (idcode=0xfffffffc)
03:42 PM rue_shop3: Info : TAP auto6.tap does not have valid IDCODE (idcode=0xfffffffe)
03:42 PM rue_shop3: Error: foo.bs: IR capture error; saw 0x0 not 0x1
03:42 PM rue_shop3: openocd -f interface/ftdi/um232h.cfg -c "transport select jtag; adapter speed 1; jtag newtap foo bs -irlen 8 -expected-id 0xff; init; irscan foo.bs 8 0x55 -endstate IRSHIFT; exit "
03:43 PM rue_shop3: same with
03:43 PM rue_shop3: openocd -f interface/ftdi/um232h.cfg -c "transport select jtag; adapter speed 1; jtag newtap foo bs -irlen 8 -expected-id 0xffffff00; init; irscan foo.bs 8 0x55 -endstate IRSHIFT; exit "
03:44 PM rue_shop3: any ideas?
03:45 PM rue_shop3: I wrote the svf but do not know how to use it
03:45 PM rue_shop3: and the stuff from the manuals isn't working
03:49 PM rue_shop3: :/ you dissapeared, everyone is doing this just when it gets good
04:00 PM aandrew: I'm here
04:00 PM aandrew: just doing dinner
04:00 PM aandrew: ok so how do we ignore the idcode for the tap
04:01 PM aandrew: try 0
04:01 PM aandrew: "Specify number as zero to suppress warnings about IDCODE values that were found but not included in the list."
04:01 PM aandrew: that might not work
04:02 PM aandrew: you could also try -irmask 0 or 0xffffffff
04:03 PM aandrew: "By default, -ircapture and -irmask are set up to verify that two-bit value. You may provide additional bits if you know them, or indicate that a TAP doesn’t conform to the JTAG specification."
04:04 PM aandrew: I've always used svf with an actual device so the tap id was right, but we're trying to ignore that
04:06 PM aandrew: my openocd guy says that's just a warning anyway and to ignore it
05:37 PM rue_shop4: -irmask 0
05:37 PM rue_shop3: does the same thing
05:38 PM rue_shop3: openocd -f interface/ftdi/um232h.cfg -c "transport select jtag; adapter speed 1; jtag newtap foo bs -irlen 8 -irmask 0x00; init; irscan foo.bs 8 0x55 -endstate IRSHIFT; exit "
06:08 PM aandrew: what specifically does it do?
06:08 PM aandrew: ie what's the output of that command
07:13 PM rue_mohr: it leaves zeros in the register
07:14 PM rue_mohr: I need to hook up the logic capture and see what happens in the middle
07:14 PM rue_mohr: but I'm going to sit down and completely reverse engineer openocd in respect to commands vs waveforms
08:56 PM * rue_shop4 makes sprayers
09:03 PM aandrew: I don't think you need to go that far
09:04 PM aandrew: basically there will be a lot of extra clocks at the beginning (at least 5) with TMS=1 to reset the TAG chain
09:04 PM aandrew: then it'll clock out another 5 or so with a specific set of states on TMS to put it into shift-dr mode
09:05 PM aandrew: once that's done, you can shift out your data as you'd expect
09:05 PM aandrew: for your specific case I think that's all you really need to do
09:06 PM aandrew: might have to do something funny to get the SVF to leave things as-is at that point, I bet openocd will want to clock some more ot exit shift-dr
09:07 PM aandrew: you could be kind of slick and have another shiftreg watching TMS and compare it to the shift-dr and exit-dr to drive the data shift register latch/reset bits
09:31 PM Tom_L: rue_shop4, A9 fit ok?
09:36 PM Tom_L: https://www.sciencenews.org/article/mathematicians-discovered-einstein-tile
09:36 PM Tom_L: https://i.imgur.com/PRa1njL.png
09:40 PM rue_shop4: yea! that came up on twitter!
09:40 PM rue_shop4: I'v not installed the heads yet
09:41 PM rue_shop4: it took me an hour to fit the lathes and springs and links in 6 heads
09:41 PM rue_shop4: I'll do more later
09:45 PM rue_shop3: openocd -f interface/ftdi/um232h.cfg -c "transport select jtag; adapter speed 1; jtag newtap foo bs -irlen 8 -irmask 0x00; init; irscan foo.bs 8 0x55 -endstate IRSHIFT; exit "
09:46 PM Tom_L: what is that for?
09:46 PM rue_shop4: I'm trying to get a jtag adapter to load data into a 74ls595
09:46 PM rue_shop4: nobody knows how to do it, I have to reverse engeneer openocd
09:47 PM Tom_L: what will that get you if you do?
09:47 PM rue_shop4: it means that I'll a setup that can do anything
09:48 PM rue_shop4: with a common tool everyone had
09:48 PM Tom_L: hmm
09:48 PM rue_shop4: its frustrating me now
09:48 PM rue_shop4: it was just supposed to be a simple silly hack
09:49 PM Tom_L: now it's one that _has_ to be done
09:49 PM rue_shop4: but because nobody can answer questions on how openocd works, nobody can figure it out
09:49 PM rue_shop4: the openocd documentation has _0_ practical examples
09:51 PM aandrew: why are you running irscan?
09:51 PM rue_shop4: because its not subject to the bug on openocd
09:51 PM Tom_L: https://www.riverloopsecurity.com/blog/2021/07/hw-101-jtag-part3/
09:52 PM Tom_L: i suppose you've seen them all
09:52 PM rue_shop4: what I'm doing isn't really jtag, so I need someone with DEEP knowlegde who knows how to manipulate the state machine into doing something its not supposed to
09:53 PM rue_shop4: and everyone who is close stops talking right as we get close
09:53 PM Tom_L: https://www.olimex.com/Products/ARM/JTAG/_resources/Manual_PROGRAMMER.pdf
09:53 PM aandrew: "rue_shop4> because its not subject to the bug on openocd"
09:53 PM aandrew: in english?
09:54 PM rue_shop4: there is a bug in openocd that comes up in this non-standard thing I'm trying to do
09:54 PM rue_shop4: I cant remember all the details, I'm just trying to find a way thru the jungle :]
09:54 PM aandrew: it would seem to me like you want "drscan 16 0xaa55 -endstate DRSHIFT" and see what it does
09:54 PM rue_shop4: sure
09:54 PM rue_shop4: openocd -f interface/ftdi/um232h.cfg -c "transport select jtag; adapter speed 1; jtag newtap foo bs -irlen 8 -irmask 0x00; init; irscan foo.bs 8 0x55 -endstate IRSHIFT; exit "
09:55 PM aandrew: we don't care about ir here but could do it that way too
09:55 PM rue_shop4: openocd -f interface/ftdi/um232h.cfg -c "transport select jtag; adapter speed 1; jtag newtap foo bs -irlen 8 -irmask 0x00; init; drscan 16 0xaa55 -endstate DRSHIFT exit "
09:55 PM aandrew: sorry you probably need foo.bs there too, I forgot it
09:56 PM rue_shop4: openocd -f interface/ftdi/um232h.cfg -c "transport select jtag; adapter speed 1; jtag newtap foo bs -irlen 8 -irmask 0x00; init; drscan foo 16 0xaa55 -endstate DRSHIFT exit "
09:56 PM aandrew: what does clock and tdi look like when you run that (the last 16 or so clocks, not hte first ones)
09:56 PM rue_shop4: I cant run it on the same machine as my logic analizer is attached to, apparently
09:57 PM aandrew: oh endstate might have to be drpause not drshift
09:57 PM rue_shop4: embedded:startup.tcl:60: Error: Can't find interface/ftdi/um232h.cfg
09:57 PM rue_shop4: in procedure 'script'
09:57 PM rue_shop4: at file "embedded:startup.tcl", line 60
09:57 PM aandrew: rue_shop4: that usually means the specific adapter you have is named differently, it's a pain
09:57 PM rue_shop4: openocd -f /usr/share/openocd/scripts/interface/ftdi/um232h.cfg -c "transport select jtag; adapter speed 1; jtag newtap foo bs -irlen 8 -irmask 0x00; init; irscan foo.bs 8 0x55 -endstate IRSHIFT; exit "
09:59 PM rue_shop4: trying to find out what happened to that freaking config file
09:59 PM aandrew: no drshift/drpause/irshift/irpause are stable so they're all valid endstates
09:59 PM rue_shop4: that same command line works on other machines
09:59 PM aandrew: yes, because the interfaces are installed there
09:59 PM rue_shop4: wtf
09:59 PM aandrew: like I said that's a mess
09:59 PM rue_shop4: no, the file oesn't exist on this freaking system
10:00 PM rue_shop4: even tho its in the package
10:00 PM rue_shop4: that I just reinstalled
10:00 PM rue_shop4: GRRRRR
10:00 PM aandrew: look at the directory /usr/share/openocd/scripts/interface/ftdi, what's in there
10:00 PM rue_shop4: its not here
10:00 PM rue_shop4: its not on the system anywher
10:01 PM rue_shop4: root@freebee6:~# apt-file search um232h
10:01 PM rue_shop4: openocd: /usr/share/openocd/scripts/interface/ftdi/um232h.cfg
10:01 PM aandrew: that's not what I asked though
10:01 PM rue_shop4: root@freebee6:~# apt-get install openocd
10:01 PM rue_shop4: openocd is already the newest version (0.9.0-1+deb8u1).
10:01 PM rue_shop4: its supposed to be installed with the package
10:01 PM rue_shop4: its not being
10:02 PM rue_shop4: apparently the file is in the package but not being isntalled
10:04 PM rue_shop4: openocd -f interface/ftdi/um232h.cfg -c "transport select jtag; adapter speed 1; jtag newtap foo bs -irlen 8 -irmask 0x00; init; irscan foo.bs 8 0x55 -endstate IRSHIFT; exit "
10:04 PM rue_shop4: /usr/share/openocd/scripts/interface/ftdi/um232h.cfg:10: Error: invalid command name "adapter"
10:05 PM aandrew: it sounds like you have openocd 0.9 and openocd 0.10 installed on the same system
10:05 PM rue_shop4: in procedure 'script'
10:05 PM rue_shop4: at file "embedded:startup.tcl", line 60
10:05 PM rue_shop4: at file "/usr/share/openocd/scripts/interface/ftdi/um232h.cfg", line 10
10:05 PM aandrew: the command structure completely changed between them
10:05 PM rue_shop4: these vesions are all screwed
10:05 PM rue_shop4: ffff
10:05 PM rue_shop4: now I hate openocd MORE
10:05 PM rue_shop4: you NEVER DO THAT
10:05 PM aandrew: yeah it's a bit frustrating
10:05 PM rue_shop4: FFFFFFFFFFFFFFF
10:06 PM rue_shop4: I want to give up tonight
10:06 PM Tom_L: https://github.com/arduino/OpenOCD/blob/master/tcl/interface/ftdi/um232h.cfg
10:06 PM rue_shop4: useless software management
10:06 PM aandrew: what's openocd -v on the two machines say
10:06 PM rue_shop4: I mean, why not just make it a command line calculator instead, its the same as changing the command syntax
10:06 PM aandrew: the next wall you're going to run into is the ftdi_layout... it *must* match your specific adapter
10:06 PM rue_shop4: no, I dont care right now, I'm clicking out
10:07 PM aandrew: the ftdi driver is very flexible and that's a good thing, but it also means you end up sscratching your head a bit to get the layout right
10:07 PM rue_shop4: that pisses me off, like ncurses chaning the order and type of arguments to a function call
10:07 PM rue_shop4: like seriosly
10:07 PM aandrew: I drop an ft2232h on my designs so I have a debugger built in
10:07 PM rue_shop4: QT is just as bad, they f*** it up every major version
10:08 PM rue_shop4: EVERY time I try to use openocd its useless
10:08 PM aandrew: it's getting late here nad I've had a kind of shitty weekend, well couple of months to be honest. I think I'm gonna go to bed earlier
10:09 PM aandrew: hopefully your evening goes better
10:09 PM rue_shop4: maybe tommroow I can find a different program that can run a VFS file and go that way
10:09 PM rue_shop4: I changed the oil in the truck, greased the steering, and fixed the exhaust rattle (I think)
10:10 PM rue_shop4: there is a drillpress motor for me to figure out the wiring on for someone
10:10 PM Tom_L: should be easy enough for you
10:10 PM rue_shop4: its a delta start motor
10:10 PM Tom_L: oil, tree trim and burn clippings
10:10 PM rue_shop4: 6 wire, 9 coil
10:11 PM rue_shop4: :]
10:11 PM rue_shop4: we got some manure and mixed it into the garden
10:11 PM rue_shop4: hopefully it adds some life
10:11 PM Tom_L: added dry so the wet would burn
10:12 PM Tom_L: sulphur helps with soil acidity
10:12 PM rue_shop4: I need to get it tested and find out where its at
10:12 PM rue_shop4: I was going to get me to do that this year
10:12 PM Tom_L: i've dumped sand in and mixed it up in the past
10:13 PM Tom_L: forget just why
10:13 PM rue_shop4: I think we have really acidic soil out here
10:13 PM Tom_L: then you don't want sulphur
10:13 PM Tom_L: lime
10:16 PM rue_shop3: :]
10:16 PM rue_shop3: I'll get a test first :]
10:16 PM rue_shop4: I'll retreet from the shop and work on my "555 done wrong" article
10:16 PM rue_shop4: and show you the heads I did
10:18 PM Tom_L: don't look for me the end of april
10:38 PM rue_mohr: http://ruemohr.org/~ircjunk/tempimage/p1280070.jpg
10:39 PM rue_mohr: today I got the latches, springs and links on those
10:39 PM rue_mohr: the little circle at the bottom is the signature from your bender :]
11:12 PM rue_mohr: here is crazy
11:12 PM rue_mohr: remember that one wire 595?
11:13 PM rue_mohr: I think
11:13 PM rue_mohr: I'm not sure, but I think I can use it with 115200 baud data