Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Booting NIOSII from .sof File

Altera_Forum
Honored Contributor II
1,451 Views

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.
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
663 Views

seems like your NIOS is not running! 

Have you tried to load the software manually via JTAG? 

 

It seems to me like the NIOS is in reset.
0 Kudos
Altera_Forum
Honored Contributor II
663 Views

Yes, I loaded the software manually via JTAG and it worked fine. 

 

If the NIOS is simply in reset, then why can't I connect with the debugger?
0 Kudos
Altera_Forum
Honored Contributor II
663 Views

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.
0 Kudos
Altera_Forum
Honored Contributor II
663 Views

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.
0 Kudos
Altera_Forum
Honored Contributor II
663 Views

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.

0 Kudos
Reply