Open bl0x opened 1 year ago
Connection of SPI flash chips (two!) to a CPLD, which should take care of relaying the signals and choosing between one or the other flash chip. Since flashing works from Impact, I assume that the CPLD does the right thing.
Connection of FPGA to CPLD:
How does one choose between SPI / QSPI?
My constraints file looks like this:
CONFIG VCCAUX = "2.5";
NET "sdi_dq0" LOC = AB17 | IOSTANDARD = LVCMOS33;
NET "sdo_dq1" LOC = Y17 | IOSTANDARD = LVCMOS33;
# NET "wpn_dq2" LOC = V13 | IOSTANDARD = LVCMOS33;
# NET "hldn_dq3" LOC = W13 | IOSTANDARD = LVCMOS33;
NET "csn" LOC = AB5 | IOSTANDARD = LVCMOS33;
NET "sck" LOC = W17 | IOSTANDARD = LVCMOS33;
When openFPGALoader reads a jedec_id = 0 or 0xff it's because it can't communicate with the flash (and something is wrong during second try it read 0xffffffff but doesn't stop immediately). subdirectory xc6 is a residual and must be removed.
In fact I have never tried to access/program external flash when the jtag chain contains more than one device. Your board is available to order somewhere? I have to find a way to create a complex jtag chain but, unfortunately all my xc6s have an onboard jtag interface...So it isn't possible to chain more than one FPGA
I've spent yesterday afternoon with @UweBonnes on this problem, and we've come to the conclusion that I need to look into the CPLD code to make sure that the CS for the flash chips is properly controlled by the FPGA and that there is no (additional) interference from the CPLD.
I have to find a way to reproduce your issue if you can't find by yourself. My first idea was an issue with spiOverJtag implementation when more than one FPGAs into the chain (it's the case for altera) but since you can't retrieve jedec id I'm not sure if it's your case (but maybe it also an issue you will discover after fixing current issue). Thanks for your feedback.
I'm currently having more strange issues with one particular board of this kind, behaving differently from the others. Also I'm trying to get the original source code for the cpld, since that also drives the CS signals for the flash.
Would any changes be necessary to talk to this particular model of flash chip, or have you used one of these before?
Also, let me ask again: how does one differentiate between SPI and QSPI mode? I don't see anything related to that in the spiOverJtag code.
There's a second connector on board (not accessible from outside) as well that let's me connect to the chain in a slightly different way and I haven't tried that one yet with openFPGAloader. Will try soon.
As far I remember I have never used this specific chip and since it's marked as obsolete and not available I can't order one. I have to read datasheet to see if it's differs to ones already supported. for SPI vs QSPI: spiOverJtag support SPI: it's because all eeprom supports this mode and to have something at much as possible generic I have implemented this gateware using common mode (sometime only MISO and MOSI are connected). I'm agree it's slower than QSPI but it's the only mode sure to be available.
Ah, I see, so it is always SPI, even if some FPGA constraints also set d2, d3. These are then only used as wpn holdn?
Yes. D2 & D3 are only used as data when chip is configured for non SPI mode. spiFlash class uses only SPI instructions to be ""universal"".
The chip appears to be in stock (octopart). Datasheet is here.
I've spent another night trying to get this to work, to no avail. I'll still make a pull request with the development so far. I've also had a look in the xilinx, spi and jtag code and could not find any obvious problem. I could possibly put a logic analyser on the JTAG chain to see what Impact does differently, unless the spiOverJtag bitfile is already wrong.
Does the spiOverJtag work fine for other Spartan6 chips / boards?
One thing I noticed is that there is no STARTUP_SPARTAN6 primitive instantiated. It is however different from e.g. STARTUPE2 for series 7 devices, so may not be needed at all.
Thanks for the link: I will order a couple (not easy to solder without correct tools...) and have a closer look to the datasheet. Yes spiOverJtag works with others boards based on spartan6: I used my pipistrello successfully and dumped and rewrite flash for SPEC150. I will try with boards I have at home to create a complex Jtag chain to see spiOverJtag behaviour is this situation...
Sorry for the delay. I have received a board based on xc6slx16ftg256: flash is correctly detected. I have tried using octopart to order a couple of this chip: for most of store a request for quotation is required (and I have never received an answer: maybe because I have asked for a too few volume), one store allows a direct order (but with a price > 100$ for 2 component it seems a bit expensive).
One thing not really clear after re-reading the excerpt of schematic: CS seems driven by the CPLD and not connected to the FPGA.
My brain sometime is slow: spi flash for the board I have received is a M25P16: more or less the same chip but small than your...
openFPGAloader built from fresh git.
FPGA: Xilinx xc6slx150tcsg484 Flash chip: M25P128-VME6GB SPI wires: 1
Flashing from Xilinx Impact works without a problem (using generated .mcs file).
I've compiled a new spiOverJtag bitfile for the FPGA model, with pinout according to the datasheet. I'll add a copy of the relevant schematics of the device in a later comment.
This is the verbose output:
When running from Impact, it uses the bundled SPI Jtag core:
/opt/Xilinx/14.7/ISE_DS/ISE/spartan6/data/xc6slx150t_spi.cor
I've zipped it up and disguised it for openFPGALoader by giving it the appropriate name/path and tried again:
This gives some values, but I don't think that they make any sense. What do you say, is this method even supported?
I've also noticed the
spiOverJtag/xc6
directory. What is the purpose of that? Just a reimplementation in VHDL? I've also tried to produce a spiOverJtag bitfile from that directory (with appropriate device parameters), but same as above.It would be really nice to get this working!