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++
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Linux development environment

Altera_Forum
Honored Contributor II
3,037 Views

Does anyone know if the Nios II port of uClinux is available as a simple tarball (i.e. tar.gz or .tgz) that can be downloaded to a Linux machine and configured and built using the nios2-elf-gcc cross compiler? 

 

I am actively attempting to rebuild the nios2-gnutools on my Linux box so I can develop the kernel and user applications on it. I will post the results if I am successful. However, if someone has already accomplished this I would be very interested in getting the source.
0 Kudos
26 Replies
Altera_Forum
Honored Contributor II
232 Views

Now it sounds more like the procedure you created the elf file. Can you tell me how you made cpuload.elf? Which linker script are you using? 

 

Regards, 

wentao 

microtronix
0 Kudos
Altera_Forum
Honored Contributor II
232 Views

SUCCESS!!! 

 

I previously diff'd the two different linker scripts elf2flt.ld and nios2-elf2flt.ld and didn't notice a difference. 

One of them is a default script that is provided as part of the elf2flt src. The other one I copied from the scripts location in my Windows cygwin environment. 

 

The cygwin version made it all work. 

 

I believe I now have a basic set of development on my Linux machine that will allow me to more quickly develop, compile, build, and track uClinux and applications. 

 

I would like to thank everyone for their help and patience. 

 

For reference, Below I have provided a summarized list of the tasks I performed in order to get a working development environment under Linux. 

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

Setting up Nios II Linux Development Environment 

 

Windows Machine with NIOS II IDE and Linux Plugin installed 

 

1. Setup 

a. Make sure proper PATHs are set and ENVironment variable are set. 

 

2. Toolchain 

  a. Create a tarball of c:/altera/kits/nios2/bin/nios2-gnutools directory. 

  b. Unarchive this tarball onto a Linux machine and use the following scripts: 

      i. stripcr.sh 

      ii. binutils_build.sh 

      iii. gcc_build.sh  

      iv. make_build.sh 

      v. newlib_build.sh 

      vi. gcc_build.sh 

 

3. Elf2flt conversion tool (required by uClinux) 

a. Create a tarball of the c:/altera/kits/nios2/examples/software/Linux/utils/elf2flt directory. 

b. Unarchive this tarball onto a Linux machine and cross compile with nios2-elf-gcc. 

 

4. uClibc (small c library) 

a. Create a tarball of the c:/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.uClibc_0.1.0/uClibc/ directory. 

b. Unarchive this tarball onto a Linux machine and cross compile with nios2-elf-gcc. 

 

5. uClinux 2.6.x 

a. Create a tarball of the c:/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_0.1.5/Linux-2.6.x/ directory. 

b. Make a dummy Linux kernel project build.  This will create a nios2_system.h file.  This file must be copied to the Linux machine in the Linux-2.6.x/include/ directory.  Anytime there is a hardware change, this file must be recopied to guarantee compatibility. 

c. Unarchive this tarball onto a Linux machine. and cross compile with nios2-elf-gcc.[/b] 

--- Quote End ---  

0 Kudos
Altera_Forum
Honored Contributor II
232 Views

Congratulations, trk_golf. And thanks for your sharing of your experiences. 

 

 

There is a typo in your note regarding building of elf2flt: it should be built with native gcc instead of nios2-elf-gcc.
0 Kudos
Altera_Forum
Honored Contributor II
232 Views

You are correct. Thanks for catching that.

0 Kudos
Altera_Forum
Honored Contributor II
232 Views

I found a nios2-linux-uclibc-elf2flt program in the /opt/nios2/bin/ directory that the nios2gcc.tar.bz2 file contains. I tried that and it gives the same error. Maybe it is some option we are missing.

0 Kudos
Altera_Forum
Honored Contributor II
232 Views

 

--- Quote Start ---  

originally posted by cfavreau@Jul 7 2006, 10:07 PM 

i found a nios2-linux-uclibc-elf2flt program in the /opt/nios2/bin/ directory that the nios2gcc.tar.bz2 file contains.  i tried that and it gives the same error.  maybe it is some option we are missing. 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=16712) 

--- quote end ---  

 

--- Quote End ---  

 

What is your error messages? 

Please follow the wiki, 

http://nioswiki.jot.com/wikihome/operating...ux/compilehello (http://nioswiki.jot.com/wikihome/operatingsystems/%c2%b5clinux/compilehello)
0 Kudos
Reply