Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Support Lilygo T-FPGA board with GWU2X USB-to-JTAG bridge #434

Open
janschiefer opened this issue Feb 21, 2024 · 18 comments
Labels

Comments

@janschiefer
Copy link

Hi,

I just picked up an interesting and cheap FPGA board - Lilygo T-FPGA with an Gowin GW1NSR-LV4CQN48PC6/15 and an ESP-S3 as an IoT solution.

Interestingly this board seems t use the relatively new GWU2X application specific chip as an USB to JTAG-brigde.

Any chance flashing this board over USB will be supported in the future?

Specs: https://www.lilygo.cc/products/t-fpga
GIthub repository: https://github.com/Xinyuan-LilyGO/T-FPGA/tree/main
Board schematic: https://github.com/Xinyuan-LilyGO/T-FPGA/blob/main/schematic/T-FPGA-V1.0%20CORE.pdf
Documentation for the GWU2X USB to JTAG bridge: https://alcom.be/uploads/Gowin-UG1000-1.0E_GWU2X-Datasheet.pdf

@trabucayre
Copy link
Owner

I have already seen this board, and I think I have to bought one (or ask for free sample ;-) ).
The main issue with gowin's stuff is the totally lake of documentations, most of the time you have partial/incomplete, wrong documentations.

@janschiefer
Copy link
Author

Do you speak Mandarin? ... https://cdn.gowinsemi.com.cn/UG1003.pdf

@trabucayre
Copy link
Owner

Not really, but this doc explain how to use a gowin's library to use this chip no?
My interest isn't to use an external library but implement the protocol ;-)
But I assume wireshark will be my friend.

@trabucayre
Copy link
Owner

I have received my board today.
After a quick search on gowin website I have found a doc about protocol (instructions to send).
It looks really similar to FTDI's MPSSE.
I think it's not possible to use directly libftdi but this seems not really hard to implement. I will try it ASAP.

@janschiefer
Copy link
Author

Very nice!

@zJudGenie
Copy link

I also bought this cool board, I'm trying to use it with the toolchain yosis+nextpnr+gowin_pack+openFPGAloader.
The GW1NSR-4C is supported by the apicula project but I'm struggling to flash the bitstream to the FPGA through the Gowin Programmer as it is complaining about a wrong ID CODE and I don't know why.

So I'm waiting that the GWU2X will be supported by openFPGAloader because it is a really cool project, I can help with testing stuff.

Also, I found a little bit of documentation here that should be helpful to add the support.

Thank you.

@trabucayre
Copy link
Owner

Hi.
Gowin GWU2X and lilygo T-FPGA are now supported.
Is it good to you?

@zJudGenie
Copy link

Yes, thank you, I tried flashing to SRAM with -m and it works, when I try to write to flash with -f I get, during the Erase FLASH phase, Write failed with error -7, Failed to program FPGA: std:exception

@trabucayre
Copy link
Owner

Thanks for your feedback: I will try with a different computer to see if it's an hardware issue.
Could you share your setup ? OS / VM ?
Thnaks

@zJudGenie
Copy link

I tried with this example https://github.com/Xinyuan-LilyGO/T-FPGA/tree/main/example/FPGA/led/src.
I synthesized it with the Gowin IDE educational 1.9.9 on Windows and then I used Ubuntu 22.04 on WSL to flash it, using openFPGALoader

@trabucayre
Copy link
Owner

Thanks for informations. Is it possible to you to test with a native linux? I have seen lot of issues with WSL (and I have to find why).

@zJudGenie
Copy link

I noticed this strange behavior, it seems that when I use the verbose flag the IDCODE gets corrupted
immagine

@zJudGenie
Copy link

And then, trying to detect the FPGA with openFPGALoader --detect --cable gwu2x gives the same error

@zJudGenie
Copy link

This is the output I get when, after rebooting the device, I try to flash it with -f -v so in verbose mode
immagine

@trabucayre
Copy link
Owner

This timeout (-7) is fixed: stupid optimisation before pushing: 65356== 0x10000 ie needs 17bits but I have used a 16bits variable...
But now it seems to have a problem with the bitstream: I obtain an error (mismatch between read checksum and computed). Maybe another issue with a variable or a size. But I have to check if the same FPGA and an FTDI I have a similar error or if it's gwu2x related bug.

@zJudGenie
Copy link

If you have an FTDI and a 13-pin flat cable you can directly access JTAG lanes using the white connector as you can see here
immagine

@trabucayre
Copy link
Owner

Unfortunately no. I will switch to my tangNano 4k to check before continuing to debug this board.

@trabucayre
Copy link
Owner

With tangnano4k Flash sequence is working: I have to recheck everything here to see where is issue with gwu2x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants