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++
12650 Discussions

Can I use the Nios II Eclipse S/W Debugger if I don't have the quartus project?

Altera_Forum
Honored Contributor II
1,440 Views

I have working Nios S/W and a .elf file (and my source code). And I have a working FPGA. 

 

The H/W designers developed the FPGA under Linux, in a completely different environment. 

I wrote my Nios S/W under Windows, using command line tools. 

I have a way to load and run my S/W and I can use the 12.1 Nios II System Console to communicate via JTAG. 

But up to now, I haven't needed to use the debugger (I relied on printfs). 

 

Is there a way to use the Nios debugger without a quartus project file? I can't see a way in the Nios Eclipse environment to simply attach to my running Nios code (other than at the lowest level, using the System Console to stop and examine registers via JTAG). Everything in the Eclipse environment wants me to start out with a project, which I don't have. 

 

Or failing that, exactly what quartus files do I need to locate to populate a project folder for this to work? 

Or failing that, is there a tutorial somewhere on how to set up gdb or ddd to use the JTAG connection, etc.?
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
363 Views

The direct GDB part is easy; see the nios2-gdb-server example in Chapter 4 of the "Embedded Design Handbook" (page 4-11 of the current PDF on the website). 

 

As far as eclipse goes, assuming you're using SDK generated makefiles for APP/BSP, I do something like this: 

- start eclipse with a blank workspace (no other projects in it) 

- File->Import->NIOS II ... -> Import custom makefile for NIOS...... 

- navigate to the BSP directory 

- give the new project a name name 

- finish the dialogs 

- repeat the Import... this time for the APP directory 

 

After that you can rebuild the software and download through the GUI. 

 

If you're not using NIOS SDK makefiles / normal build procedure, this wouldn't work.
0 Kudos
Altera_Forum
Honored Contributor II
363 Views

I used the first solution you suggested and was able to get gdb working with my code. 

Thanks!
0 Kudos
Reply