AN 985: Nios® V Processor Tutorial

ID 784468
Date 8/28/2025
Public
Document Table of Contents

3.2.2.2. Creating an Application Project Files

Application Project (app) provides the software application for Nios V/m processor system.
Follow these steps to create an Application Project Files:
  1. In <Working directory>/software/hal_app folder, create a C source code. Name it as helloworld.c.
  2. In helloworld.c, copy and paste the Hello World application code below.
    #include <stdio.h>
    #include <unistd.h>
    
    void looper() {
        for (int i = 0; i < 1000; ++i) {
         printf("Hello world, this is the Nios V/m cpu checking in %d...\n",i);
        }
    }
    
    int main() {
        looper();
        usleep(1000000);
        printf("Bye world!\n");
        fflush(stdout);
        return 0;
    }
    
  3. Launch the Nios® V Command Shell.
    $ niosv-shell
  4. Execute the command below to generate a BSP folder.
    $ niosv-app --bsp-dir=software/hal_bsp --app-dir=software/hal_app \
    --srcs=software/hal_app/helloworld.c --elf-name=helloworld.elf
    
Figure 125. Generated APP Files