# How to read firmware from Altera's FPGA (Cyclone IV) with USB Blaster?

I'm starting to investigate Altera's Cyclone IV FPGA to use in my projects. Now I borrowed from neighboring company a real device with USB Baster Rev.C. I'd try to use one instead of evaluation board which I don't have for the moment.

Before I will put any code into the device I'd like to download original firmware to make me possible to return the device to it's initial state at any moment.

However after I connected USB Blaster to the device via JTAG and run Programmer I did not find any "Read" button (as I usually see on AVR programmers GUIs):

Brief search in Internet did not help.

EDIT 1

It looks like there are additional memories on the board:

I used to connect via X4 (pointed with a big red arrow).

• How is the device connected to it's flash chip? JTAG? Active Serial? Passive Serial? Parallel? – sbell Jun 8 '15 at 11:08
• @sbell please see my EDIT 1 for clarification. – Roman Matveev Jun 8 '15 at 12:29

To read the device configuration, you have to connect to X5 instead of X4 (as pointed out by @Simon Richter). Change your settings to match what is shown below:

Click "Start" to read the configuration. When it finishes, you can set a file name and then click "Save File" as below:

• Thank you for the answer! I don't have the device by me right know, but AFAIR when I connected USB-B to X5 it wasn't able to detect any device at all. I will try again more accurately on Wednesday and post a new comment! Thank you for your input again! – Roman Matveev Jun 8 '15 at 16:01
• Just make sure that you have the mode set as "Active Serial Programming", and that the device appears as "EPCS16" -- just like the images above show them – sbell Jun 8 '15 at 16:58
• You're awesome, guys! Thank you very much for the help! – Roman Matveev Jun 10 '15 at 8:31
• In which format does the "save file" option saves the Examine data. Is it .rpd or .sof or .pof or .hex or .jic? EPCS needs .rpd format right! – Sourabh Tapas Dec 7 '17 at 9:22
• It saves as a .pof file which works just fine for an EPCS. If you do need a different format though, you can save the .pof first and then convert it using File->"Convert Programming Files..." – sbell Dec 7 '17 at 20:31

There is no way to read back the current configuration.

If your development board is wired for JTAG mode, as it looks like from your screenshot, then simply writing a new configuration will update the FPGA only and leave the configuration flash alone, so a power cycle will reload the flash and everything is back to as it was before.

• This is something new for me as I assumed that modern microcontrollers (at least for last 10-15 years) has everything on a board: memory, IOs, timers and so on. So I assumed that Altera's FPGAs are the same. Please see my EDIT 1 for some clarification regarding your counter-questions. Thank you for your attention! – Roman Matveev Jun 8 '15 at 11:57
• The FPGA has the SRAM for the tables, but the contents for the tables are loaded from an external flash chip (EPCS...) . If you connect to the JTAG connection (as you do), you can update the SRAM, which is volatile. If you connect to the serial bus on X5, you can overwrite the flash and then reset the FPGA with the /CS and /CE pins. – Simon Richter Jun 8 '15 at 12:12