Personal tools

Log in

Changes

From IGEP - ISEE Wiki

Jump to: navigation, search

How to setup a development environment

756 bytes added, 22:36, 29 March 2010
no edit summary
This tutorial was written for the [http://www.igep-platform.com/index.php?option=com_content&view=article&id=46&Itemid=55 ''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_environmentHow to setup a development environment#References|References]]). All files will be installed in the $HOME directory.
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'' boad; it is based on [http://wiki.openembedded.net/index.php/Main_Page ''Open Embedded''].
The first thing to do is set ''Bash'' as default ''sh'' ''shell'': <pre>sudo dpkg-reconfigure dash</pre> answer no to the question. Thus, "/bin/sh" will point towards "/bin/bash" (and not "/bin/dash"). Then, some kernels settings have to be changed. Edit the file "/etc/sysctl.conf" as ''root'' and set &nbsp;:  <pre>vm.mmap_min_addr = 0</pre>then, to take the modification into account:<pre>sudo sysctl -p</pre> Some additional packages need to be installed to satisfy ''bitbake'' dependencies. First, add the following repositories to "/etc/apt/sources.list" &nbsp;:<pre>deb http://debian.o-hand.com etch/
deb http://debian.o-hand.com unstable/
deb http://debian.o-hand.com feisty/
deb http://debian.o-hand.com gutsy/
deb http://debian.o-hand.com hardy/
</pre>Update the data base and install the following packages:<pre>sudo apt-get update
sudo aptitude install python-psyco hgsvn qemu poky-depends poky-scripts
</pre><!--
a priori ceci est automatiquement installé :
sudo aptitude install subversion cvs git-core \
libncurses5-dev gawk python-dev python-psyco python-pysqlite2 \
scrollkeeper gnome-doc-utils gettext automake hgsvn qemu poky-depends poky-scripts
-->Then, download and decompress the last stable version of ''Poky'': <pre>mkdir -p $HOME/igep/poky
cd $HOME/igep/poky
wget http://pokylinux.org/releases/poky-purple-3.2.tar.bz2
tar -xjf poky-purple-3.2.tar.bz2
</pre> The configuration file of ''Poky'' is located in the directory $HOME/igep/poky/build/conf &nbsp;:<pre>cd build/conf
nano local.conf
</pre>And paste the modified version for the ''igep'' board:<pre># Where to cache the files Poky downloadsDL_DIR &nbsp;?= "${OEROOT}/sources"
BBFILES += "\
${OEROOT}/meta/packages/*/*.bb \
# For a quadcore, BB_NUMBER_THREADS = "4", PARALLEL_MAKE = "-j 4" would
# be appropriate.
# BB_NUMBER_THREADS = "24"
# Also, make can be passed flags so it run parallel threads e.g.:
# PARALLEL_MAKE = "-j 2"
# The machine to target
MACHINE &nbsp;?= "igep0020b"
TARGET_FPU_arm &nbsp;?= "hard"
# Other supported machines
#MACHINE &nbsp;?= "qemux86"#MACHINE &nbsp;?= "qemuarm"#MACHINE &nbsp;?= "c7x0"#MACHINE &nbsp;?= "akita"#MACHINE &nbsp;?= "spitz"#MACHINE &nbsp;?= "nokia770"#MACHINE &nbsp;?= "nokia800"#MACHINE &nbsp;?= "fic-gta01"#MACHINE &nbsp;?= "bootcdx86"#MACHINE &nbsp;?= "cm-x270"#MACHINE &nbsp;?= "em-x270"#MACHINE &nbsp;?= "htcuniversal"#MACHINE &nbsp;?= "mx31ads"#MACHINE &nbsp;?= "mx31litekit"#MACHINE &nbsp;?= "mx31phy"#MACHINE &nbsp;?= "netbook"#MACHINE &nbsp;?= "zylonite"
DISTRO &nbsp;?= "poky"
# For bleeding edge / experimental / unstable package versions
# DISTRO &nbsp;?= "poky-bleeding"
# Poky has various extra metadata collections (openmoko, extras).
# include 'package_deb' for debs
# include 'package_ipk' for ipks
#PACKAGE_CLASSES &nbsp;?= "package_deb package_ipk"PACKAGE_CLASSES &nbsp;?= "package_ipk"
# POKYMODE controls the characteristics of the generated packages/images by
#
# The default is "eabi"
# Use "oabi" for machines with kernels < &lt; 2.6.18 on ARM for example.
# Use "external-MODE" to use the precompiled external toolchains where MODE
# is the type of external toolchain to use e.g. eabi.
# Note that a full build of everything in OpenEmbedded will take GigaBytes of hard
# disk space, so make sure to free enough space. The default TMPDIR is
# <&lt;build directory>&gt;/tmp
TMPDIR = "${OEROOT}/build/tmp-${MACHINE}"
# Supported values are i586 and x86_64
SDKMACHINE="i586"
</pre> The following section needs to be adapted to the number of CPU the host machine has:<pre># Uncomment and set to allow bitbake to execute multiple tasks at once.
# For a quadcore, BB_NUMBER_THREADS = "4", PARALLEL_MAKE = "-j 4" would
# be appropriate.
# Also, make can be passed flags so it run parallel threads e.g.:
# PARALLEL_MAKE = "-j 2"
</pre> The build environment needs to be setup by the following command:<pre>cd ../..
source poky-init-build-env
</pre>A target can be built using:<pre>bitbake <&lt;target>&gt;</pre>there is a lot of targets, which can be an image (take a look at the "meta/packages/images/" directory) or more simply a ''recipe'' corresponding to a software. A detailed list of images can be found on the [http://www.pokylinux.org/doc/poky-handbook.html#ref-images Poky Handbook]. To build an image without ''X11'' server:<pre>bitbake poky-image-base</pre>This step is very long (several hours) and take a lot of space (like 16 gigas) on the host's hard disk. If you are behind a ''proxy'', take a look at this [http://www.pokylinux.org/doc/poky-handbook.html#id3403214 part] of ''Poky's'' FAQ.
This step is very long (several hours) and take a lot of space (like 16 gigas) on the host's hard disk. If you are behind a ''proxy'', take a look at this [http://www.pokylinux.org/doc/poky-handbook.html#id3403214 part] of ''Poky's'' FAQ. If everything compiles well, the resulting image (''rootfs'' and kernel) will be placed in the directory:<pre>tmp-igep0020b/deploy/images/</pre>and ''.ipk'' packages in:<pre>tmp-igep0020b/deploy/ipk/</pre>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.
We will see in section [[How_to_setup_a_development_environment#Boot_on_the_rootfs_and_the_kernel|TODO: modify ''Bootrecipes'' on ''rootfs'' and kernel]] how to use it. Yet, ''bitbake'' will download by default the another 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 = Cross toolchain for the ''recipesARM'' to download another kernel version=
= Cross toolchain for the ''ARM''= Aparently, there is a ''bug'' in one of ''Poky's'' ''recipes'', which implies that the cross toolchain doesn't include automatically the ''C++'' ''headers'', see [http://lists.o-hand.com/poky/1420.html this thread]. A ''patch'' has been proposed; to apply it &nbsp;:<pre>cd $HOME/igep/poky
wget http://lists.o-hand.com/poky/att-1420/fix-gxx-include-dir.patch
patch -p1 < &lt; fix-gxx-include-dir.patch</pre> The cross toolchain can be built using ''bitbake'':<pre>source poky-init-build-env
bitbake meta-toolchain-sdk
</pre>The result will be placed in the directory:<pre> tmp-igep0020b/deploy/sdk/</pre>as an archive to decompress in the directory "/usr/local/poky".
In order to cross compile code for the ''ARM'', the following script needs to be run to set up paths:<pre>source /usr/local/poky/eabi-glibc/environment-setup-arm-poky-linux-gnueabi</pre>= Kernel compilation =
Currently, the last stable kernel provided by ''ISEE'' is "linux-omap-2.6.28.10-igep0020b-2". Check in the ''download'' section of [http://www.myigep.com/index.php?option= Kernel compilation com_weblinks&view=category&id=50&Itemid=85 www.myigep.com] which is the last one. More recent versions (but unstable) can be downloaded on the [http://git.myigep.com/gitweb ''git''] of ''ISEE''.
Currently, the last stable kernel provided by ''ISEE'' is "linux-omap-2.6.28.10-igep0020b-2". Check in the === Kernel compilation under ''downloadbitbake'' section of [http://www.myigep.com/index.php?option=com_weblinks&view=category&id=50&Itemid=85 www.myigep.com] which is the last one. More recent versions (but unstable) can be downloaded on the [http://git.myigep.com/gitweb ''git''] of ''ISEE''.
=== Kernel compilation under outside ''bitbake'' ===
=== Kernel compilation outside ''bitbake'' === First, download the kernel sources:<pre>cd $HOME/igep
wget http://downloads.myigep.com/sources/kernel/linux-omap-2.6.28.10-igep0020b-2.tar.gz
tar -xzf linux-omap-2.6.28.10-igep0020b-2.tar.gz
cd linux-omap-2.6.28.10-igep0020b-2
</pre> Configure the kernel:<pre>source /usr/local/poky/eabi-glibc/environment-setup-arm-poky-linux-gnueabi
make ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- igep0020b_defconfig
make ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- menuconfig
</pre>The last line is only needed if you want to customize the kernel.  To compile kernel and modules: <pre>make ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- uImage modules</pre> The resulting image is placed in "arch/arm/boot" directory.
To compile 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:<pre>make ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- uImage modules</pre>.
The resulting image is placed in "arch/arm/boot" directory.= Boot on the ''rootfs'' and the kernel =
We will see in There are several methods to do it. For developing purposes, the section [[How_to_setup_a_development_environment#Boot_on_the_rootfs_and_the_kernel|Boot easiest way is to boot over network, which avoid flashing operations or coping on the ''rootfs'' and memory card. Yet, these two solutions are essentials for applications where the kernel]] how board need to use kernel and modulesbe independent from the host computer.
= Boot on the ''rootfs'' and the kernel == Over network ===
There Two servers are several methods needed. The ''NFS'' (''Network File System'') server allows the target to do itaccede its ''rootfs'' by the network. For developing purposes, The ''TFTP'' (''Trivial File Transfer Protocol'') server allows the easiest way is target to boot download the kernel over network. Thus, which avoid flashing operations or coping ''UBoot'' needs to be correctly setup to boot on the memory cardcorrect files. YetTo do this, these two solutions are essentials for applications where plug a serial cable on the board (''115200n8'') and stop ''UBoot'' by pressing a key. The environment variable of ''UBoot'' we need to be independent from the host computer.change are:
=== Over network ===*''serverip'': the server's ''IP'' address, need to be on the ''192.168.254.x'' subred (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''. *''project'': the project's name, that is to say the ''rootfs'' generated [[How to setup a development environment#Rootfs|previously]].
Two servers are needed. The To change a variable, use the command ''NFSsetenv'' (''Network File System'') server allows the target . Thus, to accede its ''rootfs'' by change the network. The project''TFTP'' (''Trivial File Transfer Protocol'') server allows s name and use the target to download the kernel over network. Thusone we have just made, set: <pre>setenv project poky-image-base</pre> Then, ''UBoot'' needs to be correctly setup to boot on : <pre>run bootcmd</pre> which will execute the correct files. To do this, plug a serial cable on contents of the board (''115200n8bootcmd'') and stop ''UBoot'' by pressing a keyvariable. The environment variable of ''UBootprintenv'' we need command allow to change areshow the content of a variable; for example:*''serverip''<pre>printenv bootcmd</pre> returns by default: <pre>run mmc-boot; run nfs-boot; run onenand-boot</pre> That is to say the server's ''IP'' address, need board will first check if a memory card is present to be on the ''192boot with it.168.254.x'' subred (except if you change the board address, which If memory card is not explained here). By defaultpresent, the server's board will newt ''IPping'' address is ''192the server to boot over network.168If server does not answer, the board will boot on the flash.254.10Take a look at ''.*mmc-boot''distro'': the distribution's name, by default ''pokynfs-boot''.*and ''machine'': the card's name, by default ''igep0020bonenand-boot''variables for more details.*''project'': the project's nameIn addition, that is to say the factory settings of ''rootfsUBoot'' generated are given [[How_to_setup_a_development_environment#Rootfs|previously]http://wiki.myigep.com/trac/wiki/HowToSetupUBootFactorySetting here].
To change a variable, use the command In order to save ''setenvUBoot''. Thus, to change environment variables in the project's name and use the one we have just made, set:<pre>setenv project poky-image-base</pre>Thenflash, to bootdo:<pre>run bootcmdsaveenv</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>returns by default:<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 avoid to boot with reenter itevery time. If memory card is not present, the board will newt ''ping'' the server to boot over network. If server does not answer, the board will boot on the flash. 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://wiki.myigep.com/trac/wiki/HowToSetupUBootFactorySetting here].
In order to save Once ''&lt;serverip&gt;'', ''&lt;distro&gt;'', ''&lt;project&gt;'', and ''&lt;machine&gt;'' variables setup, ''UBoot'' environment variables in will search on the flash, doserver of address ''&lt;serverip&gt;'':<pre>saveenv</pre>which will avoid to reenter it every time...
Once ''<serverip>'', ''<distro>'', ''<project>'', and ''<machine>'' variables setup, ''UBoot'' will search on the server of address ''<serverip>'':* a kernel image ''uImage'' in the directory "/srv/tftp/''<&lt;distro>&gt;''/''<&lt;project>&gt;''/''<&lt;machine>&gt;''" accessible by ''TFTP''.* a ''rootfs'' in the directory "/srv/nfs/''<&lt;distro>&gt;''/''<&lt;project>&gt;''/''<&lt;machine>&gt;''" accessible by ''NFS''.
We assume now that ''<&lt;distro>&gt;=poky'', ''<&lt;project>&gt;=poky-image-base'' and ''<&lt;machine>&gt;=igep0020b''.
Thus, create the following directories on the host:<pre>sudo mkdir -p /srv/nfs/poky/poky-image-base/igep0020b
sudo mkdir -p /srv/tftp/poky/poky-image-base/igep0020b
</pre>Next, copy the kernel. If it was made [[How_to_setup_a_development_environmentHow 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/</pre>or if it was made [[How_to_setup_a_development_environmentHow to setup a development environment#Rootfs|with the ''rootfs'']] or [[How_to_setup_a_development_environmentHow to setup a development environment#Kernel_compilation_under_bitbake|under''bitbake'']]:<pre>sudo cp $HOME/igep/poky/build/tmp-igep0020b/deploy/images/uImage /srv/tftp/poky/poky-image-base/igep0020b/</pre>Next, install the ''rootfs'' in the good directory:<pre>pushd /srv/nfs/poky/poky-image-base/igep0020bsudo cpio -idm< &lt; $HOME/igep/poky/build/tmp-igep0020b/deploy/images/poky-image-base-igep0020b.cpio
popd
</pre>If kernel was built [[How_to_setup_a_development_environmentHow to setup a development environment#Kernel_compilation_outside_bitbake|outside ''bitbake'']], install kernel modules in the ''rootfs'' as follows:<pre>cd $HOME/igep/linux-omap-2.6.28.10-igep0020b-2
source /usr/local/poky/eabi-glibc/environment-setup-arm-poky-linux-gnueabi
make ARCH=arm CROSS_COMPILE=arm-poky-linux-gnueabi- modules_install INSTALL_MOD_PATH=/srv/nfs/poky/poky-image-base/igep0020b
</pre>Finally, install the two servers on host:<pre>sudo apt-get install tftpd nfs-kernel-server</pre>By default, the ''TFTP'' server shares the "/srv/tftp" directory, which is the one we are using. If necessary, you can change this by editing the "/etc/inetd.conf" file &nbsp;:<pre>#:BOOT: TFTP service is provided primarily for booting. Most sites
# run this only on machines acting as "boot servers."
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /srv/tftp
</pre>
The configuration file of ''NFS'' server is "/etc/exports". Add the following line for each ''rootfs''&nbsp;:
<pre># Poky image rootfs
/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 ''*'' 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)
</pre>
 The configuration file of ''NFS'' server is "/etc/exports". Add Remember execute the following line for each ''rootfs'' command:<pre># Poky image rootfs/srv/nfs/<distro>/<project>/<machinebr> <target_ip>(rw,no_root_squash,no_subtree_check,sync)</pre>where ''<target_ip>'' is the ''ip'' address of the target. By default, ''igep'' address is ''192.168.254.254''. It is also possible to put ''*'' to allow $ exportfs -a wider range of addresses. In our case, write :<pre>/srv/nfs/poky/poky-image-base/igep0020b 192.168.254.254(rw,no_root_squash,no_subtree_check,sync)
</pre>
Every time that you modify/update the file /etc/exports.<br>
=== 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_environmentHow 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_environmentHow 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:<pre>sudo apt-get install mtd-utils</pre>Then use the command:<pre>mkfs.jffs2 -r <&lt;root file system> &gt; -e <&lt;erase block size> &gt; -o <&lt;output file> &gt; </pre>where <&lt;root file system> &gt; is the path to the directory to copy (ie /srv/nfs/poky/poky-image-base/igep0020b), <&lt;erase block size> &gt; is the block size to erase in KB and <&lt;output file> &gt; name of the output file.Block size can be seen with the following command:<pre>cat /proc/mtd</pre>On ''igep'', it returns:<pre>dev: size erasesize name
mtd0: 00080000 00040000 "X-Loader"
mtd1: 00180000 00040000 "U-Boot"
mtd3: 00300000 00040000 "Kernel"
mtd4: 1fa80000 00040000 "File System"
</pre>Thus, the size is 0x40000=265KB.
====Copy from ''uboot''====
==== Copy from ''linux'' ====
====Copy To do this, you will have to boot the card from ''linuxnfs''====or memory card; but not from flash.
To do this, you will have to boot the card from ''nfs'' or memory card; but not from flash. Partitions can be seen with the following command:<pre>cat /proc/mtd</pre>On ''igep'', it returns:<pre>dev: size erasesize name
mtd0: 00080000 00040000 "X-Loader"
mtd1: 00180000 00040000 "U-Boot"
mtd3: 00300000 00040000 "Kernel"
mtd4: 1fa80000 00040000 "File System"
</pre>To copy the kernel, erase the corresponding memory area before doing the copy:<pre>flash_eraseall /dev/mtd3
nandwrite -p /dev/mtd3 uImage
</pre>same thing for the ''rootfs''<pre>flash_eraseall /dev/mtd4
nandwrite -p /dev/mtd4 rootfs.jffs2
</pre>Note that if you are using the ''rootfs'' built [[How_to_setup_a_development_environmentHow to setup a development environment#Rootfs|previously]], the corresponding file should be located there:<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://wiki.myigep.com/trac/wiki/HowToUpgradeTheFactoryFirmware this].
And now reboot. In case of errors (such as ''bad crc'=== Copy kernel and ' on the ''kernelrootfs'' for example), it is necessary to reflash all, see [http://wiki.myigep.com/trac/wiki/HowToUpgradeTheFactoryFirmware this].in memory card ===
=== Copy kernel and Chaine de développement croisée ''rootfsDSP'' in memory card == =
Note: certains des outils de cette section nécessitent un compte sur le site de TI pour pouvoir les télécharger. La page principale des téléchargements est [http://software-dl.ti.com/dsps/dsps_registered_sw/sdo_sb/targetcontent/index.html celle-ci].
= Chaine de développement croisée == ''DSPCode generation tools'' ===
Note: certains des outils de cette section nécessitent un compte sur ''TI CGT'' est le site de TI cross compilateur pour pouvoir les téléchargerle DSP. La page principale des téléchargements est Récupérer la dernière version [httphttps://softwarewww-dla.ti.com/dsps/dsps_registered_swdownloads/sdo_sbsds_support/targetcontentTICodegenerationTools/indexdownload.html celle-cihtm ici]et installer (par exemple dans le répertoire $HOME/TI/TI_CGT).
=== ''Code generation toolsDSP BIOS'' ===
''TI CGTDSP BIOS'' est le cross compilateur pour système d'exploitation résidant dans le ''DSP''. Récupérer la dernière version A télécharger [httpshttp://wwwsoftware-adl.ti.com/downloadsdsps/dsps_public_sw/sdo_sb/sds_supporttargetcontent/TICodegenerationToolsdspbios/downloadindex.htm html ici] et installer (par exemple dans le répertoire $HOME/TI/TI_CGTBIOS).
=== ''DSP BIOSXDC Tools'' ===
''DSP BIOS'' est le système d'exploitation résidant dans le ''DSP''. A télécharger [http://software-dl.ti.com/dsps/dsps_public_swdsps_registered_sw/sdo_sb/targetcontent/dspbiosrtsc/index.html ici] et installer (par exemple dans le répertoire '$HOME/TI/BIOSxdctools).
=== ''XDC ToolsDSP Link'' ===
''DSPLink'' permet la communication entre ''ARM'' et ''DSP''. A télécharger [http://software-dl.ti.com/dsps/dsps_registered_sw/sdo_sb/targetcontent/rtsclink/link_1_60/index.html ici] et installer (. Décompresser le par exemple dans le répertoire '$HOME/TIigep/xdctools)dsplink.
=== ''DSP Link'' === ''DSPLink'' permet la communication entre ''ARM'' et ''DSP''. A télécharger [http://software-dl.ti.com/dsps/dsps_registered_sw/sdo_sb/targetcontent/link/link_1_60/index.html ici]. Décompresser le par exemple dans le répertoire $HOME/igep/dsplink. Ajouter une variable d'environnement DSPLINK contenant le chemin du répertoire de ''DSPLINK'', par exemple en ajoutant au .bashrc la ligne suivante: (penser à faire un log out/log in ensuite) <pre>export DSPLINK=$HOME/igep/dsplink_linux_1_63/dsplink</pre> aller dans le répertoire $(DSPLINK)/config/bin et lancer &nbsp;: <pre>perl dsplinkcfg.pl --platform=OMAP3530 --nodsp=1 --dspcfg_0=OMAP3530SHMEM --dspos_0=DSPBIOS5XX --gppos=OMAPLSP --comps=PONSLRMC</pre> pour configurer ''DSPLINK''. Pour comprendre ce que fait chacune de ces options, lancer simplement&nbsp;: <pre>perl dsplinkcfg.pl
</pre>
pour configurer ''DSPLINK''. Pour comprendre ce que fait chacune de ces options, lancer simplement :<pre>perl dsplinkcfg.pl</pre>et ajouter les options au fur et à mesure. Si tout se passe bien, le message suivant devrait apparaitre &nbsp;: <pre>Please edit the following files for toolchains, kernel sources, etc changes.
GPP side distribution file: $DSPLINK/make/Linux/omap3530_2.6.mk
GPP side distribution file: $DSPLINK/gpp/src/Rules.mk
DSP side distribution file: $DSPLINK/make/DspBios/c64xxp_5.xx_linux.mk
</pre>ce sont les fichiers à éditer pour adapter à notre configuration.
Pour le fichier $DSPLINK/make/Linux/omap3530_2.6.mk, changer (et adapter si besoin) les valeurs suivantes:<pre># ============================================================================
# Set the values of necessary variables to be used for the OS.
# ============================================================================
# Base directory for the GPP OS
# ----------------------------------------------------------------------------
BASE_BUILDOS &nbsp;:=${HOME}/igep/linux-omap-2.6.28.10-igep0020b-2
# ----------------------------------------------------------------------------
# Base for toolchain
# ----------------------------------------------------------------------------
BASE_TOOLCHAIN &nbsp;:= /usr/local/poky/eabi-glibc
# ----------------------------------------------------------------------------
# Base directory for include files provided by GPP OS
# ----------------------------------------------------------------------------
BASE_OSINC &nbsp;:= $(BASE_BUILDOS)/include
OSINC_GENERIC &nbsp;:= $(BASE_OSINC)OSINC_PLATFORM &nbsp;:= $(BASE_TOOLCHAIN)/lib/gcc/arm-poky-linux-gnueabi/4.3.3/includeOSINC_TARGET &nbsp;:= $(BASE_TOOLCHAIN)/arm-poky-linux-gnueabi/libc/usr/include
# ============================================================================
# Name of the compiler
# ----------------------------------------------------------------------------
COMPILER &nbsp;:= $(BASE_CGTOOLS)/arm-poky-linux-gnueabi-gccLD &nbsp;:= $(BASE_CGTOOLS)/arm-poky-linux-gnueabi-ld
CROSS_COMPILE &nbsp;:= arm-poky-linux-gnueabi-
export CROSS_COMPILE
# ARCHIVER2 - This denotes the archiver.
# ============================================================================
ARCHIVER &nbsp;:= $(BASE_CGTOOLS)/arm-poky-linux-gnueabi-ar
# ============================================================================
# LINKER - The compiler is used for linking purpose as well.
# ============================================================================
LINKER &nbsp;:= $(BASE_CGTOOLS)/arm-poky-linux-gnueabi-gcc</pre>Pour le fichier $DSPLINK/gpp/src/Rules.mk, changer (et adapter si besoin) &nbsp;:<pre>ifeq ("$(TI_DSPLINK_PLATFORM)", "OMAP3530")KERNEL_DIR &nbsp;:= ${HOME}/igep/linux-omap-2.6.28.10-igep0020b-2TOOL_PATH &nbsp;:= /usr/local/poky/eabi-glibc/bin
endif #ifeq ("$(TI_DSPLINK_PLATFORM)", "OMAP3530")
</pre>ainsi que &nbsp;:<pre>ifeq ("$(TI_DSPLINK_GPPOSPREFIX)", "uc")
CG_PREFIX = arm-linux-uclibcgnueabi-
MAKE_OPTS = ARCH=arm CROSS_COMPILE=$(TOOL_PATH)/arm-linux-uclibcgnueabi-
MAKE_OPTS = ARCH=arm CROSS_COMPILE=$(TOOL_PATH)/arm-poky-linux-gnueabi-
endif # ifeq ("$(TI_DSPLINK_GPPOSPREFIX)", "uc")
</pre>Pour le fichier $DSPLINK/make/DspBios/c64xxp_5.xx_linux.mk, changer (et adapter si besoin) &nbsp;:<pre># ----------------------------------------------------------------------------
# Base directory for the DSP OS
# ----------------------------------------------------------------------------
BASE_INSTALL &nbsp;:= $(HOME)/TIBASE_SABIOS &nbsp;:= $(BASE_INSTALL)/bios_5_41_03_17BASE_BUILDOS &nbsp;:= $(BASE_SABIOS)/packages/ti/bios
# ----------------------------------------------------------------------------
# Base directory for the XDC tools
# ----------------------------------------------------------------------------
XDCTOOLS_DIR &nbsp;:= $(BASE_INSTALL)/xdctools_3_15_00_50
# ----------------------------------------------------------------------------
# Base for code generation tools - compiler, linker, archiver etc.
# ----------------------------------------------------------------------------
BASE_CGTOOLS &nbsp;:= $(BASE_INSTALL)/TI_CGT_C6000_6.1.13BASE_CGTOOLSBIN &nbsp;:= $(BASE_CGTOOLS)/bin</pre> Aller ensuite dans le répertoire $DSPLINK/dsp/src et faire &nbsp;: <pre>make -s</pre> de même dans le répertoire $DSPLINK/gpp/src &nbsp;:<pre>make -s</pre>ce qui aura pour effet de compiler le module dsplinkk.ko (dans le répertoire $DSPLINK/gpp/export/BIN/Linux/OMAP3530/RELEASE)
Des programmes exemples se trouvent dans les répertoires $DSPLINK/dsp/src/samples et $DSPLINK/gpp/src/samples, à compiler avec
<pre>make</pre> === ''CMEM'' ===
'''NOTE:''' les versions 2.25 et 2.25.01.06 ont des soucis au niveau des ''ioctl'' [http://e2e.ti.com/support/arm174_microprocessors/omap_applications_processors/f/42/p/36278/126821.aspx#126821 voir ici], ce qui affecte notamment les manipulations de cache (writeback et invalidate). La version 2.25.02.08 est sensée corriger cela (à tester). Sinon, travailler sur les versions 2.24
 <br> ''CMEM'', ou ''contiguous memory manager'' permet d'allouer de la mémoire partagée entre ''ARM'' et ''DSP''. Il fait partie des ''linuxutils'', à télécharger [http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/linuxutils/index.html ici]. Aller dans le répertoire linuxutils_2_25_02_08/packages/ti/sdo/linuxutils/cmem et donner l'accès en écriture au fichier Rules.make &nbsp;:<pre>chmod +w Rules.make</pre>Puis éditer ce fichier et changer (adapter si besoin) &nbsp;:<pre># For "kernel_org" builds
MVTOOL_PREFIX=/usr/local/poky/eabi-glibc/bin/arm-poky-linux-gnueabi-
# For OMAP3530 2.6.29 Linux kernel
LINUXKERNEL_INSTALL_DIR=$(HOME)/igep/linux-omap-2.6.28.10-igep0020b-2
</pre> Puis faire<pre>make release</pre>pour compiler le module cmemk.ko (dans le réperoire ./src/module). === ''Framework Components'' ===
Les === ''Framework Components'' incluent entre autres les librairies ''DMAN3'' et ''ACPY3'', permettant les copies par ''DMA''. A télécharger [http://software-dl.ti.com/dsps/dsps_registered_sw/sdo_sb/targetcontent/FC/index.html ici] et à décompresser par exemple dans "$HOME/TI/framework_components_2_24_01". ===
Les ''Framework Components'' incluent entre autres les librairies ''DMAN3'' et ''ACPY3'', permettant les copies par ''DMA''. A télécharger [http://software-dl.ti.com/dsps/dsps_registered_sw/sdo_sb/targetcontent/FC/index.html ici] et à décompresser par exemple dans "$HOME/TI/framework_components_2_24_01".
=== ''Local Power Manager (LPM)'' ===<br>
=== ''Local Power Manager (LPM)'' fait aussi partie des ''Linux Utilities'', mais ne semble plus intégré dans les nouvelles versions. Il se trouve avec les anciennes versions de ''linuxutils'', [http://software-dl.ti.com/dsps/dsps_registered_sw/sdo_sb/targetcontent/linuxutils/old.html ici]. ===
''LPM'' permet de redémarrer le fait aussi partie des ''DSPLinux Utilities'' à la volée. En effet, par défaut ''DSPLink'' garde mais ne semble plus intégré dans la mémoire cache le programme exécuté par le ''DSP''les nouvelles versions. La même application peut donc être lancée plusieurs fois à la suite, par contre si une nouvelle application est lancée, il y aura plantage; d'où l'intérêt Il se trouve avec les anciennes versions de ''LPMlinuxutils'', [http://software-dl.ti.com/dsps/dsps_registered_sw/sdo_sb/targetcontent/linuxutils/old.html ici].
Aller ''LPM'' permet de redémarrer le ''DSP'' à la volée. En effet, par défaut ''DSPLink'' garde dans la mémoire cache le répertoire local_power_manager_1_24/packages/ti/bios/power/modules/omap3530/lpm et éditer programme exécuté par le Makefile pour changer:''DSP''. La même application peut donc être lancée plusieurs fois à la suite, par contre si une nouvelle application est lancée, il y aura plantage; d'où l'intérêt de ''LPM''.
Aller dans le répertoire local_power_manager_1_24/packages/ti/bios/power/modules/omap3530/lpm et éditer le Makefile pour changer: <pre>LINUXKERNEL_INSTALL_DIR = $(HOME)/igep/linux-omap-2.6.28.10-igep0020b-2
MVTOOL_PREFIX = /usr/local/poky/eabi-glibc/bin/arm-poky-linux-gnueabi-
DSPLINK_REPO = $(HOME)/igep/dsplink_linux_1_63
</pre>puis compiler <pre>make</pre> le module lpm_omap3530.ko sera fait dans le répertoire courent.
puis compiler<pre>make</pre>le module lpm_omap3530Les exécutables lpmON.ko sera fait x470uC et lpmOFF.x470uC sont déjà compilés et se trouvent dans le répertoire courent.les répertoires:
Les exécutables lpmON.x470uC et lpmOFF.x470uC sont déjà compilés et se trouvent dans les répertoires:local_power_manager_1_24/packages/ti/bios/power/test/bin/ti_platforms_evm3530/linux/debug/
local_power_manager_1_24/packages/ti/bios/power/test/bin/ti_platforms_evm3530/linux/debugrelease/
local_power_manager_1_24/packages/ti/bios/power/test/bin/ti_platforms_evm3530/linux/release/=== Librairies ===
=== Librairies ===Les principales librairies sont les suivantes:
Les principales librairies sont les suivantes:*[http://focus.ti.com/docs/toolsw/folders/print/sprc265.html dsplib]*[http://focus.ti.com/docs/toolsw/folders/print/sprc264.html dsp image lib]
*[http://focus.ti.com/docs/toolsw/folders/print/sprc542.html IQ Math]
A noter, pour les dsplib v210, le lien Linux semble ne pas marcher. A partir de la version Windows, il faut changer le fichier C64x+DSPLIB/dsplib_v210/dsplib64plus.h. Tous les chemins relatifs sont en notation Windows "\" qu'il faut remplacer par des "/". 
<!-- pour loop fft, changer le fichier sources pour mettre le chemin des fichiers c de dsplib
changer aussi le chemin des .h dans tskloop.c -->
= Configurer ''DSPLINK'' pour la compilation de projets =
Cette partie explique comment rajouter les diverses librairies à l'environnement ''DSPLINK''
=== ''Includes'' ===
Éditer le fichier $DSPLINK/make/DspBios/c64xxp_5.xx_linux.mk pour rajouter les répertoires ''includes'': <pre># ----------------------------------------------------------------------------
# Base directory for include files
# ----------------------------------------------------------------------------
BASE_OSINC &nbsp;:= $(BASE_BUILDOS)/includeBASE_CGTOOLSINC &nbsp;:= $(BASE_CGTOOLS)/includeBASE_RTDXINC &nbsp;:= $(BASE_RTDX)/include/c6000BASE_PSLINC &nbsp;:= $(BASE_PSL)/includeBASE_CSLINC &nbsp;:=
BASE_XDCINC := $(BASE_INSTALL)/xdctools_3_15_00_50/packages
BASE_FCINC := $(BASE_INSTALL)/framework_components_2_24_01/packages
BASE_IQMATHINC := $(BASE_INSTALL)/IQmath_v213/include
OSINC_GENERIC &nbsp;:= $(BASE_OSINC)OSINC_PLATFORM &nbsp;:= $(BASE_CGTOOLSINC) $(BASE_RTDXINC) \
$(BASE_PSLINC) $(BASE_CSLINC) $(BASE_XDCINC) $(BASE_FCINC) $(BASE_FCTOOLINC) $(BASE_IMGLIBINC) $(BASE_IQMATHINC)
</pre>Les variables OSINC_GENERIC et OSINC_PLATFORM permettent de définir les répertoires où ''DSPLINK'' cherchera les ''.h''.
=== Librairies ===
Par défaut, ''DSPLINK'' cherche les librairies dans les répertoires:<pre>$DSPLINK/dsp/BUILD/OMAP3530_0/EXPORT/DEBUG/
$DSPLINK/dsp/BUILD/OMAP3530_0/EXPORT/RELEASE/
</pre>Il faut donc y copier les différentes libraires:<pre>cp $HOME/TI/framework_components_2_24_01/packages/ti/sdo/fc/dman3/lib/debug/dman3.a64P $DSPLINK/dsp/BUILD/OMAP3530_0/EXPORT/DEBUG/
cp $HOME/TI/framework_components_2_24_01/packages/ti/sdo/fc/dman3/lib/release/dman3.a64P $DSPLINK/dsp/BUILD/OMAP3530_0/EXPORT/RELEASE/
cp $HOME/TI/framework_components_2_24_01/packages/ti/sdo/fc/acpy3/lib/debug/acpy3.a64P $DSPLINK/dsp/BUILD/OMAP3530_0/EXPORT/DEBUG/
cp $HOME/TI/imglib_v201/lib/target/imglib2.l64P $DSPLINK/dsp/BUILD/OMAP3530_0/EXPORT/DEBUG/
cp $HOME/TI/imglib_v201/lib/target/imglib2.l64P $DSPLINK/dsp/BUILD/OMAP3530_0/EXPORT/RELEASE/
</pre>= Configure ''CodeBlocks'' for ''ARM'' =
= Configure This part explains how to setup ''CodeBlocks'' for to develop programs using ''ARMdsplink''=library.
This part explains how Go to setup ''CodeBlockssettings/compiler and debugger'' to develop programs using menu, choose ''dsplinkGNU ARM GCC compiler'' libraryas compiler.You should see the following window:
Go to ''settings/compiler and debugger'' menu, choose ''GNU ARM GCC compiler'' as compiler[[Image:Settings. You should see the following window:jpg|center|500px]]
[[Image:settings.jpg|center|500px]] Select ''Search directories'' tab and ''Compiler''. Then add the following directories (and adapt it if necessary):<pre>/usr/local/poky/eabi-glibc/arm-none-linux-gnueabi/lib
$(HOME)/igep/dsplink_linux_1_63/dsplink/gpp/inc/sys/Linux
$(HOME)/igep/dsplink_linux_1_63/dsplink/gpp/export/INCLUDE/Linux/OMAP3530/usr
</pre>Which should give the following result: [[Image:Compiler.jpg|center|500px]]
[[ImageIn ''Search directories'', now choose ''Linker'' and add the following directories: <pre>$(HOME)/dsplink_linux_1_63/dsplink/gpp/inc/sys/Linux</pre> Which should give the following result:compiler.jpg|center|500px]]
In ''Search directories'', now choose ''[[Image:Linker'' and add the following directories:<pre>$(HOME)/dsplink_linux_1_63/dsplink/gpp/inc/sys/Linux</pre>Which should give the following result:.jpg|center|500px]]
[[ImageChoose ''Toolchain executables'' tab and ''Compiler's installations directory'': <pre>/usr/local/poky/eabi-glibc/</pre> Then, enter the ''Program Files'' as follows:linker.jpg|center|500px]]
Choose ''Toolchain executables'' tab and ''Compiler's installations directory'':<pre>/usr/local/poky/eabi-glibc/</pre>Then, enter the ''Program Files'' as follows[[Image:Executables.jpg|center|500px]]
[[Image:executables.jpg|center|500px]]= References =
= 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]