#garfield Logs
Dec 22 2019
#garfield Calendar
07:33 AM Tom_L: i might try to set that up on linux here too but i dunno what driver to use with my usb jtag for it
03:05 PM * Tom_L wonders where rue_mohr's scope is
06:42 PM Tom_dev: xc3sprog -c xpc
06:42 PM Tom_dev: JTAG loc.: 0 IDCODE: 0x29506093 Desc: XC95108 Rev: C IR length: 8
06:42 PM Tom_L: looks right to me
06:42 PM Tom_L: on buster
06:49 PM Tom_L: using that generic jtag i showed you
06:58 PM Tom_dev: Sorry, can't program Xilinx device 'XC95108' from family 0x4a A more recent release may be able to.
07:01 PM Tom_L: doesn't surprise me
07:02 PM Tom_L: huh, it says it supports xc95x though
07:02 PM Tom_dev: http://xc3sprog.sourceforge.net/hardware.php
07:13 PM Tom_L: don't think it's the jtag device because it can read the part id
07:16 PM Tom_L: maybe when you're ready to play we can figure it out
07:23 PM Tom_L: but at least i got the tool installed to help
07:27 PM rue_mohr: hello world
07:28 PM rue_mohr: ooo I should try that
07:28 PM rue_mohr: whats xpc?
07:28 PM rue_mohr: I need a usb hub
07:39 PM rue_mohr: JTAG loc.: 0 IDCODE: 0x44002093 Desc: XC6SLX16 Rev: E IR length: 6
07:40 PM rue_mohr: Tom_L, shall I try erasing the device?
07:41 PM Tom_L: if you want, the first test i would do is to read the contents to a file
07:41 PM Tom_L: then verify it
07:42 PM Tom_L: -R filename.bit
07:43 PM Tom_L: -c device -R filename.bit
07:43 PM Tom_L: thing i found is you need to powercycle with this every time
08:05 PM Tom_L: xpc is my device type aparently
08:05 PM Tom_L: in that link i posted
08:08 PM rue_mohr: ok
08:09 PM rue_mohr: blink...
08:09 PM Tom_L: says DLC10 but mine is a 9 and it seems to work
08:10 PM rue_mohr: -R Try to reconfigure device(No other action!).
08:10 PM rue_mohr: -u Read usercode form XC2C devices.
08:10 PM Tom_L: the help said -R was read to a file i thought
08:10 PM Tom_L: i turned off the linux box
08:11 PM rue_mohr: oh its more complex
08:12 PM rue_mohr: xc3sprog -c ft232h -u foo.bit:r:0:BIT
08:13 PM rue_mohr: -rw-r--r-- 1 root root 0 Dec 22 18:06 foo.bit
08:13 PM rue_mohr: no...
08:13 PM Tom_L: what's all the ':' about?
08:13 PM rue_mohr: usage: xc3sprog -c cable [options] <file0spec>
08:13 PM rue_mohr: filespec is filename:action:offset:style:length
08:13 PM rue_mohr: action on of 'w|W|v|r|R'
08:14 PM Tom_L: oh, maybe i did it wrong
08:14 PM rue_mohr: Default offset is 0
08:14 PM rue_mohr: style: One of BIT|BIN|BPI|MCS|IHEX|HEX
08:14 PM * Tom_L is not from the linux world natively
08:14 PM rue_mohr: Default length is whole device
08:14 PM rue_mohr: buuuut
08:14 PM rue_mohr: this isn't a cpld
08:14 PM Tom_L: right but mine is
08:14 PM rue_mohr: so I think it needs to not be a bit file
08:14 PM Tom_L: no, yours would be
08:14 PM Tom_L: mine is a jed file iirc
08:15 PM rue_mohr: k
08:15 PM Tom_L: -h tells you the device file extensions
08:15 PM rue_mohr: comming up with zero lengths
08:15 PM Tom_L: it could be locked too
08:16 PM Tom_L: but i think it's lack of experience here
08:17 PM rue_mohr: Action r not supported for XC3S
08:18 PM rue_mohr: I'm writing an editor, how long till your done for the night?
08:25 PM Tom_L: 1 hrs
08:25 PM Tom_L: 2 hrs
08:25 PM Tom_L: up at 3am
08:26 PM Tom_L: i can boot linux if needed
08:26 PM Tom_L: it says my chip is supported, i'd like to make it so
08:36 PM rue_mohr: I can find the guy who knows how that utility works
08:38 PM Tom_L: where does he hide?
08:38 PM Tom_L: booted and waiting...
08:39 PM rue_mohr: twitter
08:39 PM rue_mohr: I'm asking in #whitequark, lots of fpga people there
08:39 PM Tom_L: maybe he should join garfield
08:39 PM rue_mohr: I COULD try a device erase...
08:39 PM Tom_L: there's a ##fpga channel
08:40 PM Tom_L: i would get it to read first
08:40 PM Tom_L: then you got something to compare against
08:42 PM Tom_L: yeah i was wrong about -R
08:43 PM Tom_L: well that's confusing because there's 'R' and '-R'
08:44 PM Tom_L: so are the options separated with '|' or ':'?
08:46 PM Tom_dev: http://xc3sprog.sourceforge.net/manpage.php
08:46 PM Tom_dev: example command lines
08:49 PM Tom_L: XC95 might be different than XC95X too
08:51 PM Tom_L: i think the last 'X' is the size though like 108
08:55 PM rue_mohr: default is all of it
08:55 PM Tom_dev: xc3sprog -c xpc -p 0 dump.bit:r
08:55 PM Tom_dev: Sorry, can't program Xilinx device 'XC95108' from family 0x4a A more recent release may be able to.
08:56 PM rue_mohr: Action r not supported for XC3
08:56 PM rue_mohr: this does not support reading that chip
08:57 PM Tom_dev: what about the rest of the commands?
08:57 PM rue_mohr: I think if I want to know, I need to just erase it
08:57 PM rue_mohr: "Action r not supported for XC3"
08:57 PM rue_mohr: "Action r not supported for XC3"
08:57 PM Tom_dev: yeah somebody mentioned that
08:58 PM rue_mohr: ram the image file into the SPI memory atta
08:58 PM rue_mohr: I wonder
08:59 PM rue_mohr: xc3sprog -c ft232h -I bloo.bit:r
08:59 PM rue_mohr: ^^ fial
09:00 PM Tom_L: work?
09:01 PM Tom_dev: ISF Bitfile probably not loaded
09:03 PM Tom_L: i think you would use -I to program the attached flash memory instead of directly to the fpga
09:04 PM Tom_L: you can do either but to the fpga will clear on a power cycle
09:04 PM Tom_L: that's why they have flash
09:04 PM Tom_L: unlike a CPLD
09:09 PM Tom_dev: looking at the source
09:09 PM Tom_dev: lse if (strnicmp("XC95108",device, sizeof("XC95144X")-1) == 0)
09:09 PM Tom_dev: {
09:09 PM Tom_dev: type = JED_XC95;
09:09 PM Tom_dev: which is what i have
09:12 PM Tom_dev: i think we need more info
09:15 PM Tom_L: tried -e too with same result
09:16 PM Tom_L: although the source shows code for the xc95 family
09:16 PM rue_mohr: I'm getting theimpresion that this softare can ONLY program the spartin 6
09:16 PM Tom_L: not what they advertise
09:16 PM rue_mohr: like, it cant read, and it cant do any other chip
09:16 PM Tom_L: http://xc3sprog.sourceforge.net/hardware.php
09:17 PM Tom_L: i'm not sure what version i have installed
09:17 PM Tom_L: i didn't build it
09:18 PM rue_mohr: "<mwk> no
09:18 PM rue_mohr: <mwk> fpga readout is complex shit"
09:20 PM Tom_L: i'm gonna try a verify
09:21 PM rue_mohr: did we work out what pins the led is on?
09:21 PM rue_mohr: and the buttons?
09:21 PM Tom_L: you need to
09:21 PM rue_mohr: there were pdfs
09:21 PM rue_mohr: and then there was a power outage
09:21 PM Tom_L: oh for your new board
09:22 PM Tom_dev: xc3sprog -c xpc -p 0 -v Counter_test.jed
09:22 PM Tom_dev: Using built-in device list
09:22 PM Tom_dev: Using built-in cable list
09:22 PM Tom_dev: firmware version = 0x0012 (18)
09:22 PM Tom_dev: CPLD version = 0x0012 (18)
09:22 PM Tom_dev: JTAG chainpos: 0 Device IDCODE = 0x29506093 Desc: XC95108
09:22 PM Tom_dev: Sorry, can't program Xilinx device 'XC95108' from family 0x4a A more recent release may be able to.
09:23 PM Tom_dev: USB Read Transactions: 2 Write Transactions: 5 Control Transaction 14
09:23 PM Tom_L: it sees the CPLD
09:23 PM rue_mohr: I'm getting theimpresion that this softare can ONLY program the spartin 6
09:23 PM Tom_dev: heh
09:23 PM rue_mohr: :)
09:24 PM Tom_dev: i don't need it but was trying to make it work to help you
09:24 PM Tom_L: because i know my jtag works
09:24 PM Tom_L: and you're unsure
09:24 PM rue_mohr: well, atleast I know its not me
09:24 PM rue_mohr: I'm gonna try an erase
09:25 PM Tom_L: i tried one
09:25 PM Tom_L: no go
09:25 PM Tom_L: but go ahead
09:25 PM rue_mohr: odd
09:25 PM rue_mohr: there are no errors
09:26 PM rue_mohr: there are no non-errors
09:26 PM Tom_dev: but you have no way to know it erased either
09:26 PM rue_mohr: the leds are still flashing
09:26 PM rue_mohr: rebooting it
09:26 PM Tom_dev: then it didn't
09:26 PM rue_mohr: still flashing
09:26 PM rue_mohr: well, maybe it did what it said
09:27 PM rue_mohr: it erased the device, then reset it, then it loaded from flash
09:27 PM Tom_dev: i noticed with this software you gotta do a power cycle each time
09:27 PM rue_mohr: power cycled, still flashing
09:29 PM Tom_L: set an led up on your new board
09:29 PM Tom_L: and a button
09:29 PM Tom_L: sink the led
09:29 PM Tom_L: not source
09:29 PM Tom_dev: goin back to windows
09:30 PM rue_mohr: there is a snag here
09:30 PM rue_mohr: to write it I have to write the flash
09:30 PM Tom_L: no
09:30 PM Tom_L: but it will be volatile
09:30 PM rue_mohr: and to do that I need a
09:30 PM rue_mohr: hmm
09:30 PM Tom_L: err it will go away on a power cycle
09:31 PM rue_mohr: I'm knee deep in a different project just now
09:31 PM rue_mohr: are your holiday(s) looking busy?
09:31 PM Tom_L: tomorrow, company
09:31 PM Tom_L: saturday night company
09:31 PM rue_mohr: tonnes of family visiting from all corners of the world
09:32 PM rue_mohr: "after loading 'bscan_spi' bitfile if given."
09:32 PM rue_mohr: thats the fpga stuff to talk to the fpgas spi
09:33 PM Tom_L: can't find your file now
09:34 PM Tom_L: link me to it again
09:35 PM Tom_L: i somehow deleted it
09:43 PM rue_mohr: https://github.com/ChinaQMTECH/QM_XC6SLX16_SDRAM/blob/master/QM_XC6SLX16_SDRAM_V02.zip
09:43 PM rue_mohr: woa
09:43 PM rue_mohr: my file?
09:43 PM Tom_L: your board schematic
09:43 PM Tom_L: i think i deleted it
09:44 PM Tom_L: yeah i got it from that link
09:45 PM rue_mohr: thats a lot of stuff
09:45 PM rue_mohr: I'v unpacked two of the test ones
09:46 PM rue_mohr: I'll try opening them later
09:47 PM Tom_L: are the pins labelled?
09:47 PM Tom_L: on the edge
09:47 PM rue_mohr: nope
09:48 PM rue_mohr: I'd rather use the onboard leds and buttons for the first few tests
09:48 PM Tom_L: oh ok
09:48 PM Tom_L: i forgot it had them
09:48 PM Tom_L: try to find out where they go
09:48 PM rue_mohr: will do
09:48 PM rue_mohr: I'll start a book, print some pages with info
09:49 PM Tom_L: BANK2_IO_T9 & R9
09:49 PM Tom_L: for D1 & D2
09:49 PM Tom_L: leds
09:49 PM rue_mohr: k
09:49 PM Tom_L: "user leds"
09:49 PM Tom_L: sw1-3
09:50 PM rue_mohr: one of them is a magic switch tho
09:50 PM Tom_L: PROG_B, MANK2_IO_T8 & R7
09:50 PM Tom_L: the last 2 you can likely use
09:50 PM rue_mohr: and one of the leds is power
09:50 PM Tom_L: progb is the magic switch
09:50 PM Tom_L: probably
09:50 PM rue_mohr: do you know what it does?
09:50 PM Tom_L: PROG_B, BANK2_IO_T8 & R7
09:50 PM rue_mohr: seems like a reload button
09:51 PM Tom_L: probably a reset after flash, i'm not sure
09:51 PM Tom_L: P11
09:51 PM Tom_L: of the manual
09:52 PM Tom_L: leds are on P10
09:52 PM Tom_L: are the headers labelled at all like U8 etc
09:52 PM Tom_L: U7 U8
09:52 PM Tom_L: yes
09:53 PM Tom_L: so the pinout for the sides are U7 & U8 found on P9
09:53 PM rue_mohr: yup
09:54 PM Tom_L: 1 is designated by the Square pad
09:54 PM rue_mohr: k, got that written down
09:54 PM Tom_L: that looks like most of the mystery
09:55 PM rue_mohr: which datasheet you looin at?
09:55 PM Tom_itx: QM_XC6SLX16_SDRAM-User_Manual
09:55 PM rue_mohr: ah
09:55 PM Tom_L: the one i deleted :D
09:56 PM Tom_L: brb
09:57 PM rue_mohr: d3 is bank2_io_r9
09:58 PM rue_mohr: fpga done?
09:59 PM rue_mohr: I think they mean loaded
10:00 PM rue_mohr: ok, so I have 2 inputs and 2 outputs
10:00 PM rue_mohr: thats fine for now
10:04 PM rue_mohr: wow, examples seem thin
10:08 PM Tom_L: you programmed it?
10:09 PM Tom_L: r9 is correct acording to the schematic yes
10:09 PM Tom_L: BANK2_IO_R9
10:13 PM Tom_L: your examples are verilog
10:24 PM rue_mohr: no I'm writing an editor
10:24 PM rue_mohr: https://viewsourcecode.org/snaptoken/kilo/04.aTextViewer.html
10:25 PM rue_mohr: ah, hmm, were using vdl?
10:25 PM rue_mohr: vhl?
10:25 PM Tom_L: i am
10:25 PM Tom_L: but i'm learning both
10:30 PM Tom_L: ok leds mapped
10:30 PM Tom_L: where were the buttons?
10:31 PM Tom_L: oh my test only used 1 button
10:31 PM Tom_L: so we will use SW2
10:31 PM Tom_L: for the test
10:32 PM rue_mohr: buttons on b2_T8 and R7
10:32 PM rue_mohr: .... what do you have then?
10:32 PM Tom_L: ok mapped to T8
10:35 PM Tom_L: can you upload a file?
10:36 PM rue_mohr: maybe
10:36 PM rue_mohr: a bit file?
10:36 PM Tom_L: yes
10:37 PM rue_mohr: lets try
10:38 PM Tom_L: http://tom-itx.no-ip.biz:81/~webpage/temp/xilinx/rue/
10:38 PM Tom_L: the .ucf is new
10:38 PM Tom_L: the .bit is the one to download
10:38 PM Tom_L: read the ucf to know which button
10:38 PM Tom_L: button is T8
10:39 PM Tom_L: i went with SDIO for drive current since i don't know what they all are yet
10:39 PM rue_mohr: k
10:39 PM Tom_L: the 2 leds will do opposite each other on a button push
10:41 PM rue_mohr: !?
10:41 PM rue_mohr: DNA is 0x19b392f615c024ff
10:41 PM rue_mohr: Device failed to configure, INSTRUCTION_CAPTURE is 0x19
10:41 PM rue_mohr: but
10:41 PM Tom_L: when one is on the other is off
10:41 PM rue_mohr: leds aren't flashing
10:41 PM Tom_L: huh
10:41 PM rue_mohr: hmm
10:42 PM rue_mohr: looks like it was left in like a HALT
10:42 PM Tom_L: it's an awfully simple program, i'm not sure if other stuff needs turned off or not
10:43 PM Tom_L: but i used the planahead to map the pins
10:43 PM Tom_L: and they mapped to bank2 with the pins above
10:43 PM rue_mohr: power cycle takes it back to orig
10:43 PM Tom_L: yeah
10:43 PM Tom_L: because you didn't write it to flash
10:43 PM Tom_L: rather the fpga
10:43 PM rue_mohr: yup
10:44 PM rue_mohr: but I wonder whats wrong
10:44 PM Tom_L: i'll open one of their tests tomorrow and look at it closer
10:44 PM rue_mohr: looking up the error
10:45 PM rue_mohr: Ah ha! and DoH I'd accidentally configured my project for an sxl4 instead of sxl9 - just a slip of a gui...
10:45 PM rue_mohr: ?
10:45 PM Tom_L: try it again?
10:45 PM rue_mohr: di that
10:45 PM rue_mohr: "Ah ha! and DoH I'd accidentally configured my project for an sxl4 instead of sxl9 - just a slip of a gui..."
10:45 PM rue_mohr: ^^ what did you configure for?
10:45 PM Tom_L: sc6slx9-3fgt256
10:46 PM rue_mohr: I'm X16
10:46 PM Tom_L: oh
10:46 PM Tom_L: hang on
10:46 PM Tom_L: ftg256?
10:46 PM rue_mohr: yes
10:47 PM rue_mohr: it seems the g is optional
10:47 PM Tom_L: i'll upload another bit file
10:47 PM rue_mohr: ok
10:47 PM Tom_L: just refresh when instructed
10:47 PM Tom_L: ok try that one
10:48 PM Tom_L: i thought you had a 9
10:48 PM rue_mohr: !!!
10:48 PM rue_mohr: no errors
10:49 PM rue_mohr: so button 2
10:49 PM rue_mohr: ACES!
10:49 PM Tom_L: work?
10:49 PM rue_mohr: totally
10:49 PM Tom_L: cool
10:49 PM rue_mohr: yes
10:49 PM rue_mohr: so, can you update the rest of the files for me for that?
10:49 PM Tom_L: soon
10:49 PM Tom_L: but not now
10:50 PM rue_mohr: hahah :P cause this `work` thing is overrated :)
10:50 PM Tom_L: unless you have a specific one i can do one
10:50 PM rue_mohr: well thats right were I want to start playing
10:50 PM Tom_L: ok, did it overwrite your flash?
10:50 PM rue_mohr: no
10:50 PM Tom_L: reboot and see if it stays
10:50 PM rue_mohr: I just oopsed with switch 1 and its back on demo
10:51 PM Tom_L: ok so you eventually need to figure out the difference where to write
10:51 PM rue_mohr: there is an extra step
10:51 PM Tom_L: but for now this is good
10:51 PM rue_mohr: you need to write a forawrding program to the fpga and then use it to flash the memory
10:51 PM rue_mohr: I did a quick search and cant find the forwarder
10:52 PM rue_mohr: but it must be around
10:52 PM Tom_L: it's not -p 1 is it?
10:52 PM Tom_L: instead of -p 0
10:52 PM rue_mohr: no
10:52 PM rue_mohr: the p is for when you have multiple fpgas in a chain
10:52 PM Tom_L: ok
10:52 PM rue_mohr: to say which one to talk to
10:54 PM rue_mohr: well, wait a sec
10:54 PM rue_mohr: let me try this
10:54 PM Tom_L: are these samples compiled for the 9 chip instead of the 16?
10:54 PM rue_mohr: no
10:55 PM rue_mohr: dunno
10:55 PM rue_mohr: bscan_spi/xc6slx16_cs324.bit
10:55 PM Tom_L: they have bit files i think
10:55 PM rue_mohr: this is the trick, need to find that bit forwarder
10:55 PM rue_mohr: https://github.com/sifive/xc3sprog/blob/master/bscan_spi/xc6slx16_cs324.bit
10:55 PM rue_mohr: smirk
10:56 PM rue_mohr: OOOooo
10:57 PM rue_mohr: Unique number: ffffffffffffffff
10:57 PM rue_mohr: 256 bytes/page, 4096 pages = 1048576 bytes total
10:57 PM rue_mohr: Verify: Success!
10:57 PM Tom_L: so it wrote to flash?
10:57 PM rue_mohr: yup, reboot is now your program
10:57 PM Tom_L: take notes!
10:57 PM rue_mohr: so, the xc6slx16_cs324.bit sets it up as a programmer
10:58 PM rue_mohr: then you use the -I to write it to the flash via the fpga
10:58 PM Tom_L: i figured -I did something like that
10:58 PM rue_mohr: xc3sprog -c ft232h xc6slx16_cs324.bit
10:58 PM rue_mohr: xc3sprog -c ft232h -I buttonforward.bit
10:58 PM Tom_L: ok i'll do test1 for you
10:59 PM Tom_L: but of course it's the one that's not a project
11:00 PM rue_mohr: you would almost think we knew what we were doing
11:00 PM rue_mohr: hindsight...
11:00 PM Tom_L: i somewhat do
11:00 PM rue_mohr: I probably could have read the bit file in the flash after loading that first thing
11:01 PM rue_mohr: hah yea, I'm reading yours back out now
11:01 PM rue_mohr: tho it came back out a few bytes short
11:02 PM Tom_L: notice how big the .bit file is
11:02 PM Tom_L: just for a button led thing
11:02 PM Tom_L: they pretty much stay that size
11:02 PM rue_mohr: yep
11:02 PM rue_mohr: well cool
11:03 PM Tom_L: ok those tests are compiled for the 16 so any bit file you should be able to download
11:03 PM Tom_L: i'll post one for you
11:04 PM Tom_L: key_jitter.bit
11:04 PM Tom_L: same dir
11:04 PM Tom_L: see what it does
11:05 PM Tom_L: looks like it maps both buttons to both leds
11:06 PM Tom_L: but it's got the clock doing something with it too
11:06 PM Tom_L: and R7 reset button
11:07 PM Tom_L: they set their samples up to drive LVTTL
11:07 PM Tom_L: so i dunno if that's 3.3v or what exactly
11:11 PM Tom_L: going for system shutdown....
11:12 PM Tom_L: gnite
11:12 PM MoonyMoon: peace
11:12 PM Tom_L: moon!
11:12 PM Tom_L: get a fpga and come play
11:12 PM rue_mohr: MoonyMoon, we got the fpga working
11:13 PM rue_mohr: tom did the software and I ran random commands on the keybaord till it worked
11:17 PM rue_mohr: huh
11:17 PM rue_mohr: Tom_L, , its crashing
11:17 PM rue_mohr: are there pullup resistors you can do?
11:18 PM rue_mohr: on the button?
11:18 PM * rue_mohr wiats for it to do it again
11:42 PM MoonyMoon: I may
11:42 PM MoonyMoon: FPGA that is :)
11:44 PM MoonyMoon: going down for a reboot right now