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

NIOS II Tutorial Problems

Altera_Forum
Honored Contributor II
2,413 Views

Hi, I did some searching on my problem but could not track down an answer hence the need to post here, 

 

I have been working through the Nios II Hardware Development tutorial and have run into two snags. 

 

I am using Quartus II 10.1Sp1 and Nios II Eds 10.1 

 

On page 1-28 NiosII EDS the tutorial tells me to use the Create New NiosII Application and BSP from template option to create the source code. 

 

In the dialog box I enter the name 'count_binary', and select the template file 'count_binary' as instructed. However when I click finish, only the bsp project appears in the left hand column, not the actual count_binary application. 

 

If I inspect the design files folder, then a 'software' directory has been created and both the count_binary and count_binary_bsp directories have been created. I don't know why the 'count_binary' project is not being added automatically. 

 

To fix this problem I added the 'count_binary' application manually. 

 

When I then try to proceed with the tutorial by right clicking on the the count_binary application and selecting build project I get two errors: 

 

1)make:***[count_binary.elf] Error 1 count_binary line 0 

2)undefined reference to 'main' alt_main.c line 154 

 

I suspect that this might be related to the fact that the NiosII EDS did not correctly create the project in the first step, but I have not found much help on the situation. 

 

Hopefully someone here knows what might be going on. 

 

Thanks
0 Kudos
13 Replies
Altera_Forum
Honored Contributor II
810 Views

The first issue you described could be caused by the directory path of your project. I've seen the same issue and I believe in my case it was a directory naming issue. If that isn't the issue ensure the file permissions are set correctly for your project directory.

0 Kudos
Altera_Forum
Honored Contributor II
810 Views

Hi, 

 

I have the same problem!  

 

"In the dialog box I enter the name 'count_binary', and select the template file 'count_binary' as instructed. However when I click finish, only the bsp project appears in the left hand column, not the actual count_binary application." 

 

I can't import count_binary to the project. 

 

Anyone suggest what to do? Would be a license problem? 

 

best regards
0 Kudos
Altera_Forum
Honored Contributor II
810 Views

I also have this problem and I am sure that this is a limitation of the free edition. I have a full license for Quartus/Nios 9.0 and everything works fine. I also installed Web-edition 10.1 to play with Bemicro (waist of time and money). If I generate any template-based *.c file, like hello_world.c, it is not readable at all, probably encrypted. If I add my own file with the same name, I can not compile either, because of the errors like "undefined reference to 'main' alt_main.c". I've never seen such problems with fully licensed version.

0 Kudos
Altera_Forum
Honored Contributor II
810 Views

I didn't get add the folder count_binary to the project (it was created in a default directory by the SBT). 

 

I don't have a full license, too. 

 

And now, do you suggest me anything?
0 Kudos
Altera_Forum
Honored Contributor II
810 Views

I fixed my first problem, which also fixed the compilation errors as suspected, by doing this: 

I have a two drive laptop. My program files were on the C: drive and my design files were on the D: drive. 

I tried putting the design files on the C:drive in the Documents folder, instead of on the D: drive and now it seems to correctly generate both the projects in the NiosII IDE correctly. It also compiles without errors now too. So it does seem like it is some kind of naming issue. 

 

However now I have another problem. I download the .sof file to the FPGA from Quartus II, and when I build the project in the NIOS II system all is fine. However if I go to run the system as NiosII hardware I get the following message: 

 

[Target Connection]: No Nios II target connection paths were located. Check connections and that a Nios II .sof is downloaded. 

 

Searching the forums, I tried downloading the .elf file manually from the Nios Shell and it worked fine, no problems at all and the LEDs are counting along with the shell JTAG UART output. 

 

Any ideas why the interface is not detecting the connection? It does seem to find the connection when I bring up the System Console window. It would be much simpler to download using the interface than having to constantly switch to the shell.
0 Kudos
Altera_Forum
Honored Contributor II
810 Views

simono71, 

 

Are you testing your project with a full license or a free version of Quartus? 

 

Best Regards
0 Kudos
Altera_Forum
Honored Contributor II
810 Views

With the free version, so I have to leave the little confirm dialog running once I have downloaded the .sof file to the FPGA (which incidentally is the Altera cyclone II starter board that is basically equivalent to a DE1).

0 Kudos
Altera_Forum
Honored Contributor II
810 Views

I have a free version and it is happen with me, too. I'm using a DE2 (Cyclone II). I checked my laptop drives and put all archives (program files and project files) in D: drive. The error still happen. I will try execute the project with a full license. AFter of it I post the result and i'm waiting for news.

0 Kudos
Altera_Forum
Honored Contributor II
810 Views

Hi all, 

 

I also had the same problem in the starting.I dont know why it happens, but I could remove it in this way. 

 

Delete the .metadata folder created in your workspace and the software folder created in the folder of the sample project and try to do it again.It did that for 2 to 3 times and i could get both the count_binary and the bsp file in the proj explorer window. 

 

I think it happens because there is some problem in linking when we try to use the .sopcinfo file in the template. 

I dont think it has any license issues as I am also using the free web edition from the altera site. 

 

Also dont forget to run it as an admin / have full admin control rights while running the code. 

My files also got corrupted at a point when I could not open the count_binary files. 

 

I tried by deleting the previous files in the software folder and the metadata and it worked.I downloaded the elf file in my board and got results.
0 Kudos
Altera_Forum
Honored Contributor II
810 Views

Hi, 

 

So, I'm trying do that, but i think I'm commiting a bizarre error. When a try remove the .metadata folder from directory, the project archives don't appear in the current workspace on de SBT. 

 

If I am working with the SBT in the moment, it isn't possible remove the .metadata folder. If I close the SBT and remove the folder, when I open again, the files project won't appear there.
0 Kudos
Altera_Forum
Honored Contributor II
810 Views

SOLVED for Windows 7: you have to lauch NIOS II as administrator. Right click on the icon on the desktop and select "Run as administrator". 

 

I too was going nuts trying to everything as suggested above but couldn't get the non-bsp folder to appear in the project navigator. What tipped me off to the solution was reading throught the console messages. Even that was a trick since when the script is finished you don't get the full text that was flashing through the console. You have to click and select the right console messages. Reading through it showed creating the DE1_count_binary_bsp folder and files but when it went to create the DE1_count_binary folder, some sort of access denied message appeared and then the script finished. Hmmm, access denied sounds like a Windows 7 thing. Bingo.
0 Kudos
Altera_Forum
Honored Contributor II
810 Views

Hi all, 

 

All right, now!!! 

 

"Run as administrator" was the solution of this problem. I clicked in this option and the project has executed normally. Both folders (count_binary and count_binary_bsp) appears and the application runs. 

 

When I asked for the support about the license, he told me it was not necessary to the example. 

 

Thanks very much!!!
0 Kudos
Altera_Forum
Honored Contributor II
810 Views

HI, 

I am sorry for not being available.I got busy with other work. 

 

Yes one has to make sure that all the files you run have admin rights , in quartus or in sopc builder or in eclipse.When you in the IDE of eclipse you cannot delete the metadata.And once metadata is deleted you have to create new template and redo the whole proceedure. 

 

I hope it helps!!
0 Kudos
Reply