Building a BSP
When you have finished building the BSP, you will have a complete image that you can transfer from your host to your target system and boot into.
Overview
A BSP can be extracted to any directory and built there. The BSP is anchored in the directory you extract or copy it to. No matter where you move this directory, if you type make from inside the directory, the process pulls in everything it needs (aside from standard system headers) from the BSP's own directory, and everything that make builds is installed in the BSP's directory.
If you plan to work with multiple, different BSPs, we recommend that you create a top-level BSP directory, then create subdirectories for each different BSP. The directory you create for each BSP is that BSP's root directory.
After you have the QNX system up and running, you probably need to modify its configuration. For information about the buildfile, its syntax, and how to modify it, see the chapter OS Image Buildfiles.
The build process
- Copy the contents of the prebuilt directory into the install directory.
- Run mkifs with a modified search path, which prepares the IFS.
The install directory is the first directory mkifs searches when it looks for the components it needs to generate an IFS. If mkifs needs a component that it can't locate in the BSP directories, it scans the QNX SDP's /target directory for binaries or libraries, and uses the component it finds there.
The BSP build doesn't overwrite anything in your QNX SDP installation's /host or /target directories. Any binaries, libraries, or images that are generated by the build remain in the BSP directory from which they are extracted.
For more information, see the make and mkifs entries in the Utilities Reference.
Cleaning up the /images directory
After you have extracted the BSP, you may notice prebuilt IFS files in the BSP's /images directory (e.g., x86_64-nuc-graphics.bin and x86_64-generic.bin).
You must run make clean (command line) or Clean Project (IDE) to remove these files before you build the BSP.
Build the BSP (command line)
You can use the command line on Linux or Windows to work with a BSP.
- Download the BSP archive, and extract it (see
Extracting from the command line
). - Set the environment variables for the appropriate QNX SDP version:
- Windows: Run the
qnxsdp_ver-env.bat
script. - Linux: Source the
qnxsdp_ver-env.sh
script.
- Windows: Run the
In the BSP's root directory, type make clean to remove the default image files from the /images directory.
This action removes all default IFS images.
- In the BSP's root directory, type make. This command:
- Builds the BSP and creates its directories
- Places the IFS image in the /images directory
Note:We recommend that you use make to build the OS image. If you use mkifs directly, you need to use the -r option to tell mkifs where to find the binaries (see the mkifs reference in the Utilities Reference).
You can now prepare the IFS image that you will copy to your target.
Build the BSP (IDE)
- Launch the IDE, then import the BSP archive (which was downloaded for you using the QNX Software Center)
into the IDE (see
Import to the QNX Momentics IDE
section below for details). -
If necessary, switch to the C/C++ Perspective, then in the Project Explorer view, right-click the BSP source project and select Build Project.
This step builds the entire BSP, which includes the images and the binaries required for them. You can check the progress and outcome of your build in the Console view.
- If you want to modify the image, open the .build file under the System Builder Files folder. After you've made your changes, right-click the BSP source project and select Build Project.
Import to the QNX Momentics IDE
-
Open the QNX Momentics IDE.
-
From the C/C++ Perspective, select File > Import.
-
Expand the QNX folder.
-
Select QNX Source Package and BSP (archive) from the list and then click Next.
-
In the Select the package dialog, click Browse for ZIP Archive....
-
In the file selector, navigate to and select the BSP archive file that you downloaded earlier, and then click Open and then click Next.
-
Confirm the BSP package you want is shown in the Selected Package list and then click Next.
-
Optionally, set the Project Name and Location to import the BSP archive file. Defaults are provided for the project name and location, but you can override them if you choose.
-
Click Finish. The project is created and the source is imported from the archive.
You should see the project in the Project Explorer view (e.g., bsp-renesas-r-car-h3). You can now build your BSP.