Nios® II Software Developer Handbook

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

3.13.7. Running Shell Scripts from the SBT for Eclipse

Many SBT utilities are implemented as shell scripts. You can use Eclipse external tools configurations to run shell scripts. However, you must ensure that the shell environment is set up correctly.

To run shell scripts from the SBT for Eclipse, execute the following steps:

  1. Start the Nios® II Command Shell.
  2. Start the Nios® II SBT for Eclipse by typing the following command:
    eclipse-nios2

    You must start the SBT for Eclipse from the command line in both the Linux and Windows operating systems, to set up the correct shell environment.

  3. From the Eclipse Run menu, select to External Tools > External Tools Configurations.
  4. Create a new tools configuration, or open an existing tools configuration.
  5. On the Main tab, set Location and Argument.
    Table 6.  Location and Argument to Run Shell Script from Eclipse
    Platform Location Argument
    Windows ${env_var:QUARTUS_ROOTDIR}\bin\cygwin\bin\sh.exe -c " <script name> <script args>"
    Linux ${env_var:SOPC_KIT_NIOS2}/bin/ <script name> <script args>
    Table 7.  Location and Argument Values Used to Run elf2hex --help from Eclipse
    Platform Location Argument
    Windows ${env_var:QUARTUS_ROOTDIR}\bin\cygwin\bin\sh.exe -c "elf2hex --help"
    Linux ${env_var:SOPC_KIT_NIOS2}/bin/elf2hex --help
  6. On the Build tab, ensure that Build before launch and its related options are set appropriately.

    By default, a new tools configuration builds all projects in your workspace before executing the command. This might not be the desired behavior.

  7. Click Run. The command executes in the Nios® II Command Shell, and the command output appears in the Eclipse Console tab.