sinara-hw / Sayma_AMC

AMC FPGA carrier board with FMC, dual SFP and RTM
8 stars 6 forks source link

Flash memory #126

Closed marmeladapk closed 5 years ago

marmeladapk commented 5 years ago

I have a problem with booting up the FPGA from flash. I can program the flash just fine (w/ verification) in Vivado, however the FPGA just won't boot from it.

gkasprow commented 5 years ago

a few ideas:

marmeladapk commented 5 years ago

Ha! I found it! TL;DR: Removing C511 or R253 helps.

We had quite a few red herrings, that's why it took so long to debug it.

We had a proper openMMC config with which the FPGA did not program. However it reacted properly to program_b and init_b signals, started SPI communication and issued correct commands (and memory responded to them). Clock looked correct, though with some smooth falling edges. Data had some pretty high overshoots.

We also had an incorrect MMC config, which (by accident) turned high program_b and reset_n before all voltages were stable. The FPGA then programmed correctly, however all SPI levels were around 2,5V, everything else was the same. It didn't program again when we pulsed program_b. It seems that program_b and reset_n powered 3V3 rail for around 100ms and it caused something to happen which caused lower voltages on SPI (probably some parasitic diode or something).

It turns out that the culprit was crosstalk + high overshoots on data + slow falling edge on clk. For example in this event: tek00005 most probably there was an additional clock cycle registered (1-clock, 2,3-mosi, miso, 4-cs). With smaller voltages on SPI bus (with incorrect config) clock returned more quickly below threshold and crosstalk was less dramatic bc. of smaller rising edge.

With C511 removed: tek00006 FPGA programs correctly on both Saymas.

But removing C511 only masks the real problem which are high over- and undershoots (>1 V!) and high crosstalk. in UG570 Xilinx reccomends series resistors to minimalize overshoots. Crosstalk is also pretty bad, QSPI lines travel sometimes for centimeters separated only with minimal gap. They also have much lower rise time than I expected (5 ns).

So overall if we plan to do 2.1 we should simulate and insert those series resistors and space QSPI lines. @gkasprow what do you think?

gkasprow commented 5 years ago

True, The clock line should b routed away from the data line. I overlooked this. Series termination on FLASH side won't harm. In Sayma v1.0 there was no length matching and the clock line was separated from data. I asked you to remove C511 already a few posts above :)

marmeladapk commented 5 years ago

Yes, however there other issues which seemed more probable which I tested first.

jordens commented 5 years ago

Nice!

jbqubit commented 5 years ago

Nice find! I made a v2.1 milestone and tagged the issues made by @marmeladapk.

marmeladapk commented 5 years ago

DNPed R253 until #129 is implemented.