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

Compiling under uClinux

Altera_Forum
Honored Contributor II
2,422 Views

Hi, 

 

is that possible to compile source codes under uClinux itself, i.e is there a gcc version that run under uClinux? 

 

Warm Regards
0 Kudos
11 Replies
Altera_Forum
Honored Contributor II
952 Views

 

--- Quote Start ---  

originally posted by mfm@Apr 18 2006, 05:13 AM 

hi, 

 

is that possible to compile source codes under uclinux itself, i.e is there a gcc version that run under uclinux? 

 

warm regards 

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

--- quote end ---  

 

--- Quote End ---  

 

Maybe you can try Forth instead. It is tiny and fast. Good for embeded. 

http://www.cs.wisc.edu/~bolo/forth.html (http://www.cs.wisc.edu/~bolo/forth.html

uCforth 

http://www.cvs.cx/ucforth.php (http://www.cvs.cx/ucforth.php

 

There are ports of perl and python in uClinux-dist. 

I&#39;ve tried python, and it is running on nios2. 

 

If you still want gcc, you should read gcc.gnu.org .
0 Kudos
Altera_Forum
Honored Contributor II
952 Views

Hi hippo,  

thanks for your reply, 

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

--- Quote Start ---  

Maybe you can try Forth instead. It is tiny and fast. Good for embeded. 

http://www.cs.wisc.edu/~bolo/forth.html (http://www.cs.wisc.edu/~bolo/forth.html

uCforth 

http://www.cvs.cx/ucforth.php (http://www.cvs.cx/ucforth.php)[/b] 

--- Quote End ---  

 

I&#39;ve took a look and it&#39;s seemingly for ColdFire processor. 

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

--- Quote Start ---  

If you still want gcc, you should read gcc.gnu.org .[/b] 

--- Quote End ---  

 

Yes I want gcc cause as I see, the majority apps are to be compiled with. 

I read gcc.gnu.org and I can&#39;t say it&#39;s helping 

 

Warm Regards
0 Kudos
Altera_Forum
Honored Contributor II
952 Views

 

--- Quote Start ---  

originally posted by mfm@Apr 18 2006, 01:39 PM 

hi hippo,  

thanks for your reply, 

<div class='quotetop'>quote  

--- quote end ---  

 

--- quote start ---  

maybe you can try forth instead. it is tiny and fast. good for embeded. 

http://www.cs.wisc.edu/~bolo/forth.html (http://www.cs.wisc.edu/~bolo/forth.html

ucforth 

http://www.cvs.cx/ucforth.php (http://www.cvs.cx/ucforth.php) 

--- Quote End ---  

 

I&#39;ve took a look and it&#39;s seemingly for ColdFire processor. 

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

--- Quote Start ---  

If you still want gcc, you should read gcc.gnu.org .[/b] 

--- Quote End ---  

 

Yes I want gcc cause as I see, the majority apps are to be compiled with. 

I read gcc.gnu.org and I can&#39;t say it&#39;s helping 

 

Warm Regards 

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

[/b] 

--- Quote End ---  

 

Look in the porting/bootstrapping of gcc. 

But you should think twice. Though comiple C program on a nios2 is possible. You need to port a lot of tools before gcc build. It is not pratical with the limited speed and resource on nios2. Did you ever compile on a 66MHz 486 PC? 

 

The uCforth is for coldfire uClinux. It can be ported to Nios2. 

Forth had been used as firmware of Power Mac. 

 

Python is ready to run. Perl has some compile errors, but can be fixed. 

 

Why do you want to compile program on Nios2?  

Do you want to develop program without a PC host? 

Are you tired of downloading? u-boot,nfs,ftp,tftp,telnet are better solutions. 

Or just want to learn about gcc?
0 Kudos
Altera_Forum
Honored Contributor II
952 Views

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

--- Quote Start ---  

Did you ever compile on a 66MHz 486 PC?[/b] 

--- Quote End ---  

 

Well, that&#39;s a point I have not consider, you&#39;ve seen right! 

And talking about uCforth, is it possible to compile my old apps with ? 

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

--- Quote Start ---  

Forth had been used as firmware of Power Mac.[/b] 

--- Quote End ---  

 

?????????????????????????????????????????????????????? 

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

--- Quote Start ---  

Python is ready to run. Perl has some compile errors, but can be fixed.[/b] 

--- Quote End ---  

 

Sorry to ask, I&#39;m not a linux geek, but what have python and perl to do with compiling source code ? 

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

--- Quote Start ---  

Why do you want to compile program on Nios2?[/b] 

--- Quote End ---  

 

I want to avoid using cross compiler and emulator so I can avoid multiple errors in compilation, I want to let down the nios terminal too and communicate directly with the board via ssh and so I&#39;ll compile my apps under µClinux itself. 

My final goal will be to design my custom board and embed my system on(a webserver) so to be autonomous system. 

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

--- Quote Start ---  

Do you want to develop program without a PC host?[/b] 

--- Quote End ---  

 

How could that be done ! Is that possible? 

 

Warm Regards
0 Kudos
Altera_Forum
Honored Contributor II
952 Views

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

--- Quote Start ---  

<div class='quotetop'>QUOTE  

--- Quote End ---  

 

--- Quote Start ---  

Why do you want to compile program on Nios2?[/b] 

--- Quote End ---  

 

I want to avoid using cross compiler and emulator so I can avoid multiple errors in compilation, I want to let down the nios terminal too and communicate directly with the board via ssh and so I&#39;ll compile my apps under µClinux itself. 

My final goal will be to design my custom board and embed my system on(a webserver) so to be autonomous system.[/b] 

--- Quote End ---  

 

It is clear. You will compile on PC host and test your programs on nios2. 

Forget all about python,perl, and forth. Nor should you compile on nios2. 

 

If all the works are inside your lab, then you don&#39;t need ssh. It is easier and faster to use telnet. 

You can telnet your nios2 and get the files from your PC host via ftp. 

 

I don&#39;t use jtag download and terminal, too. ( I used them only to write the guide. ) 

It is much faster to use ftp or nfs. 

 

About compilation errors, you should find out where they come and resolve them. There is no big difference in the gcc itself, whether for i686 or nios2. Most problems used to be library and header. 

 

By the ways, did you get the buildroot toolchain running on Linux? 

You might develop and test your programs on PC linux first, and then port to nios2.
0 Kudos
Altera_Forum
Honored Contributor II
952 Views

Hi hippo, 

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

--- Quote Start ---  

I don&#39;t use jtag download and terminal, too. It is much faster to use ftp or nfs.[/b] 

--- Quote End ---  

 

How can you upload the kernel and the file system into flash memory without jtag, and without the terminal, how µClinux will start ? 

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

--- Quote Start ---  

By the ways, did you get the buildroot toolchain running on Linux[/b] 

--- Quote End ---  

 

Unfortunetly, NO. I get those errors all the time and I passed over 3 days trying to make it but no way! That was really disappointing especially I&#39;ve really loved working under Linux, there&#39;s really tons of things to learn about. 

 

Warm Regards
0 Kudos
Altera_Forum
Honored Contributor II
952 Views

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

--- Quote Start ---  

Hi hippo, 

<div class='quotetop'>QUOTE  

--- Quote End ---  

 

--- Quote Start ---  

I don&#39;t use jtag download and terminal, too. It is much faster to use ftp or nfs.[/b] 

--- Quote End ---  

 

How can you upload the kernel and the file system into flash memory without jtag, and without the terminal, how µClinux will start ?[/b] 

--- Quote End ---  

 

I wrote tools to download my custom boards. It was before jtag and IDE available. 

You can use u-boot and serial uart. Once setup, you don&#39;t need jtag. 

 

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

--- Quote Start ---  

<div class='quotetop'>QUOTE  

--- Quote End ---  

 

--- Quote Start ---  

By the ways, did you get the buildroot toolchain running on Linux[/b] 

--- Quote End ---  

 

Unfortunetly, NO. I get those errors all the time and I passed over 3 days trying to make it but no way! That was really disappointing especially I&#39;ve really loved working under Linux, there&#39;s really tons of things to learn about. 

[/b] 

--- Quote End ---  

 

You may try Slackware (which is old and stable), or other Linux distributions. You might find somethings you like.
0 Kudos
Altera_Forum
Honored Contributor II
952 Views

Hi hippo, 

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

--- Quote Start ---  

I wrote tools to download my custom boards. It was before jtag and IDE available.[/b] 

--- Quote End ---  

 

Could you please direct me where to find the way to do so, actually I wanna upload via Ethernet instead of using uart. 

 

Warm Regards
0 Kudos
Altera_Forum
Honored Contributor II
952 Views

 

--- Quote Start ---  

originally posted by mfm@Apr 19 2006, 02:11 PM 

hi hippo, 

<div class='quotetop'>quote  

--- quote end ---  

 

--- quote start ---  

i wrote tools to download my custom boards. it was before jtag and ide available. 

--- Quote End ---  

 

Could you please direct me where to find the way to do so, actually I wanna upload via Ethernet instead of using uart. 

 

Warm Regards 

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

[/b] 

--- Quote End ---  

 

You can use u-boot and tftp to download via Ethernet. 

 

http://forum.niosforum.com/forum/index.php?showtopic=3695 (http://forum.niosforum.com/forum/index.php?showtopic=3695

Both of them are experts of u-boot.
0 Kudos
Altera_Forum
Honored Contributor II
952 Views

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

--- Quote Start ---  

You can use u-boot and tftp to download via Ethernet.[/b] 

--- Quote End ---  

 

And if I won&#39;t use u-boot, I want to create my own tool for uploading via Ethernet, any suggestion ? 

 

Warm Regards
0 Kudos
Altera_Forum
Honored Contributor II
952 Views

 

--- Quote Start ---  

originally posted by mfm@Apr 19 2006, 12:11 AM 

<div class='quotetop'>quote  

--- quote end ---  

 

--- quote start ---  

you can use u-boot and tftp to download via ethernet. 

--- Quote End ---  

 

And if I won&#39;t use u-boot, I want to create my own tool for uploading via Ethernet, any suggestion ? 

 

Warm Regards 

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

[/b] 

--- Quote End ---  

 

 

I think you&#39;d only need U-boot (or redboot) if you wanted to upload a new kernel. If all you want to do is work with user space applications, I&#39;d recommend using NFS. 

 

Cheers, 

 

- slacker
0 Kudos
Reply