Hello,I am trying to boot the NIOS II from an .SOF file using memory initialization files (later, I want to boot from the .JIC file, which also doesn't work, but I want to start with this example because it's simpler). The problem I am having is that after downloading the .SOF file, not only does the NIOSII not run (I am expecting a blinking LED that I added to the firmware), I cannot even connect to the NIOS using the JTAG debugger: $ nios2-gdb-server --tcpport auto --reset-target Using cable "USB-Blaster [3-4]", device 1, instance 0x00 Resetting and pausing target processor: FAILED Leaving target processor paused $ I am using Quartus II 64-bit 15.0.0 on a Stratix V GX FPGA Development board, and I am using a Nios II/f with a TCM as instruction RAM and another TCM as data RAM. Connecting with nios2-gdb-server and running the firmware work correctly when I don't use memory initialization files. I have followed the following steps already: 1. Changed the reset and exception vectors to point to the instruction RAM 2. Generated HDL from Qsys 3. Copied the .sopcinfo file to my firmware build directory 4. Generated the hex files using mem_init_generate 5. Added the .qip file to my Quartus project 6. Generated my design. 7. Selected Processing->Update memory initialization file from within Quartus. Strangely, this didn't change the modification time on my .SOF file, so I ran "make asm" as well. 8. Downloaded the .SOF file 9. Connected with nios2-gdb-server and got the error message above Any help would be appreciated.
Can you use system-console to talk to the Nios? - Using system-console can help to see whether the system is in reset or not.Is the Nios reset output connected to Nios and its peripherals in Qsys? This is used during nios2-gdb-server --reset-target. You can try remove the --reset-target and just performed the nios2-gdb-server connection. Can you manually load the software after the sof file with memory initialization configured into the FPGA (If this works but direct nios2-gdb-server doesn't work will be weird)? Do you have external push button reset connected? Maybe you can try push the button and see.
I deinitely tried without --reset-target and using the push-button. I did not try manually loading the .sof file using memory initialization after this issue started occurring, not did I use system-console as I was not familiar with it.The workaround was to switch from TCM to a normal memory, which magically started working.
Proper way is to use EPCS controller in QSYS and boot using NiosII default bootloader (you would need that for larger code). In order to boot from on-chip RAM ( for very small code) you would need to edit your linker script from BSP Editor tool and set .text region point to that memory.