I program my FPGA (MAX 10) with a .sof file and works, but when I turn off my device everything erases from my FPGA. After exploration on the internet I found the EPCS IC, and I find out my board needs EPCS. But EPCS is not supported by the MAX 10, so I explored more deeply and I found out that MAX 10 has internal flash.

But I can't figure that how I can use internal flash for persistent programming?

  • 1
    \$\begingroup\$ MAX 10 FPGA Configuration User Guide. It looks like you need to generate a "POF" file instead of a "SOF" file in order to program the on-chip flash. \$\endgroup\$ – The Photon Sep 19 '16 at 1:37
  • 5
    \$\begingroup\$ I'm voting to close this question as off-topic because the answer can be found by the most basic search of the vendor's documentation. \$\endgroup\$ – The Photon Sep 19 '16 at 1:45
  • 2
    \$\begingroup\$ Eh, it seems lazy, but I can see how it would be really confusing for a total 'n00b'.. A lot of things that are 'obvious' about FPGAs are extremely confusing when you're starting out. They seem to live in their own little world of knowledge :/ \$\endgroup\$ – Daniel Sep 19 '16 at 2:18
  • \$\begingroup\$ @Daniel, yes but the answer should be "Look in this manual" and an explanation of the kind of information that you normally find in the Configuration User Guide for an FPGA. This site can't be a replacement for the documentation for a million different products. \$\endgroup\$ – The Photon Sep 19 '16 at 4:19

You'll need to set up Quartus to produce a POF file. You can either generate a POF directly or convert a SOF to a POF. This file can then be loaded into the flash memory. See page 37 of this document: https://www.altera.com/content/dam/altera-www/global/en_US/pdfs/literature/hb/max-10/ug_m10_config.pdf . Once you have generated the POF file, it can be written to the FPGA internal flash via the JTAG interface with a USB blaster cable.

There is a similar process for Xilinx FPGAs as well, where an MCS file is generated instead of (or from) a bit file. The reason this step is necessary is there's really only one way to program the FPGA directly, but there are several different ways of programming a flash chip. Now, usually it's just the data from the bit file loaded starting at address 0...but there are other options if required. For example, two different designs can be loaded into the flash chip at different offsets, enabling failed FPGA firmware upgrades to fall back onto a 'golden' boot image. Or multiple designs on the same flash chip targeting different FPGAs. Or multiple designs that can be swapped out on the fly (well, more or less). Or perhaps some extra data is required after the bit file, perhaps a boot image for a soft core that gets loaded into external DRAM.

| improve this answer | |
  • \$\begingroup\$ tnx buddy my problem solved you should program the fpga with .sof file after that we should use pof \$\endgroup\$ – Devil_HKH13 Sep 19 '16 at 6:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.