This program is an example of a "free-standing" C application. A free-standing program "owns" the hardware, and cannot rely on system-services or device-drivers being initialized for hardware devices, device drivers and system services. This freestanding program has its entry point at alt_main, as such if you modify this example and try to call C library functions such as printf, they will not work unless you explicitly initialize the system.
This program simply shifts an 8-bit variable back and forth, writing the variables value to the system's LED PIO peripheral on every iteration.
Source code for example application
Create-this scripts for app and bsp
NOTE: If you are using Nios II EDS v7.2 or earlier then this design example is already contained in the example folder of your installation.
The following steps are for Nios II EDS v8.0 and later.
Download the zip file.
Copy the hardware example design for your board from the Nios II EDS installation (c:\altera\<version_number>\nios2eds\examples\<verilog or vhdl>) to your working directory.
Extract the contents of the zip file to the software application directory for the hardware project in your working directory. For example if you are using the standard verilog hardware design in the Nios II Development Kit, Cylcone II Edition, extract the zip file to \<work_directory>\niosII_cycloneII_2c35\standard\software_examples\app.