Nios® II Software Developer Handbook

ID 683525
Date 8/28/2023
Public
Document Table of Contents

16.2. Nios® II Design Example Scripts

The Nios® II SBT includes commands that allow you to create sample BSPs and applications. In this example, nios2-swexample-create is used to create the create_helloworld.sh script.

create_helloworld.sh

# Define user definitions

PROJECT_NAME=test
SAMPLE_TYPE=hello_world_small
SOPCINFO_DIR=./Bemicro_nios_v2_sample
SOPCINFO_FILE=qsys.sopcinfo
CPU_NAME=CPU

# Define internal symbols

BSP_STR=_bsp
APP_NAME=$PROJECT_NAME
BSP_NAME=$PROJECT_NAME$BSP_STR
APP_DIR=$SOPCINFO_DIR/software/$APP_NAME
BSP_DIR=$SOPCINFO_DIR/software/$BSP_NAME

# Create create-this-app and create-this-bsp script

nios2-swexample-create --name=$PROJECT_NAME \
		       --type=$SAMPLE_TYPE  \
		       --sopc-file=$SOPCINFO_DIR/$SOPCINFO_FILE \
                       --app-dir=$APP_DIR \
                       --bsp-dir=$BSP_DIR

# Build BSP and Application

cd $APP_DIR
./create-this-app