FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
5275 Discussions

How to read from a Flash and write back to it with Nios Command Shell?


According to the ug_nios2_flash_programmer.pdf,

I have read the data(current.srec) from flash.

And  then I want to ​ write the current.srec  back to flash.

while the ug_nios2_flash_programmer.pdf says, when program a flash, I need a .flash file.

Is it necessary to convert the .srec file to .flash file?

if it is necessary, could you give me a sample(command)?

Or any other way to read from a Flash and write back to it?



①Commands of reading CFI flash memory

quartus_pgm --nios2 --base=0x200000 --read=current.srec \ --readbytes=0,0x10000

②Commands of Programming  CFI flash memory

quartus_pgm --nios2 --cable="Usb-blaster [USB-0]" --base=0x200000\ --program ext_flash.flash



0 Kudos
1 Reply
Hi, Which flash device you are using. Altera has many examples of how to read/write flash device. Plus which board you are using? Please use the following link to find the required example that's suites your board and flash. https://fpgacloud.intel.com/devstore/platform/?search=flash&category=2&acds_version=any The examples have the How-to-use document, which will help you to understand the how to use/recreate the project. Regards,