NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. 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.
GSG: Rebuilding the Software
^ Up to main OMAP35x Graphics SDK Getting Started Guide Table of Contents
This chapter describes to how rebuild various components within the OMAP35x Graphics SDK package
Contents
Setting up the NFS target file system[edit]
Perform the following steps to build and export the NFS target file system.
- Log in with a user account on the host Linux workstation. (In the following steps, we refer to the home user directory as "~".)
- Perform the following commands to prepare a location for the OMAP35x EVM target file system.
host $ cd ~ host $ mkdir -p workdir/filesys host $ cd workdir/filesys
- Switch user to "root" on the host Linux workstation.
host $ su password:
There will be a prompt for entering the password as shown above. Type the root password, for getting the root permissions
- Copy the OMAP35x PSP SDK NFS target file system from /home/<useracct>/OMAP35x-PSP-SDK-##.##.##.##/images/fs/nfs.tar.gz to a new directory created in step 2. Perform the following commands.
NOTE:Un-tar the file with root permissions. (Step 3)
$ cp /home/<user_account>/OMAP35x-PSP-SDK-##.##.##.##/images/fs/nfs.tar.gz . $ tar –xvzf nfs.tar.gz .
- Perform the following command to make sure you can write into the target file system that you want to export as NFS, from your user account.
host $ chown -R <user_account> /home/<user_account>/workdir/filesys/. host $ chmod -R 755 /home/<user_account>/workdir/filesys/.
- Make sure the NFS server is configured and functioning properly. Add the following line to the /etc/exports file of the server. Ensure you have root permission before editing this file.
/home/<user_account>/workdir/filesys (rw,insecure,sync,no_wdelay,no_root_squash)
- Then issue the following command to notify the NFS server about the new exported directory.
host $ /usr/sbin/exportfs –a host $ /sbin/service nfs restart
- Make sure you exit from having the root permissions after completing all the above steps
host $ exit
- Perform steps 1 to 3 as mentioned in Building the OMAP35x Graphics Demo Software. Make sure to set the TARGETFS_INSTALL_DIR to point to the NFS target file system folder (/home/<user_account>/workdir/filesys) as created in this section, in the Rules.make file
- The ‘make install’ will install all the necessary libraries and executables required for running the Graphics SDK demos as well as application development using the graphics drivers.
Rebuilding u-boot and Linux Kernel[edit]
Ensure that the toolchain setup and install has been completed as mentioned in OMAP35x Graphics SDK GSG: Installing the Toolchain
Refer OMAP35x DVEVM Getting Started Guide: Rebuilding_U-boot for rebuilding u-boot
Refer OMAP35x DVEVM Getting Started Guide: Rebuilding the Linux Kernel for rebuilding the linux kernel
NOTE: Use arm-2007q3-51 version for building all the components
Building the OMAP35x Graphics Demo Software[edit]
This section describes how to rebuild OMAP35x Graphics SDK demos.
Pre-Requisites:
- Ensure that toolchain installation is complete
- Ensure that the NFS target is setup
- Ensure that the setup and build for u-boot is complete
- Ensure that the setup and build for Linux Kernel is complete
Refer here for more information to perform the above steps
To rebuild the OMAP35x Graphics SDK demos, perform the following steps.
- Change the directory to ~/OMAP35x_Graphics_SDK_#_##_##_##.
- Edit the ~/OMAP35x_Graphics_SDK_#_##_##_##/Rules.make file.
- Set GRAPHICS_INSTALL_DIR to the top-level OMAP35x graphics installation directory as follows
HOME=/home/<user_account> GRAPHICS_INSTALL_DIR=${HOME}/OMAP35x_Graphics_SDK_#_##_##_##
- Set the toolchain installation directory path to where you have installed the CodeSourcery tool-chain
CSTOOL_DIR = <your_toochain_installation_path> For example, in our case CSTOOL_DIR = /home/<user_account>/toolchain/arm-2007q3
- Set the kernel installation directory path
KERNEL_INSTALL_DIR = <your_kernel_installation_directory_path> For example, in our case KERNEL_INSTALL_DIR = /home/<user_account>/workdir/opt/linux-##.##.##.##
- Modify the TARGETFS_INSTALL_DIR to point to the correct location where the user’s target file system resides
TARGETFS_INSTALL_DIR=/home/<user_account>/workdir/filesys
- While in the same directory that contains Rules.make, use the following commands to build the OMAP35x Graphics SDK demo applications
The top level Graphics SDK Makefile supports the OMAP35x Graphics SDK demos to be built for both debug and release options for OMAP ES2.x and ES3.x silicon versions. Execute the following command for usage optionshost $ make help
This will print the usage as follows:
Usage: make BUILD=<options> OMAPES=<options> Default build is for silicon version ES3.x and release build Usage for ES2.x debug Build: make OMAPES=2.x BUILD=debug Usage for ES2.x release Build: make OMAPES=2.x BUILD=release Usage for ES3.x debug Build: make OMAPES=3.x BUILD=debug Alternative usage for ES3.x release Build: make OMAPES=3.x BUILD=release
Check for the OMAP3 silicon version on your EVM board and based on whether it is v2.x or v3.x, execute the appropriate command as given below. By default "make all" will build the Graphics SDK Demos for OMAP ES v3.x and in Release Mode
If your EVM supports OMAP3 ES 3.x, execute one of the following commands to build the Graphics SDK Demos in release ModeEither host $ make all or host $ make all OMAPES=3.x BUILD=release
If your EVM supports OMAP3 ES 3.x, execute the following command to build the Graphics SDK Demos in Debug Mode
host $ make all OMAPES=3.x BUILD=debug
If your EVM supports OMAP3 ES 2.x, execute the following command to build the Graphics SDK Demos in Release Mode
host $ make all OMAPES=2.x BUILD=release
If your EVM supports OMAP3 ES 2.x, execute the following command to build the Graphics SDK Demos in Debug Mode
host $ make all OMAPES=2.x BUILD=debug
NOTE 1: The above command will build the following Graphics SDK components
- Graphics SGX Kernel Modules.
- This requires the kernel to be installed as per the steps mentioned here as well setting the variables correctly in Rules.make file as mentioned in step 2
- Graphics SDK Demos - OGLES1.x and OGLES2.x
NOTE 2:This MAKEFILE does not have rules to rebuild the OMAP35x Graphics Sample Applications and the Training Material examples. - Graphics SGX Kernel Modules.
Installing the NFS Target File System with Graphics SDK Demos[edit]
The necessary executables and libraries required for running graphics SDK demos as well as for developing applications on top of graphics SDK can be installed to the NFS target file system using the following steps.
Pre-Requisites
- Ensure NFS target is setup as described here
- Ensure OMAP35x Graphics SDK demos are built as described here
To install the Graphics SDK demos, SGX user libraries, kernel modules and generated support files on the target file system specified by EXEC_DIR, execute the following command
host $ make install
Rebuilding the Graphics SGX Kernel Modules[edit]
Perform the following steps to build the graphics SGX kernel modules with the TI PSP SDK Kernel Release.
Perform steps 1 and 2 as mentioned in Building the OMAP35x Graphics Demo Software.
Navigate to the installed Graphics SDK folder
host $ cd /home/user_account/OMAP35x_Graphics_SDK_#_##_##_##
Check for the OMAP3 silicon version on your EVM board and based on whether it is v2.x or v3.x, execute the appropriate command as given below.
If your EVM supports OMAP3 ES 3.x, execute one of the following commands to build the Graphics SGX kernel modules in release mode
Either host $ make buildkernel or host $ make buildkernel OMAPES=3.x BUILD=release
If your EVM supports OMAP3 ES 3.x, execute the following command to build the Graphics SGX kernel modules in debug mode
host $ make buildkernel OMAPES=3.x BUILD=debug
If your EVM supports OMAP3 ES 2.x, execute the following command to build the Graphics SGX kernel modules in release mode
host $ make buildkernel OMAPES=2.x BUILD=release
If your EVM supports OMAP3 ES 2.x, execute the following command to build the Graphics SGX kernel modules in debug mode
host $ make buildkernel OMAPES=2.x BUILD=debug
NOTE: Rebuilding the SGX kernel modules will replace the default pre-built kernel modules with the latest re-built kernel modules under the gfx_rel, gfx_dbg, gfx_rel_es2.x or gfx_dbg_es2.x folders depending on the type of command execution as mentioned above in this section.
Building and Executing Your Own Demos[edit]
This section describes the steps required to build user implemented demonstrations.
- Place your demos in the same directory format as default graphics SDK demos
- Copy the release or debug versions of the shared and static libraries from the appropriate gfx_rel, gfx_dbg, gfx_rel_es2.x or gfx_dbg_es2.x folders to the OpenGL demo locations as shown below
In case of OpenGL ES1.x demos, perform the following steps
host $ mkdir -p /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/LinuxOMAP3/lib host $ cp /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/gfx_rel/*.so /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/LinuxOMAP3/lib host $ cp /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/gfx_rel/*.a /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/LinuxOMAP3/lib
In case of OpenGL ES2.x demos, perform the following steps
host $ mkdir -p /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES/LinuxOMAP3/lib host $ cp /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/gfx_rel/*.so /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES/LinuxOMAP3/lib host $ cp /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/gfx_rel/*.a /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES/LinuxOMAP3/lib
Perform similar steps as above for OpenVG demos as well.
- Set the following environment variables
- Ensure that the ARM toolchain path is included in the PATH variable
host $ export PATH=/home/<user_account>/toolchain/arm-2007q3/bin:$PATH
- Set the PLATFORM environment variable to LinuxOMAP3
host $ export PLATFORM = LinuxOMAP3
- Set the LIBDIR environment variable to the path where the graphics driver libraries are copied.
For OpenGL ES1.x demos, set the following
host $ export LIBDIR = /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/LinuxOMAP3/lib
For OpenGL ES2.x demos, set the following
host $ export LIBDIR = /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES2/LinuxOMAP3/lib
- Set the DISCIMAGE to your target file system install directory. This is required when the graphics and the dependent libraries are installed
host $ export DISCIMAGE = <your_target_file_system>
- Copy libstdc++.so, libstdc++.so.6 and libstdc++.so.6.0.9 from the toolchain path to your target file system's /usr/lib directory
host $ cp /home/<user_account>/toolchain/arm-2007q3/arm-none-linux-gnueabi/lib/libstdc++.so* /home/<user_account>/workdir/filesys/usr/lib
- Perform the build of your demonstration
host $ cd /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/GFX_Linux_SDK/OGLES/SDKPackage/Demos/<your_OpenGL_ES1.x_demo>/OGLES/Build/LinuxGeneric host $ make
- Copy the built executables to the target file system
host $ cp /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/GFX_Linux_SDK/OGLES/SDKPackage/Demos/<your_OpenGL_ES1.x_demo>/OGLES/Build/LinuxOMAP3/ReleaseRaw/<demo_executable> /home/<user_account>/workdir/filesys/opt/gfxdemos
- Create a file called gfxinstallinfo.txt and depending on the OMAP3 silicon version used in your EVM and based on the type of build (debug or release) you desire, edit this file to include the following text. Alternatively you could also use the following commands to create the file as well add the appropriate text.
host $ echo "release3.x" > /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/gfxinstallinfo.txt or host $ echo "debug3.x" > /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/gfxinstallinfo.txt or host $ echo "release2.x" > /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/gfxinstallinfo.txt or host $ echo "debug3.x" > /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/gfxinstallinfo.txt
Copy this file to the target file system
host $ cp /home/<user_account>/OMAP35x_Graphics_SDK_#_##_##_##/gfxinstallinfo.txt /home/<user_account>/workdir/filesys/opt/gfxdemos/.
This is used by the omap-demo script to identify which pre-built version of SGX user modules and kernel modules need to be installed on your DVEVM device for your demo to execute properly.
- Before running your graphics SDK demo application from the command line, it is necessary to install the appropriate SGX user libraries as well as kernel modules, based on the OMAP35x silicon version used in EVM and the debug or release version of the build being used. This is done by default, on DVEVM power up, when using the NFS based target file system built using the steps mentioned here.
In case the omap-demo script is not executed, execute the following command, after linux boottarget $ cd /etc/init.d target $ ./omap-demo
This will install all the necessary SGX user modules and kernel modules as well as performs the necessary initializations. Executing omap-demo in turn calls the appropriate install.sh on the target, based on the silicon version and the build type (debug or release version) used. This will also execute the rc.pvr script to load kernel modules and initialize the relevant SGX modules.
- Execute your graphics SDK demo
target $ cd /opt/gfxdemos target $ ./<your_demo_exec>