Gowin: JTAG device detection failure (pretty scope pictures included!) - Page 1
Forum section: electronics / general

author: mblinov
author_rank: Contributor
timestamp: May 19, 2022, 11:37:29 pm
content: Hi all, I can't seem to get JTAG programming over the Gowin U2X working for my new Gowin MiniStar-Nano board (FPGA part number is GW1NSR-2C)Symptom: Gowin Programmer reports "Error: No Gowin devices found!"So, here's the physical view (for what its worth):And the "schematic":The MiniStar-Nano is sitting on a side of double-sided adhesive tape. 3.3V on the two-pin connection on the left, 5-pin programming header that is the same pin-numbering as the U2X (TDO, TCK, TMS, TDI, GND). With 3.3V applied, I can verify the presence of 1.8V from the regulator on pin 36 (VCC1V8).The U2X programming dongle:Now, here's my programming routine: Below is what I see on my scope at different stages:In all cases, the channels 1-4 are TCK, TMS, TDO, TDI.1). The "initial state": Dongle is unplugged. A free-running untriggered trace shows that everything is pulled up except TCK by 4K7 resistors up to 3V3 rail, as it should be given the presence of 4K7 pull-ups on those signals.2). I plug in the U2X programmer, but dont touch anything on the PC. Free-running trace shows the TCK get pulled up.3). Set scope to trigger on TMS falling edge. I then click only one button: The "Scan Device" button on the Gowin programmer:I see the following packet appear on the scope. TCK and TMS get toggled, but nothing on TDO or TDI, although TDO stays high. I'm not really super familiar looking at JTAG packets at this level - surely the U2X should be pushing out *something* across TDI?A close up on the first packet:And on the second:4). Set scope to free-running. All lines are now in a permanent state of 0V, except TDO - surely that's not right for JTAG? Shouldn't lines be left floating up to 3V3 if we're not in the middle of a packet? Atleast that's what I'm used to from SPI/I2C...5). I disconnect the U2X from the USB port, and everything floats back up againAny ideas anyone? Aside from the obvious user error, my thoughts:- I fried the MiniStar Nano FPGA board with my creative soldering technique. So naturally I purchased two of them. But soldering it again is gonna be a real pain...- Maybe its a programmer issue (either i fried it somehow, or something else)Anyway thought I'd document what I'm doing so far. Going to try make another board with my spare MiniStar-Nano. Tomorrow a second U2X should arrive incase its a programmer issue.

author: mon2
author_rank: Frequent Contributor
timestamp: May 20, 2022, 02:38:02 am
content: Just confirming that the proper device driver has been installed as per attached manual?

author: mblinov
author_rank: Contributor
timestamp: May 20, 2022, 02:49:01 am
content: Yep, first thing I did was read that handbook to get the programmer properly installed (or atleast I hope it is):1). Install WinUSB driver for the probe via Zadig (already done as you can see)2). Verify it appears in my device manager (Indeed it does)3). Gowin Programmer confirms its detected - Although there is one small aspect, of the Serial Number ("SN: <blank>") coming up seemingly empty, or set to the empty string - not sure what to think of that (see below)

author: mon2
author_rank: Frequent Contributor
timestamp: May 20, 2022, 06:24:41 am
content: Select the lowest frequency for the JTAG clock (see your last post) and try again.

author: miken
author_rank: Regular Contributor
timestamp: May 20, 2022, 06:32:51 am
content: The fact that you see something on the scope for TCK/TMS suggests that your driver is OK. I would cut the TDI/TDO wires to the board and see what you get coming out of the dongle.

author: mblinov
author_rank: Contributor
timestamp: May 20, 2022, 10:04:19 am
content: Hi all, thanks for your replies:Quote from: mon2 on May 20, 2022, 06:24:41 amI would have loved to, but the dialog box only lets me select 1.3MHz:Quote from: miken on May 20, 2022, 06:32:51 amI had a go doing this - I unplugged the TDO and the TDI signals from the mainboard, connected them to the U2X (so they are just dangling about) and hooked up my scope probes to it directly. But I didn't see anything over TDI or TDO - infact they exhibited exactly the same behaviour as in my original post.

author: mon2
author_rank: Frequent Contributor
timestamp: May 20, 2022, 11:37:35 am
content: QuoteSpecial drivers are often used to fix quirks in the silicon which have read this device has for programming. Activity of the signal lines is a good start but mandatory to use their procedure and drivers.Remove the external pull-ups that you have applied. They are not required.The U2X dongle has a 4k7 pull-downso with your 4k7 pull-up, there is a voltage divider present on TCK. Then test again.See attached schematic.

author: mblinov
author_rank: Contributor
timestamp: May 20, 2022, 05:30:55 pm
content: Quote from: mon2 on May 20, 2022, 11:37:35 amfor TCK i didn't add any pull-ups - that was directly connected. I've only put pull-ups on TMS, TDI, TDO. After removing all of them I see the same behaviour unfortunately.

author: mblinov
author_rank: Contributor
timestamp: May 20, 2022, 06:43:57 pm
content: Hi all, bad news: The new programmer arrived (a second U2X), and it exhibits exactly the same issue.I have also tried doing a full cold-boot on the PC just incase the drivers weren't happy for whatever reason.This time, I haven't dared plug it into my test board - Infact, since opening it from the packet, I have _only_ attached it to my scope, just to minimize the risk of my sloppy soldering potentially frying the thing somehow. Here's the setup (click for larger image):That JTAG connection hasn't been plugged into anything as of writing.And the tek scope: Same procedure as last time - Plug in, and click "Scan Devices" (channels 1-4 areTCK,TMS,TDO,TDI):Packet 1:Packet 2:

author: mblinov
author_rank: Contributor
timestamp: May 20, 2022, 07:05:10 pm
content: Another thing I just tested (and can confirm no changes occured):For all previous posts, I've been using the "Gowin Edu" toolset, the programmer for which was version 1.9.8.3 build 20120. Now I have been kindly provided a license from Gowin, and have installed the "Gowin Standard" toolset, programmer version 1.9.8.5 build 20302.(I didn't realize however that the programmer doesn't actually need a license file to operate - only the EDA tool.)

author: mon2
author_rank: Frequent Contributor
timestamp: May 20, 2022, 07:33:45 pm
content: I am a sucker for kits so ordered the same tools (U2X dongle & Gowin PCB) from Amazon (USA). Perhaps too much salivating over the Heathkits that I could not afford as a childWill let you know when they arrive to share our results. Hope you have it working before then but the ETA is about a week or so out for arrival.

author: mblinov
author_rank: Contributor
timestamp: May 20, 2022, 08:00:12 pm
content: Quote from: mon2 on May 20, 2022, 07:33:45 pmHopefully you will have more luck than myself! If my track record is anything to go by, problem is almost certainly between keyboard and chair...I reached out again to the magicjellybeanfpga/Gowin support folks (who are super helpful btw) with a summary of the issue, and will post here any updates from that side of things. In the meantime I've continued my "throw money at the problem" approach and ordered the "Gowin PL-USB-Cable_V4.0" download cable to see if I can just brute force my way to a flashed bitstream.Quote from: mon2 on May 20, 2022, 07:33:45 pmI'm assuming you mean the plug-and-play type boards that Gowin offer: this would have been 100% the correct route. But ofcourse I bit off more than I can chew - this story plays itself again and again. Also, surprisingly hard to find UK supplies of Gowin dev kits (although I confess I didn't really look much) - most of them seem to be under some kind of restriction, atleast from Mouser.

author: mon2
author_rank: Frequent Contributor
timestamp: May 20, 2022, 08:07:10 pm
content: We ordered exactly what you are using. Our interest is more on evaluating the U2X bridge IC for a few products. We have a mix of other Gowin kits already in the building - just not enough time to play with each. Currently our pain in the arse SMT machinery is consuming more time than it should.

author: miken
author_rank: Regular Contributor
timestamp: May 21, 2022, 06:46:25 am
content: Quote from: mon2 on May 20, 2022, 11:37:35 amThat is a good point, there are likely to be bugs in new hardware (and software). And they have probably only tested on a limited set of computers.

author: mblinov
author_rank: Contributor
timestamp: May 21, 2022, 02:43:04 pm
content: Hi all,TL;DR: "Gowin-PL-USB-Cable_V4-0" (I call it "PL4" for short) programmer exhibits activity on TCK, TMS, and TDI, whereas the U2X was completely silent on TDI, which is encouraging. However, the dev board I soldered up does not respond with anything on TDO, and I still see "No devices found".In full:TheGowin PL-USB-Cable_V4.0arrived today, and I did the same procedure as I did with the second U2X, which was to plug it into my scope before plugging it anywhere else. This one actually pushed stuff out of the TDI port!One major note: You must put 3.3V on the VCC pin of the adapter, otherwise the programmer assumes there's nothing connected and won't even twiddle any bits. Caught me out for a bit.The setup:I click "Scan Devices"The packets, and this time I see activity on TCK, TMS, and TDI:I won't bother posting the rest of the packets.Unfortunately, when I connected it to the board, I still get "No devices found" - the packets are the same as in the unconnected case, which is unsusprising since in both scenarios there was no activity on TDO (which in the case of the programmer being connected to the dev board, should be driven by the target.)The test jig:I've tried with and without pullups aswell, with the same results. So it is possible the small dev board has suffered some kind of damage - I will build a second version of the above, and hopefully be a bit more careful with the dwell time with my soldering iron.Note about the Arduino - I'm just using its power supply. I did worry that maybe the dev board was somehow sinking more than the ~100mA that it can provide, however the ammeter tells me its using 12.5mA or so, so it shouldn't be a problem.

author: mon2
author_rank: Frequent Contributor
timestamp: May 21, 2022, 04:18:05 pm
content: Can you test again but with:TDO of the JTAG tool mated to your TDI of the Gowin PCB andTDO of your Gowin PCB to your TDI of the JTAG tool ?

author: mblinov
author_rank: Contributor
timestamp: May 21, 2022, 05:05:14 pm
content: Hi all, I've just got it working!As I suspected, it was a screw-up on my end - Gowin support have contacted me back and asked to make sure I'd connected up _all_ the bank voltage pins to VCC3V3 (that is VCCO_0, VCCO_1, and VCCO_2). After I did this, It immediately detected my FPGA and I successfully programmed it with my 100-times clock divider test project (27MHz -> 270KHz):I was told that there is infact internal chip circuitry that will hold the chip in reset unlessall 3 of the bank voltage pins VCCO_0, VCCO_1, VCCO_2 have been assigned to some voltage rail. Initially I had none connected, but *just* connecting VCCO_0 will not work (even though that is the bank on which the JTAG pins live) - it has to be all of them. I haven't experimented with it any further though.All my programmers work fine - both U2X's, and the big PL4 cable box. Although I would add, theres a pretty significant difference in the speed of the U2X vs. the PL4 cable box, atleast when programming to the Embeddef Flash:[Selected speed][program time (mm:ss)][Verify time]U2X1.33 MHz00:0501:55PL42 MHz00:0500:05Thanks everyone for your help, it probably wont be long until i make another thread...

author: mc68000
author_rank: Contributor
timestamp: May 23, 2022, 04:12:03 pm
content: Very interesting. The frequency is not much different, but overall time has big difference. Could be software side issue.

author: mon2
author_rank: Frequent Contributor
timestamp: May 23, 2022, 06:03:09 pm
content: Quote from: mc68000 on May 23, 2022, 04:12:03 pmFrom last review, the U2X bridge = USB 1.1 (12 Mbps) Full Speed interface.The cable is faster as it is the FTDI MPSSE device with USB 2.0 HS (480Mbps) support.

author: mc68000
author_rank: Contributor
timestamp: May 24, 2022, 12:19:25 am
content: I made contact to Gowin support and raise the question on the programming speed. Here is their internal testing data:Device: GW1NS-4CProgrammer 1.9.8.06 build 20517bitstreamFile(.fs)Size--------Programmer ------Speed-------------ProgramTime(mm:ss)-----------VerifyTime1.1MB U2X 1.33Mhz 00:04 00:141.1MB PL4 2 Mhz 00:04 00:08-----------------------------------------------------------------------------------------------------------------1.8MB U2X 1.33Mhz 00:05 00:251.8MB PL4 2 Mhz 00:06 00:12The 2 minutes verify time seems way off. May be yu can check with them again!