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

How to build applications for uClinux

Altera_Forum
Honored Contributor II
1,283 Views

- Using Altera NIOS II IDE 5.0. How to build applications for uClinux on Stratix II (EP2S60_ES). What are these steps ? 

 

- How about building without NIOS II IDE 5.0, use what tool ? 

 

- How to write own driver for uClinux on Stratix II (EP2S60_ES). ? 

 

- from the Microtronix's Distribution. How to re-compile the kernel for Stratix II (EP2S60_ES) ? 

 

 

Thank you all very much !
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
526 Views

- Using Altera NIOS II IDE 5.0. How to build applications for uClinux on Stratix II (EP2S60_ES). What are these steps ? 

 

A: Follow the Application Tasks section in the reference guide... 

 

- How about building without NIOS II IDE 5.0, use what tool ? 

 

A: After creating the initial Application Project, you can use the Nios II SDK Shell, 

 

cd $ECLIPSE_WORKSPACE/<project> 

 

and run make from there.  

 

- How to write own driver for uClinux on Stratix II (EP2S60_ES). ? 

 

A: Writing a driver for uClinux is the same as writing a driver for any Linux distribution, please take a look online for good documentation. It&#39;s there. 

 

The kernel source can be found through the Nios II SDK shell using the following command: 

 

cd $KERNEL_PLUGIN/linux-2.6.x 

 

- from the Microtronix&#39;s Distribution. How to re-compile the kernel for Stratix II (EP2S60_ES) ? 

 

A: If the Quick Start Guide doesn&#39;t answer that question then you&#39;ll need to be more specific. Are you using a different hardware design that you need to compile a kernel for?
0 Kudos
Altera_Forum
Honored Contributor II
526 Views

Dear Ken ! 

 

thank you very much for your answer ! 

 

Please help me this problem: 

 

We are using altera cyclone1c12 eval (using on-board Flash chip)...., NIOS IDE 5.0 

 

How to write a file When running a C application in uClinux ?  

 

fp=fopen(myfile,"r") works well but an error occurs when I use fp=fopen(myfile,"w") 

 

Please follow the link to see the images :  

 

problem image (http://img.photobucket.com/albums/v604/bebechance/problem.jpg

 

http://img.photobucket.com/albums/v604/bebechance/problem.jpg  

 

There are 2 possible problems for this error : 

 

1. linux_time_limited.sof doesn’t support writing file 

 

2. The program is running on sdram but the file (output_filename) is written to Flash. We already knew that we cannot write to Flash by C functions such as fprintf ,fwrite ,…. To do that , we must use some scripts : nios2-flash-programmer , …… 

Is this related to RO readonly.....?  

If it is the reason , then the uClinux FileSystem is useless. 

 

What do you think ?
0 Kudos
Altera_Forum
Honored Contributor II
526 Views

Hi OneNet, 

 

there is one more explanation to your problem, which seems to be the most possible : 

 

3. Your filesystem is readonly. If you want a r/w filesystem you can use ramfs (volatile, in ram) or jffs2 (non-volatile, in flash). If you use the default filesystem delivered with Microtronix distribution, you probably have some part of the system mounted as ramfs (/var and /tmp I think, check by executing mount without option to see what is mounted and where). You should try to create you r/w file in one of those directories, it should work. 

 

Hope it helps 

 

Pod
0 Kudos
Altera_Forum
Honored Contributor II
526 Views

Dear cetic ! 

 

I&#39;m trying your way. I could create a new folder in /var successfully.Hopefully, your answer is helpful for anyone who is having this problem. 

 

Thank you very much !
0 Kudos
Reply