FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits
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.
5276 Discussions

run a c program using nios 2 command shell

Altera_Forum
Honored Contributor II
854 Views

Hi, 

 

I am trying to run a .c file from nios 2 command shell but not able to. I know how to run .elf using nios2-download -g hello_world.elf. I also know how to convert .c to .out using nios2-elf-gcc hello_world.c 

 

But how do i get a .elf from .out or .c, so that I can use nios2-download command to run?Or is there any other command like nios2-download specific to .out or .c? 

 

Thanks for the reply, 

Amjad
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
118 Views

I hope my question was clear. 

 

Let me rephrase. I would like to know how to run a .c file using only Nios 2 command shell prompt.. 

 

 

Thanks..
Altera_Forum
Honored Contributor II
118 Views

You can't just generate a binary file from a single source code, you need to link it with the C library and the drivers. 

The easiest way to do that is to write a makefile and use make. You can have a look at the makefile generated by the Nios SBT as an example.
Altera_Forum
Honored Contributor II
118 Views

Thank you for the information. I will try your suggestion...

Reply