Specifications
5. Next to Library name, click Add and type the library project name you selected when you created
your user library.
6. Click OK.
7. Build your application.
As this example shows, the .c source files are not required to build the application project. To hand off the
library to another engineer or organization for reuse, you provide the following files:
• Nios II library archive file (.a)
• Software header files (.h)
Related Information
Creating a Project on page 2-2
Creating a Software Package
This section shows how you can build a custom library into a BSP as a software package. The software
package can be linked to any BSP through the BSP Editor.
This section contains an example illustrating the steps necessary to include any software package into a
Nios II BSP.
To create and exercise the example software package, perform the following steps:
1. Locate the ip directory in your Altera Complete Design Suite installation. For example, if the Altera
Complete Design Suite version 14.1 is installed on the Windows operating system, the directory might
be c:\altera\14.1\ip. Under the ip directory, create a directory for the software package. For simplicity,
this section refers to this directory as <example package>.
2. In <example package>, create a subdirectory named EXAMPLE_SW_PACKAGE. In <example package>/
EXAMPLE_SW_PACKAGE, create two subdirectories named inc and lib.
3. In <example package>/EXAMPLE_SW_PACKAGE/inc, create a new header file named example_sw_package.h
containing the following code:
/* Example Software Package */
void example_sw_package(void);
4. In <example package>/EXAMPLE_SW_PACKAGE/lib, create a new C source file named example_sw_package.c
containing the following code:
/* Example Software Package */
#include <stdio.h>
#include "..\inc\example_sw_package.h"
void example_sw_package(void)
{
printf ("Example Software Package. \n");
}
5. In <example package>, create a new Tcl script file named example_sw_package_sw.tcl containing the
following code:
2-26
Creating a Software Package
NII5V2
2015.05.14
Altera Corporation
Getting Started with the Graphical User Interface
Send Feedback