NOTICE: The Processors Wiki will End-of-Life in December of 2020. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.
Rebuilding the NDK Core
Note: These instructions apply to NDK 2.20. To rebuild libraries for NDK 2.21 using Gmake, please refer to http://processors.wiki.ti.com/index.php/Rebuilding_The_NDK_Core_Using_Gmake
The Network Developer's Kit (NDK) core includes source files and a CCSv4 project that allow you to modify the stack sources and rebuild its libraries. You can rebuild the NDK core in order to modify, update, or add functionality. If you edit the NDK source code, an NDK project file, and/or an NDK RTSC build script, you must also rebuild the NDK core in order to create new libraries containing these modifications.
The instructions on this page are intended for rebuilding the NDK on Microsoft Windows using CCSv4. However, the NDK core libraries may also be re-built on Linux using the xdc command that comes packaged with XDCtools.
Warning: This appendix provides details about rebuilding the NDK stack source code. We strongly recommend that you copy the NDK installation to a directory with a different name and rebuild that copy, rather than rebuilding the original installation.
In order to rebuild the NDK core libraries, you must have already installed the following products. If you have installed CCSv4, both SYS/BIOS and XDCtools are installed as part of that installation.
- SYS/BIOS 6.x or DSP/BIOS 5.x
It is important to build the NDK with compatible versions of SYS/BIOS (or DSP/BIOS) and XDCtools. To find out which versions are compatible, see the "Validation" section of the Release Notes in the top-level directory of your NDK installation. You must build with the versions listed in the "Validation" section or later versions.
Prior to importing the NDK core build project, you must select the proper versions of SYS/BIOS. See Selecting Software Versions in CCSv4 for details on how to do this.
Preparing the Build Directory
Follow these steps to prepare to rebuild the NDK source code:
- Create a new directory on your computer. You will use this directory to store a copy of the NDK installation. This directory will act as a container for your NDK modifications. The full path to this directory cannot contain any spaces. For example, we recommend creating a directory called "
C:\myNdkBuilds" rather than using a location in the "My Documents" directory tree.
- Using Windows Explorer, copy the entire NDK installation to the directory you just created. For example, if you installed the NDK in the default installation location, then you should copy the
C:\Program Files\Texas Instruments\ndk_2_20_##_##folder and all of its contents to the
C:\myNdkBuildsfolder. After this step, the
C:\myNdkBuildsfolder should contain the
ndk_2_20_##_##folder, which is a copy of your NDK installation.
- Rename the folder that contains the copy of the NDK installation. For example, rename the
- Using Windows Explorer, move to the
- In this directory, find the file called "
config.bld.default". Rename this file to be "
- Open the
config.bldfile for text editing.
- Make sure that the paths to the SYS/BIOS (or DSP/BIOS) and Code Generation Tools are correct. For example, if you have installed SYS/BIOS 6.30 and wish to use this version with the default Code Gen Tools that came with your CCSv4 installation, set the variables "bios6Path" and "rootDir" as follows:
var bios6path = "D:/Program Files/Texas Instruments/bios_6_30_00_28/packages"; // location of Code Generation Tools var rootDir = "D:/Program\ Files/Texas\ Instruments/ccsv4/tools/compiler/c6000"
- Near the end of the file, look for the array called "Build.targets". This array contains the list of targets for which the NDK should be built. Make sure that the target for which you want the NDK built is uncommented. For example, if you want to build the NDK for the C64P target only, then your Build.targets array might look like this:
Build.targets = [ tiTargets.C64P, // tiTargets.C64P_big_endian, // tiTargets.C674, // tiTargets.C674_big_endian, // armElfTargets.Arm9, // armElfTargets.A8F, ];
- Save and exit the file.
Selecting Software Versions in CCSv4
In CCSv4, you must make sure that the proper versions of XDCtools, BIOS and NDK are selected before rebuilding the NDK. Do this by editing the CCSv4 global preferences as follows:
- In CCSv4, choose the Window > Preferences menu command.
- Go to the CCS > RTSC > Products category.
- Next to the "Tool discovery path" click the Add button.
- Navigate to the location of your custom copy of the NDK installation. For example, navigate to
- Click OK and you should see this path appear:
- Go to the CCS > RTSC category, and make sure that the proper versions of XDCtools, BIOS, and NDK are selected:
- Click OK to close the CCSv4 Preferences window.
Performing the Re-Build
Follow these steps to rebuild the NDK source code:
- Make sure that you are in the C/C++ perspective of CCSv4.
- Select the Project > Import Existing CCS/CCE Eclipse Project menu command.
- In the window that appears, choose "Select root directory", then click the Browse button.
- Find the location of your copy of the NDK. For example
- With the custom NDK directory selected, click OK. You should see a project titled "ndk_core_build" in the list of projects.
- Check the box next to "ndk_core_build" and make sure that there is no check next to "Copy projects into workspace" as shown in the next figure:
- Click Finish to import the project.
- Note: If you already have a project named "ndk_core_build" in your current workspace, then the project will not be imported. If this is the case, you should create a new workspace and repeat the steps in this section.
- Note: There is currently a bug which causes the NDK environment variable specified in the ndk_core_build project to not be resolved properly. This bug causes an error similar to the following when rebuilding the project:
Error launching builder (C:/Program Files/Texas Instruments/xdctools_3_21_00_27_eng/xdc all )
(Exec error:The directory name is invalid.)
- Click OK to save the project build options.
- Rebuild the project by selecting Project > Rebuild All.
Building Your Project Using the Rebuilt NDK Core Libraries for DSP/BIOS 5 Users
To build your DSP/BIOS 5 application using the version of NDK you have rebuilt, you must update the environment variable
%NDK_INSTALL_DIR% to point to the rebuilt version by following these steps:
- In your computerýs system settings, update the NDK_INSTALL_DIR environment variable to point to the location of your rebuilt NDK. For example, set it to:
NDK_INSTALL_DIR = C:\myNdkBuilds\custom_ndk_2_20_##-##
- Open CCSv4 and select the application project you want to rebuild. If CCSv4 was already open when you set the environment variable, you must close and restart CCSv4 in order for the environment variable change to take effect.
- Right-click on your project and choose Build Properties.
- In the C/C++ Build category of the Properties dialog, under C6000 Linker, choose File Search Path.
- If your project already references the NDK core libraries using the NDK_INSTALL_DIR environment variable, then you are finished and may rebuild your project using the re-built version of the NDK.
- If your project does not reference the NDK core libraries using the NDK_INSTALL_DIR environment variable, update the path to the NDK libraries so that they point to the versions you rebuilt in
- Once you have updated all paths, click OK.
- Rebuild your application.
Building Your Project Using Rebuilt NDK Core Libraries for SYS/BIOS 6 Users
To build your SYS/BIOS 6 application using the version of NDK you have rebuilt, you must point your project to this rebuilt version by following these steps:
- Open CCSv4 and select the application project you want to rebuild.
- Right-click on your project and choose Build Properties. If you have a RTSC configuration project that is separate from your application project, open the build properties for the configuration project.
- In the CCS Build category of the Properties dialog, choose the RTSC tab.
- Under the Products and Repositories tab, uncheck all the boxes for NDK. This ensures that no version is selected.
- Click the 'Add button next to the Products and Repositories tab.
- Choose Select repository from file-system, and browse to the "packages" directory of the location where you copied and rebuilt the NDK. For example, the location may be
- Click OK to apply these changes to the project.
- You may now rebuild your project using the re-built version of the NDK.