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

Nios II Advanced C/C++ project

Altera_Forum
Honored Contributor II
1,563 Views

Hello,  

I am new to this forum and new to NIOS II. 

I started with some simple application on the NIOS II using the Eclipse IDE. Everything worked fine so far. 

Now I tried to includee some shared sources from other projects and that's where the problem started. Normally the IDE will copy thesefiles in the project directory, but that's not what I want, because I only want to have one place for the source.  

So I have to start using the so called Advanced C/C++ Application. Now I have to generate my own makefile. 

But what are the basic rules ? 

Has anyone done it already ? Can anyone help me ? 

 

Thanks  

Reinhard
0 Kudos
7 Replies
Altera_Forum
Honored Contributor II
557 Views

Hello Reinhard, 

 

You can use resources which are located at other places than your project by adding more include paths (Project -> Properties -> C/C++ Build -> Include Paths). Now you can use the resources with an include statement (“#include xyz.h”). 

 

 

Bye, 

niosIIuser
0 Kudos
Altera_Forum
Honored Contributor II
557 Views

Hello niosIIuser, 

 

thanks for the response. This is ok for the header files but it does not work for source files. How can I add source files which are located somewhere ? 

 

Thanks  

Reinhard
0 Kudos
Altera_Forum
Honored Contributor II
557 Views

Use the Nios II IDE Help to search for "Managed Make Build Environment". 

This will give you an overview of how the Nios II GUI is the front-end to makefile driven 

build environment. Use this help and the existing makefiles as examples to guide you in creating your own makeifle.
0 Kudos
Altera_Forum
Honored Contributor II
557 Views

Hello Stephen, 

 

thanks for the info. This was exactly the guidance I was looking for .-)) 

 

Thanks 

Reinhard
0 Kudos
Altera_Forum
Honored Contributor II
557 Views

Reinhard, 

 

Did you get this working? I am running into similar problems. My project looks like this: 

 

-FPGA 

--Board1 

--Board2 

--Board3 

--Board4 

--Common 

 

Each Boardx is a separate and unique Nios 2 design. Each Boardx uses files from Common. Another problem is that some of the files in Common include "excalibur.h" (so now they include system.h) and obviously, "exclaibur.h" changes depending on which board I am building. Currently (Nios 1), I have a makefile to accomplish all of this. I was hoping that the management of all this would be easier in the IDE. But, it is a real pain in the butt. 

 

If any of the Altera guys are reading this, isn't there an easy way to do this without having to write more makefiles? How about linked resources? These sound like the correct thing to use but I keep getting "No such file or directory" errors. Any help would be greatly appreciated. 

 

Thanks 

 

dave
0 Kudos
Altera_Forum
Honored Contributor II
557 Views

Hi Dave, 

 

I got it working, but however , I spend some time to think why there is only the possibility to put thinks in subdirectories. The solution seems to be that you always work with CVS. Therefore you just have a working copy of "common" in each subdirectory. It is, even in this configuration, not the right structure but a way to do. 

 

Regards 

Reinhard
0 Kudos
Altera_Forum
Honored Contributor II
557 Views

There are some makefile examples in Nios software. 

 

They are very organized and, if you know (or learn) about makefiles, you will have no problems with it. 

 

I have the same cpu structure with various software projects, and the cpu directory structure is separated from the software. It works fine. 

 

Flavio 

 

PS: Is there any other Nios software development forum in internet?
0 Kudos
Reply