-
Notifications
You must be signed in to change notification settings - Fork 165
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
Information on readme how to upload bitstream to FPGA? #4
Comments
Maybe you need a Digilent JTAG-SMT2,the FT232HL_v20.5.31.pdf in this repo is enough. cost about 8$ |
Thanks! With this information I was actually able to do some research and found web page describing programming solutions. I also had a look at FT232HL board you mentioned and was thinking could this Adafruit one serve similar purpose? Of course with this you have to connect the pins individually. |
Hi, I'm probably from the same bandwagon as @Kazhuu. With a bunch of these on the way I'm also in the process of figuring out how to use them 🤣 The cheapest way to get going is probably to just build the SD card image and boot the board from that. Most examples available for this board go this way
However, in order to debug a baremetal application running on PS (ARM core) and to not loose sanity swapping SD cards, I also want to figure out how to use JTAG. The easy and expensive way of doing thisThe Digitlent JTAG cables are the official cables that are supported by Xilinx tools. If you want the minimum amount of fuss, get one of these. However, given that they are only glorified FTDI dongles programmed with configuration blessed by Xilinx, it makes me a bit mad spending $60 for one of these. The cheap and finnicky way of doing thisWhile I couldn't find a product that uses the exact design specified in FT232HL_v20.5.31.pdf, I suppose that most generic FTDI JTAG dongles are applicable here. If you have a FT232Hx, 2232Hx, etc. (basically any chip that has MPSSE) dongle with an onboard EEPROM, you can program it with a license to make it look like an official dongle. See the discussion below. The rest of the post discusses open source tools and methods to program the device. You can then use OpenOCD or xc3sprog to download the bitstream to the fpga (provided that you have boot mode pins set to JTAG - these are the same pins @xjtuecho suggests to change to get SDcard boot). There's a couple of gotchas however:
Then you have the Xilinx Virtual Cable (XVC). Instead of talking to the debug probe directly, the Xilinx tools talk to a XVC deamon over TCP/IP, which can run on your system or some other device, which is actually connected to your target
|
@tpecar thanks for the very detailed answer! This really helps people like me to get started and learning. Very appreciated! I think I might end up buying a cable from Digilent because it can also be used in the future with different boards. And I'm interested in the debugging support which is quite mandatory when doing anything more complicated. One thing I'm wondering. If I buy JTAG-HS3 instead of JTAG-HS2. HS3 has support for PS_SRST pin resetting the processor during debugging. Although I checked the schematics of this board and it seems this pin is not connected to JTAG header. I'm guessing if you want PS_SRST pin support then you'd need to modify the board. Here is good explanation of PS_SRST. |
Well, given that they sell both JTAG-HS2 and JTAG-HS3 for the same price, I guess you select the one that better fits your use case. HS2 supports 2-Wire JTAG, but since we already have standard JTAG routed out, this is a non-issue. HS3, as you mentioned, has an open drain output which the Xilinx tools can use for PS reset. The PS_SRST_B (B10 on CLG400 package) is routed out to R2430 (pullup to VCC) which is perfect - just run a bodge wire to the JTAG connector (pin 12, 14 of the connector seem to be disconnected). HS3 routes SRST on pin 14, so connect to that and should be plug & play |
Thanks you for you detailed answer! I'll order one and try it out. Sorry might be beginner question but what I understood that HS3 has open drain outputs, meaning that I have to connect it to VCC pull up like you said. So in this case I need to connect from the left side of the resistor to pin 14 like so. |
Yep, that should work. It obviously needs to be tested, and I probably have a good 2 months before I get the boards, so if you can try that earlier I'll appreciate your report. Once it gets tested, we can consider integrating it into the readme. |
Sounds good. I can test it but it might not be very soon because I'm not at home during Christmas holidays and getting that cable to Finland will take some time delivered. I'll report here when I've tested this. |
Just in case you didn't notice, Digilent has European distributors - you can get the cable at Farnell for example. |
Actually, you can download the bitstream over ethernet in u-boot. So no need to solder SD card slot or buy expensive JTAG downloaders. UART is still needed though. Set up a tftp server on host computer and in u-boot use command similar to this:
Bitstreams must be converted to bin files to run, use this tcl script:
Also, as this board's ethernet is connected to PL instead of PS, the ethernet connection will fail after downloading bitstream, which is quite annoying. So EMIO and the PS must be specially configured(even if not used) to keep net connection working after programming. Somewhat detailed instruction can be found in this article on my blog(at the end is the ethernet part): |
And about JTAG downloader, I did by one later. But of course not the expensive official one. I just picked a CJMCU FT232HL(the one with purple PCB, which is quite common) module and flashed the EEPROM. Similar to this: https://gist.github.com/rikka0w0/24b58b54473227502fa0334bbe75c3c1 The firmware between FT232 and FT2232 may be a little different so the gist may not work out-of-the-box, but I got it working at last. Only cost me 30RMB. |
Thank you @ustcpetergu for the info on downloading bitstreams over Ethernet. I suppose this uses the u-boot of the original miner firmware which is programmed on the flash chip. Regarding JTAG dongles, it is possible to flash the EEPROM of a generic dongle with Digilent firmware. This is against their license, which isn't that much of a problem in case of hobby / personal usage, but it might become important in other settings. Regarding FT232, correct me if I'm wrong, but I thought you required FT2232 due to MPSSE (which has JTAG capability), at least for interfacing with original Xilinx tools. Other unofficial tools which use FT232 do so by bit-banging the interface. |
Yes, this method uses the u-boot in on-board NAND(or NOR flash? not very sure). And as far as I know, FT232H works too. My Vivado detected my FT232H and successfully recognized the 7010 chip when ebaz4205 is connected. I haven't tried anything like bitstream downloading or ILA though(I trashed my board when trying to remove the BGA xc7z010 chip, so won't have any chance to test). But as better evidence, the 7010 board by Alinx does use FT232HL as their JTAG chip. I don't have this board but on their user guide, the schematic on page 12 shows so. One difference I know is that FT2232H is dual-channel so you can have JTAG and USB-to-UART together just using one USB cable, like on Digilent board ZYBO or PYNQ. FT232H is a single-channel one so another standalone USB-to-UART chip is required, in the Alinx case, CP2102 is used. |
Ok, thank you very much for the clarification! And you're right, FT232H (which is completely different from FT232R, so suffixes are important) has MPSSE. So, provided you configure its EEPROM (again, hobby/personal use only), it should work with Xilinx tools. I guess that this is the method that @xjtuecho has referenced initially, so we've come full circle 🤣 Thank you for also providing a concrete example. |
There are some good tutorials here: https://www.programmersought.com/article/78153940676/ https://www.programmersought.com/article/65574959208/ HDMI: https://www.programmersought.com/article/80046040945/ (shows pinout for DATA1-3) Bonus points if anyone actually manages to download and reupload anything from that CSDN site |
I feel your pain 😆 Most chinese forums have some sort of paywall, and some are downright impossible to register into. I'll take a look during the week if I can get access to some of the sites. |
This article is interesting: https://www.programmersought.com/article/63646026059/ I'm thinking a 2-way SPDT dip switch, attaching the resistor to the common pole. R2578 NAND -> R2585 JTAG This would let you switch between JTAG for Dev, SDCard and NAND without lots of re-soldering.
|
It seems I cannot test what I promised. At least not for now. I've been playing around with the board but I underestimated the amount work it involves. I'm still quite beginner with FPGA development and especially Xilinx tools. I managed to get buildroot linux image working. Then I tried very simple FPGA design to drive one of the pins high but couldn't get it to work for some reason by downloading the bitstream over JTAG. I even tried changing the resistor configuration to sd card and nand flash but no leds turn on or data port pins went high. In the end I also managed to break my board by breaking SD card slot -_-'. So at the moment I just felt giving up with this and invest on proper evaluation board with good documentation to get started. Hopefully someone else can test the reset pin functionality. Any recommendations or guides to Xilinx tools with some good FPGA board for beginners, thanks! |
I'm also a new FPGA player and it's true that this board is not beginner-friendly. |
And about boards... I think Digilent's boards are good, haven't used any evaluation board yet. Arty seems popular for pure FPGA and PYNQ for ZYNQ series. Though most of the time I do pure FPGA dev, I got a PYNQ for it's relatively cheap price and the abundant(85K) logic resources. |
For FPGA beginner,Sipeed Tang Nano with builtin programmer maybe a better choice. |
Yes, my suggestion's only valid if you want to use Vivado(our school teaches that), which is, actually not that good. |
@Kazhuu No problem, I'll see if I can test this. Regarding other development boards
Digilent / Trenz Electronic development boards are probably the most documented (but usually also the most expensive) Xilinx development bords. I'm not up to speed with other manufacturers, but it's probably a good idea that you check what Lattice, Intel/Altera have to offer. You should also check for boards that are supported by the yosys / SymbiFlow open source HDL synthesis tools - people usually target cheap boards there. |
What's the version of you KiCad? I can't open the KiCad project with latest KiCad 5.1.9-1 |
I'm using nightly build of KiCad (compiled from current git master), it's numbered as version 5.99. I've needed to use nightly because they have significantly improved the Altium PCB importer and they have switched to s-expr file format for eeschema, for which it was easier to write a schematic generation tool. If you're on Windows, CERN provides pre-built binaries (see bottom of page for latest version) For Linux it depends on the distribution - for Ubuntu/Debian, the instructions are provided on the KiCad page I'll add a README.md in the kicad folder describing this and will submit a new PR. |
@regymm Does the firmware need to be modified? can you share the binary? |
For FT2232 just follow the link. You can try this one(use xxd to reverse to binary) for FT232, and change the product_id and file name in the link-provided configuration file accordingly. Run
|
Thanks. |
I have a FT232 coming in the mail but to anyone that has a Raspberry Pi around: xvcpi was suuuuper easy to use. |
Yeah, RPi's neat. How long does it take to program ZYNQ 7010? I'd like to use RPi but seems on my side it takes more than half a minute and when using ILA to capture data it's very slow. |
@regymm The xvcpi code, built without changes, programs my board in about 20s. Lowering the clock delay as much as I could, I was able to get it down to about 8s. However, there seems to be a timing issue with the code which limits the minimum clock delay/maximum clock rate, after fixing that (I have a pull request open in the original repo) I was able to get the programming speed down to 3s after setting the clock delay to 0. |
Hello! I'm relative new to Xilinx FPGAs and ordered one of these boards. I'm wondering what is the best way to actually do some FPGA development on this board? I think I can put the bitstream file to SD card and let linux upload it to FPGA on boot but cannot find any information about this. Also someone on Reddit mentioned that you need JTAG FPGA programming cable from Xilinx. I guess this would be the best way to do the development? But the cable itself cost something like 80€ I think.
I've used Altera's development boards earlier which can be used with USB cable instead. Thank you!
The text was updated successfully, but these errors were encountered: