Author Topic: Gowin: JTAG device detection failure (pretty scope pictures included!)  (Read 2091 times)

0 Members and 1 Guest are viewing this topic.

Offline mblinovTopic starter

  • Contributor
  • Posts: 43
  • Country: gb
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 again


Any 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.
 

Offline mon2

  • Frequent Contributor
  • **
  • Posts: 462
  • Country: ca
Just confirming that the proper device driver has been installed as per attached manual?
 

Offline mblinovTopic starter

  • Contributor
  • Posts: 43
  • Country: gb
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)
 

Offline mon2

  • Frequent Contributor
  • **
  • Posts: 462
  • Country: ca
Select the lowest frequency for the JTAG clock (see your last post) and try again.
 

Offline miken

  • Regular Contributor
  • *
  • Posts: 102
  • Country: us
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.
 

Offline mblinovTopic starter

  • Contributor
  • Posts: 43
  • Country: gb
Hi all, thanks for your replies:

Select the lowest frequency for the JTAG clock (see your last post) and try again.
I would have loved to, but the dialog box only lets me select 1.3MHz:


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.
I 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.
 

Offline mon2

  • Frequent Contributor
  • **
  • Posts: 462
  • Country: ca
Quote
The fact that you see something on the scope for TCK/TMS suggests that your driver is OK.

Special 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-down so with your 4k7 pull-up, there is a voltage divider present on TCK. Then test again.

See attached schematic.
 

Offline mblinovTopic starter

  • Contributor
  • Posts: 43
  • Country: gb
Quote
The fact that you see something on the scope for TCK/TMS suggests that your driver is OK.

Special 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-down so with your 4k7 pull-up, there is a voltage divider present on TCK. Then test again.

See attached schematic.

for 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.
 

Offline mblinovTopic starter

  • Contributor
  • Posts: 43
  • Country: gb
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 are TCK, TMS, TDO, TDI):
Packet 1:


Packet 2:

« Last Edit: May 20, 2022, 06:46:15 pm by mblinov »
 

Offline mblinovTopic starter

  • Contributor
  • Posts: 43
  • Country: gb
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.)
 

Offline mon2

  • Frequent Contributor
  • **
  • Posts: 462
  • Country: ca
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 child  :-//

Will 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.
 

Offline mblinovTopic starter

  • Contributor
  • Posts: 43
  • Country: gb
Will 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.
Hopefully 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.

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 child  :-//

I'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.
« Last Edit: May 20, 2022, 08:01:53 pm by mblinov »
 

Offline mon2

  • Frequent Contributor
  • **
  • Posts: 462
  • Country: ca
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.
 

Offline miken

  • Regular Contributor
  • *
  • Posts: 102
  • Country: us
Special 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.

That 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.
 

Offline mblinovTopic starter

  • Contributor
  • Posts: 43
  • Country: gb
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:

The Gowin PL-USB-Cable_V4.0 arrived 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.
« Last Edit: May 21, 2022, 02:47:14 pm by mblinov »
 

Offline mon2

  • Frequent Contributor
  • **
  • Posts: 462
  • Country: ca
Can you test again but with:

TDO of the JTAG tool mated to your TDI of the Gowin PCB and

TDO of your Gowin PCB to your TDI of the JTAG tool ?
 

Offline mblinovTopic starter

  • Contributor
  • Posts: 43
  • Country: gb
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 unless all 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:

[Programmer][Selected speed][program time (mm:ss)][Verify time]
U2X1.33 MHz00:0501:55
PL42 MHz00:0500:05

Thanks everyone for your help, it probably wont be long until i make another thread...
« Last Edit: May 21, 2022, 06:30:39 pm by mblinov »
 
The following users thanked this post: paf

Offline mc68000

  • Contributor
  • Posts: 11
  • Country: us
Very interesting. The frequency is not much different, but overall time has big difference. Could be software side issue.
 

Offline mon2

  • Frequent Contributor
  • **
  • Posts: 462
  • Country: ca
Very interesting. The frequency is not much different, but overall time has big difference. Could be software side issue.

From 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.
 

Offline mc68000

  • Contributor
  • Posts: 11
  • Country: us
I made contact to Gowin support and raise the question on the programming speed. Here is their internal testing data:

Device: GW1NS-4C
Programmer 1.9.8.06 build 20517

bitstreamFile(.fs)Size--------Programmer ------Speed-------------ProgramTime(mm:ss)-----------VerifyTime
1.1MB                             U2X                      1.33Mhz                           00:04                                 00:14
1.1MB                             PL4                       2 Mhz                           00:04                                 00:08
-----------------------------------------------------------------------------------------------------------------
1.8MB                             U2X                      1.33Mhz                           00:05                                 00:25
1.8MB                             PL4                       2 Mhz                           00:06                                 00:12

The 2 minutes verify time seems way off. May be yu can check with them again!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf