Personal tools

Log in

Changes

From IGEP - ISEE Wiki

Jump to: navigation, search

How to setup a development environment

1,081 bytes added, 10:36, 31 December 2013
m
no edit summary
This tutorial was written for the [http://wwwlabs.igep-platformisee.combiz/index.php?option=com_content&view=article&id=46&Itemid=55 /IGEP_Technology_devices_revisions ''igep revB''] board, but it is transposable to other ''OMAP3530'' boards (above all for the ''DSP'' part). It is a summary (with some adaptations) of several tutorials found on Internet (see [[How to setup a development environment#References|References]]). All files will be installed in the $HOME directory.  __TOC__ {{Message/Obsolete|Link=Visit the [[IGEP SDK Virtual Machine]] for updated information}}
This tutorial is a translation of a French tutorial we wrote on our robotic [http://as.tech.free.fr/wiki/index.php?title=Cr%C3%A9er_un_environnement_de_d%C3%A9veloppement_pour_l%27OMAP3530 web site]. Sorry for the English, feel free to correct mistakes.
= ''Rootfs'' =
This section describes how to obtain the [http://www.pokylinux.org/ ''Poky''] distribution. This is the distribution shipped with the ''igep'' board; it is based on [http://wikiwww.openembedded.netorg/index.phpwiki/Main_Page ''Open Embedded''].
The first thing to do is set ''Bash'' as default ''sh'' ''shell'':
We will see in section [[How to setup a development environment#Boot_on_the_rootfs_and_the_kernel|''Boot'' on ''rootfs'' and kernel]] how to use it. Yet, ''bitbake'' will download by default the kernel "linux-omap-2.6.28.10-igep0020b-0" which is not the last one provided by ''ISEE''. See section [[How to setup a development environment#Kernel_compilation|Kernel compilation]] to compile another version.
TODO: modify ''recipes'' to download another kernel version
= Cross toolchain for the ''ARM'' =
<pre>make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- uImage modules
</pre>
The resulting image is placed in "arch/arm/boot" directory.<br>Note: If there is no uImage file present you may not have installed the uboot-mkimage package.<br>In ubuntu Hardy (8.04), this package is unknown. First upgrade to e.g. Lucid (10.04) then install the package.
We will see in the section [[How to setup a development environment#Boot_on_the_rootfs_and_the_kernel|Boot on the ''rootfs'' and the kernel]] how to use kernel and modules.
Two servers are needed. The ''NFS'' (''Network File System'') server allows the target to accede its ''rootfs'' by the network. The ''TFTP'' (''Trivial File Transfer Protocol'') server allows the target to download the kernel over network. Thus, ''UBoot'' needs to be correctly setup to boot on the correct files. To do this, plug a serial cable on the board (''115200n8'') and stop ''UBoot'' by pressing a key. The environment variable of ''UBoot'' we need to change are:
*''serverip'': the server's ''IP'' address, need to be on the ''192.168.254.x'' subred subnet (except if you change the board address, which is not explained here). By default, the server's ''IP'' address is ''192.168.254.10''.
*''distro'': the distribution's name, by default ''poky''.
*''machine'': the card's name, by default ''igep0020b''.
<pre>run bootcmd
</pre>
which will execute the contents of the ''bootcmd'' variable. The 'printenv' ''command allow to show the content of a variable; for example:''
<pre>printenv bootcmd
</pre>
<pre>run mmc-boot; run nfs-boot; run onenand-boot
</pre>
That is to say the board will first check if a memory card is present to boot with it. If memory card is not present, the board will newt ''ping'' the server to boot over the network. If the server does not answer, the board will boot on the flash. <br>Take a look at ''mmc-boot'', ''nfs-boot'' and ''onenand-boot'' variables for more details. In addition, the factory settings of ''UBoot'' are given [http://wikilabs.myigepigep.comes/tracindex.php/wiki/HowToSetupUBootFactorySetting The_bootloader_U-Boot here].
In order to save ''UBoot'' environment variables in the flash, do:
sudo mkdir -p /srv/tftp/poky/poky-image-base/igep0020b
</pre>
Make sure the access rights of the directory is set correctly (use e.g. chmod 777 &lt;dir&gt;).<br>If not correct, uBoot will complain on the uBoot terminal when trying to load the kernel or on access of the rootfs.
 
Next, copy the kernel. If it was made [[How to setup a development environment#Kernel_compilation_outside_bitbake|outside ''bitbake'']]:
<pre>sudo cp $HOME/igep/linux-omap-2.6.28.10-igep0020b-2/arch/arm/boot/uImage /srv/tftp/poky/poky-image-base/igep0020b/
/srv/nfs/&lt;distro&gt;/&lt;project&gt;/&lt;machine&gt; &lt;target_ip&gt;(rw,no_root_squash,no_subtree_check,sync)
</pre>
where ''&lt;target_ip&gt;'' is the ''ip'' address of the target. By default, ''igep'' address is ''192.168.254.254''. It is also possible to put ''an asterisk (*)'' to allow a wider range of addresses. In our case, write&nbsp;:
<pre>/srv/nfs/poky/poky-image-base/igep0020b 192.168.254.254(rw,no_root_squash,no_subtree_check,sync)
or/srv/nfs/poky/poky-image-base/igep0020b *(rw,no_root_squash,no_subtree_check,sync)</pre>Remember execute the command:<br>
<pre>$ exportfs -a
</pre>Every time that you modify/update the file /etc/exports.<br> Note: In the rootfs on the nfs-server I had to remove the line "auto eth0" from the file /etc/network/interfaces. If this line is present, the boot process stops with the error:<br>nfs: server 192.168.2.10 not responding, still trying
=== Copy kernel and ''rootfs'' in ''flash'' memory ===
Copy can be done either from ''uboot'' or ''linux''. To copy the ''rootfs'', a ''jffs2'' file is needed. If you do not need any modification to the one created [[How to setup a development environment#Rootfs|previously]], you can jump next step. If you have made changes to the ''rootfs'' (for example when using it for [[How to setup a development environment#Over_network|''NFS'' boot]]), you will have to build the ''jffs2'' file from the ''rootfs'' directory.
==== Create the ''jffs2'' file ====
The following package needs to be installed to create the ''jffs2'' file:
mtd4: 1fa80000 00040000 "File System"
</pre>
Thus, the size is 0x40000=265KB256KB.
==== Copy from ''uboot'' ====
==== Copy from ''linux'' ====
To do this, you will have to boot the card from ''nfs'' or memory card; but not from flash.
<pre>$HOME/igep/poky/build/tmp-igep0020b/deploy/images/poky-image-base-igep0020b.jffs2
</pre>
And now reboot. In case of errors (such as ''bad crc'' on the ''kernel'' for example), it is necessary to reflash all, see [http://wikilabs.myigepisee.combiz/trac/wikiindex.php/HowToUpgradeTheFactoryFirmware Update_the_PRE-INSTALLED_software_image_to_a_current_release this].
=== Copy kernel and ''rootfs'' in memory card ===
= Cross toolchain for the ''DSP'' =
local_power_manager_1_24/packages/ti/bios/power/utils/bin/ti_platforms_evm3530/linux/release/
 
Note: if you get compiler errors like:
<pre>TI/local_power_manager_linux_1_24_02_09/packages/ti/bios/power/modules/omap3530/lpm/lpm_driver.c: In function 'lpm_open':
TI/local_power_manager_linux_1_24_02_09/packages/ti/bios/power/modules/omap3530/lpm/lpm_driver.c:474: error: implicit declaration of function 'kmalloc'
TI/local_power_manager_linux_1_24_02_09/packages/ti/bios/power/modules/omap3530/lpm/lpm_driver.c:474: warning: assignment makes pointer from integer without a cast
TI/local_power_manager_linux_1_24_02_09/packages/ti/bios/power/modules/omap3530/lpm/lpm_driver.c:500: error: implicit declaration of function 'kfree'
</pre>
please add:
<pre>#include <linux/slab.h>
</pre>
to lpm_driver.c.
 
=== Libraries ===
The variables OSINC_GENERIC and OSINC_PLATFORM allow to setup the directories where ''DSPLINK'' will look for ''.h'' files.
=== Librairies Libraries ===
By defualt, ''DSPLINK'' is searching the libraries in the directories:
= References =
 
[http://wiki.myigep.com/trac/wiki/HowToGetThePokyLinuxDistribution How To Get The Poky Linux Distribution]
[http://www.pokylinux.org/doc/poky-handbook.html Poky Handbook]
 
[http://wiki.myigep.com/trac/wiki/HowToCrossCompileTheLinuxKernel How To Cross Compile The Linux Kernel]
 
[http://wiki.myigep.com/trac/wiki/HowToUpgradeTheFactoryFirmware How To Upgrade The Factory Firmware]
[http://wiki.davincidsp.com/index.php/Building_DSPLink Building DSPLink]
[http://hilbert-space.de/?p=14 Compiling CMEM]
[[Category:How to forge|Development environment]][[Category:Development tools]][[Category:Tutorials]]
4,199
edits