Specifications
chmod -R +w .r
The <projects> directory contains a subdirectory named software_examples/bsp. The bsp directory
contains several BSP example directories, such as hal_default. Select the directory containing an
appropriate BSP, and make it the current working directory.
For a description of the example BSPs, refer to “Nios II Design Example Scripts” in the Nios II Software
Build Tools Reference chapter of the Nios II Software Developer’s Handbook.
7. Create and build the BSP with the create-this-bsp script by typing the following command:
./create-this-bspr
Now you have a BSP, with which you can create and build an application.
Note: Altera recommends that you examine the contents of the create-this-bsp script. It is a helpful
example if you are creating your own script to build a BSP. create-this-bsp calls nios2-bsp with
a few command-line options to create a customized BSP, and then calls make to build the BSP.
Related Information
• Overview of Nios II Embedded Development on page 1-1
• Nios II Software Build Tools Reference on page 15-1
For a description of the example BSPs, refer to “Nios II Design Example Scripts” chapter.
• Getting Started from the Command Line on page 3-1
For details about the Nios II Command Shell.
Querying Settings
If you need to write a script that gets some information from the BSP settings file, use the nios2-bsp-
query-settings utility. To maintain compatibility with future releases of the Nios II EDS, avoid developing
your own code to parse the BSP settings file.
If you want to know the value of one or more settings, run nios2-bsp-query-settings with the appropriate
command-line options. This command sends the values of the settings you requested to stdout. Just
capture the output of stdout in some variable in your script when you call nios2-bsp-query-settings. By
default, the output of nios2-bsp-query-settings is an ordered list of all option values. Use the -show-
names option to display the name of the setting with its value.
For more information about the nios2-bsp-query-settings command-line options, refer to the Nios II
Software Build Tools Reference chapter of the Nios II Software Developer’s Handbook.
Related Information
Nios II Software Build Tools Reference on page 15-1
For more information about the nios2-bsp-query-settings command-line options.
Managing Device Drivers
The Nios II SBT creates an alt_sys_init.c file. By default, the SBT assumes that if a device is connected to
the Nios II processor, and a driver is available, the BSP must include the most recent version of the driver.
However, you might want to use a different version of the driver, or you might not want a driver at all (for
example, if your application accesses the device directly).
The SBT includes BSP Tcl commands to manage device drivers. With these commands you can control
which driver is used for each device. When the alt_sys_init.c file is generated, it is set up to initialize drivers
as you have requested.
4-16
Querying Settings
NII5V2
2015.05.14
Altera Corporation
Nios II Software Build Tools
Send Feedback