Altera_Forum
Honored Contributor
10 years agoNios Boot up from EPCS
I am having trouble booting up my Nios C code from EPCS. I am building my own FPGA board, not using a demo board. Here are the steps I am following:
1) In Qsys define nios ii reset vector to epcs_flash_controller with 0 offset. define expection vector as on chip ram. 2) generate SOF file in Quartus 3) generate ELF file in NIOS IDE 4) generate hw.flash and sw.flash files using Nios Flash programmer GUI 5) convert my sw.flash into sw.hex in NIOS terminal using the following command: nios2-elf-objcopy --input-target srec --output-target ihex "sw.flash" "sw.hex" 6) Using Convert Progamming Files in Quartus I create a pof file: 6a) Select EPCS128 (that is the flash chip i'm using) 6b) Advanced > Disable EPCS ID check 6c) Add SOF Page -> Page 0 -> Properties -> Address mode for selected pages: Set to START and Start Address = 0x0 6d) Add file to SOF page: Add hw.sof 6e) Properties of hw.sof select Compression 6f) Add HEX data 6g) Add File -> sw.hex 6h) Use Relative addressing offset 0x1. If I use Absolute my hex and sof files overlap. Right now, the hex file should follow the sof file in the flash addresses 7) Generate POF file -> NO issues. 8) Program EPCS device using Active Serial Programming. Add my POF file. Programming succesful. 9) Power cycle my board. The hardware file starts, but the NIOS never boots? So what is going wrong? I am programming using the USB Blaster that Altera sells. I am also not going through JTAG. I am first programming the EPCS chip. Then turning off power and disconnecting the programming cable. Then I repower the board. As# 9 says, the hardware file starts but my NIOS doesn't seem to run the sw.hex code. Any ideas? Thanks -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- More info: I tried programming via JTAG cable like one would normally do on a demo board. 1) Upload SOF to FPGA 2) Upload ELF in NIOS IDE via Run Configurations In this case the NIOS code works as expected. Then I tried using the Flash Programmer to write the hw.flash and sw.flash files to the EPCS via the JTAG chain. In the GUI I got no errors. Code supposedly uploaded to the flash chip with out issues. Upon re-powering up, I expect the FPGA to be configured from the EPCS device. Just like before, the NIOS never boots. So clearly there is some issue with the FPGA bootloader and how it interprets the sw.hex or sw.flash file on the EPCS flash chip....