Difference between revisions of "Development Environment HowTo (NELK)"

From DAVE Developer's Wiki
Jump to: navigation, search
(Build/configure Linux kernel only)
(Build/configure Linux kernel only)
Line 85: Line 85:
 
</pre>
 
</pre>
  
{{ImportantMessage|text=The <pre class="workstation-terminal">make linux</pre> command will fail if launched before preparing the kernel configuration as described above}}
+
{{ImportantMessage|text=The <pre class="workstation-terminal">make linux</pre> command will fail complaining about a missing .config file if launched before preparing the kernel configuration as described above}}
  
  

Revision as of 10:11, 9 May 2012

Info Box
Naon am387x-dm814x.png Applies to Naon


Introduction[edit | edit source]

In this HowTo we'll take a first look of Naon Embedded Linux Kit (NELK) development environment.

To allow fast development startup, NELK is provided as DVDK virtual appliance, in this way user can setup its development environment in minutes and get productive as soon as the VM starts.

Build the whole kit[edit | edit source]

Building the whole kit means:

  • build Linux kernel with default configuration
  • build u-boot with default configuration
  • build gstreamer and all the required libriaries
  • install the binaries into the root file system

After starting the DVDK, log in by using the default user and start a terminal. Then:

  • enter the EZSDK_INSTALL_DIR directory: cd /home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-x.xx.xx.xx
    • where the x should be substituted with the current release which NELK is based (e.g. /home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15)
  • run make all command
nelk@nelk-desktop:/home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15$ make all
make -C /home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15/board-support/linux-2.6.37-psp04.01.00.06.patch2 ARCH=arm CROSS_COMPILE=/home/shared/devel/dave/naon-DAA/sw/linux/sdk/arm-2009q1//bin/arm-none-linux-gnueabi- uImage
make[1]: Entering directory `/home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15/board-support/linux-omap3.git'

[snip..]

max_DM81XX_RELEASE_0_03'
make[2]: Leaving directory `/home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15/component-sources/gst-openmax_DM81XX_RELEASE_0_03'
make[1]: Leaving directory `/home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15/component-sources/gst-openmax_DM81XX_RELEASE_0_03'
nelk@nelk-desktop:/home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15$
  • after the build finish (which may take a while, depending on user's PC power), user can install the binaries with sudo make install (sudo is required due file permission restriction on the root file system)
nelk@nelk-desktop:/home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15$ sudo make install
[sudo] password for nelk: 
install -d /home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15/../rfs/nelk/boot
install  /home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15/board-support/linux-2.6.37-psp04.01.00.06.patch2/arch/arm/boot/uImage /home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15/../rfs/nelk/boot
install  /home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15/board-support/linux-2.6.37-psp04.01.00.06.patch2/vmlinux /home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15/../rfs/nelk/boot
install  /home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15/board-support/linux-2.6.37-psp04.01.00.06.patch2/System.map /home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15/../rfs/nelk/boot

[snip..]

make[3]: Entering directory `/home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15/component-sources/gst-openmax_DM81XX_RELEASE_0_03'
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
make[3]: Leaving directory `/home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15/component-sources/gst-openmax_DM81XX_RELEASE_0_03'
make[2]: Leaving directory `/home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15/component-sources/gst-openmax_DM81XX_RELEASE_0_03'
make[1]: Leaving directory `/home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15/component-sources/gst-openmax_DM81XX_RELEASE_0_03'
nelk@nelk-desktop:/home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15$ 
  • when the install process finishes all the binaries are installed

Build a custom application[edit | edit source]

Build/configure Linux kernel only[edit | edit source]

If needed, user can configure and build only the Linux kernel (this is useful, for example, if you are a kernel driver developer).

Linux kernel source are available inside EZSDK_INSTALL_DIR/board-support/linux-omap3.git.

The configuration name is specified inside $EZSDK_INSTALL_DIR/Rules.make into the variable DEFAULT_LINUXKERNEL_CONFIG

Enter the $EZSDK_INSTALL_DIR and type:

nelk@nelk-desktop:/home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15$ make linux_defconfig

in order to configure the kernel. This will create a

.config

file into the EZSDK_INSTALL_DIR/board-support/linux-omap3.git.

To build the Linux uImage (suitable for U-Boot) and modules, please enter the following command:

nelk@nelk-desktop:/home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15$ make linux


200px-Emblem-important.svg.png
The
make linux
command will fail complaining about a missing .config file if launched before preparing the kernel configuration as described above


To manually change the default configuration, execute:

nelk@nelk-desktop:/home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15$ make linux_menuconfig

The usual Linux curses configuration interface will allow configuration changes.

To clean the build, type:

nelk@nelk-desktop:/home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15$ make clean

To revert to the default configuration, type:

nelk@nelk-desktop:/home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15$ make linux_defconfig


Two additional target are provided:

nelk@nelk-desktop:/home/shared/devel/dave/naon-DAA/sw/linux/sdk/sdk-5.03.01.15$ make linux_install

Copy the binaries (uImage and modules) inside the root file system (see EXEC_DIR variable inside $EZSDK_INSTALL_DIR/Rules.make), under the directory:

  • $EXEC_DIR/boot: for uImage
  • $EXEC_DIR/lib/modules/$KERNEL_VERSION: for the modules


Info-icon.png Please note that, on DVDK, $EXEC_DIR/boot is inside the TFTP root directory, thanks to the symbolic link: /srv/tftp/naon -> $EXEC_DIR/boot.

So requesting naon/uImage to DVDK's TFTP server will return $EXEC_DIR/boot/uImage

Info-icon.png


Info-icon.png Please note that, after running make linux_install, the user should run the command depmod from the target shell
root@naon:~# depmod
Info-icon.png


Info-icon.png Please note that sudo make linux_install delete all other installed linux kernel modules. For this reason, after this command the user should also run
sudo make syslink_install sgx-driver_install
Info-icon.png

Build/configure U-Boot only[edit | edit source]