Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12453 Discussions

Error building a Nios2 project HEX file/On chip RAM

Altera_Forum
Honored Contributor II
774 Views

Dear all,  

 

I started a couple of day ago working on the tutorial SOPC builder with VHDL.  

The mini code as many of you know it already is:  

# define Switches (volatile char *) 0x0003000# define LEDs (char *) 0x0003010 

 

void main() 

while (1) 

*LEDs = *Switches; 

 

My system specification contains ON chip RAM with an initialized .hex file that I created it using SOPC builder. I did everything exactly as it shows in the walk-through but had this strange error when trying to build the nios2 project on SBT eclipse:  

make: *** [/home/mehdi/Documents/il2207/Lab1/onchip_memory2_0.hex] Error 2 

 

Does anyone have any idea about this? I would appreciate your help. Thanks!
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
95 Views

make is just reporting that an error occurred during compilation, the real error message is probably a bit further up.

Altera_Forum
Honored Contributor II
95 Views

This problem is freaking me out as none of my classmates could guess where the problem is coming from. Did I mention i am using ubuntu machine with the latest version of aletra tools. I did not change anything to default entries when setting the onchip ram with SOPC. How can i trace up the original error?

Altera_Forum
Honored Contributor II
95 Views

Problem Solved! 

 

It seems that there is a problem with everyone using Ubuntu newer versions. What I understood that this issue is related to the Linux shell. These two commands can make it work:  

 

sudo rm /bin/sh (to delete the old entry of linux shell) 

sudo ln -s /bin/bash /bin/sh (link to the actual one which is bash)
Altera_Forum
Honored Contributor II
95 Views

You really don't want to do that. 

You need to change the shell specified in /etc/passwd for your username. 

 

Separately it is worth sorting out whether the problem is that the script is non-portable (is using bash specific features), or whether the default /bin/sh in ubuntu is not complying to the posix rules.
Altera_Forum
Honored Contributor II
95 Views

Once you get that sorted out I would recommend making your code cache coherency safe. Using pointers will not bypass the data cache (if one is present) so your code will most likely keep writing the same value out to the LEDs no matter what button combination you push. The PIO comes with cache bypassing macros, you can find them in altera_avalon_pio_regs.h

Altera_Forum
Honored Contributor II
94 Views

Thanks BadOmen :-)

Reply