Forum Discussion
Altera_Forum
Honored Contributor
14 years ago --- Quote Start --- Hi Cris72, I have FPGA (on chip mem), a EPCS flash memory (I used to flash this memory in AS mode) and a SRAM on my prototype board. Is it possible for me use SRAM as a program memory and store the program in standalone mode ?? --- Quote End --- Sure you can! I sketch here the epcs programming procedure. Browse the Altera documentation or search the forum for detailed information. Say fpga.sof is your fpga configuration file and nios.elf the nios firmware. First of all open a Nios command shell session. Convert sof file into hex: sof2flash --epcs --input=fpga.sof --output=fpga.flash Convert elf file into hex and remap data just after fpga configuration elf2flash --epcs --after=fpga.flash --input=nios.elf --output=nios.flash Configure fpga, in order to be able to access epcs for programming nios2-configure-sof nios.sof Program epcs: nios2-flash-programmer --epcs --base=0x100000 fpga.flash nios2-flash-programmer --epcs --base=0x100000 nios.flash (Important: replace the fake address 0x100000 with your actual epcs base address, as defined in Qsys) That's all. The next time you power up the board, it will work standalone.:) --- Quote Start --- I want to use the board as a controller for a project. Please advice what memory i can use ? My string operations in NIOS code are taking up lot of memory so my on-chip mem is not sufficient !! --- Quote End --- You can use sram for program code, data, stack or any memory section you want. You select this in bsp properties. Please note that SRAM is far more slow than on-chip memory, because of longer access times and half data width (two cycles are required for every 32bit access). So you'd better place there only non-critical code and/or data not frequently accessed. This would be an issue only if your project has great performance requirements. Regards Cris