Embedded Design Handbook

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

6.5.3.2. Creating a Software Project Using Command Line

In this section, you create a simple Hello World project using command line. To create and build the hello_world example for modelsim simulation, perform the following steps:

  1. Open the Nios® II Command Shell.
  2. Change to the directory where you store your design generated by Platform Designer. The following steps refer to this directory as <projects>.
  3. The <projects> directory contains a subdirectories named software. Change the directory to this folder by using the command cd software.
  4. Create a folder named bsp in this folder by using the command mkdir bsp.
  5. Change your directory into this bsp folder using the command cd bsp and create the bsp using the command nios2-bsp hal . ../../<sopcinfo>.
  6. Change your directory into the app folder using the command cd ../app and create the app make file by using the command nios2-app-generate-makefile --bsp-dir ../bsp --app-dir . --src-dir .
  7. Compile the source code by using the command make all.
  8. Generate the memory file (.hex) by using the command make mem_init_generate.
  9. Now, you have successfully built the project. The next step is invoke the modelsim simulation using the command vsim &.