Similar to most of the FPGA devices available in the market today, the DE0-Nano also uses SRAM cells to store the configuration data it requires to operate correctly. Since SRAM is a volatile memory it will lose all the data once we power down the device. So whenever we power up the device it will read the configuration data from some other non-volatile memory element and reprogram the FPGA fabric.
DE0-Nano has a flash device named as EPCS64. It has 64Mbits capacity. This blog post will teach you how to program the EPCS64 flash device so that you can save your program in the chip indefinitely (theoretically).
- Generate the .sof file by compiling your program.
- Goto File > Convert Programming Files
- Under ‘output programming file’, select ‘JTAG indirect configuration file’ as the programming file type.’
- Select ‘EPCS64’ as the configuration device.
- Give a file name and path.
- Under ‘Input files to convert’ click on ‘Flash loader’.
- Then click on ‘Add device’ button at the right side of the window.
- Select ‘EP4CE22’ under ‘Cyclone IV E’ and click ‘ok’.
- Under ‘Input files to convert’ click on ‘SOF data’.
- Then click on ‘Add file’ button at the right side of the window.
- Select you generated ‘.sof’ file which is generally it is located in the ‘output_files’ folder.
- Finally click on generate button.
Now you need to program the device using that file. For that,
- Click on ‘Tools’ > ‘Programmer’
- Clear the already added files by selecting them and clicking on ‘Delete’ button at the left side of the window.
- Click on ‘Add file’
- Select the ‘.jic’ file you created.
- Click on the check box under ‘Program / Configure’.
- Click on ‘Start’
- Finally give your board a Hardware reset by removing the usb and connecting it back.
Now your EPCS64 is successfully configured and you can see that when you power up the device you no longer see the default program but you see your program in it.