Personal tools

Log in

Changes

From IGEP - ISEE Wiki

Jump to: navigation, search

How to setup a development environment

14,392 bytes added, 11:12, 24 March 2010
m
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_environment#References|References]]). All files will be installed in the $HOME directory.
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].
=== Copier Copy kernel and ''rootfs'' in memory card === = Configure ''CodeBlocks'' for ''ARM''= Go to ''settings/compiler and debugger'' menu, choose ''GNU ARM GCC compiler'' as compiler. You should see the following window: [[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]] In ''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: [[Image: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]]  = Chaine de développement croisée ''DSP'' = 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]. === ''Code generation tools'' === ''TI CGT'' est le cross compilateur pour le DSP. Récupérer la dernière version [https://www-a.ti.com/downloads/sds_support/TICodegenerationTools/download.htm ici] et installer (par exemple dans le répertoire $HOME/TI/TI_CGT). === ''DSP BIOS'' === ''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_sw/sdo_sb/targetcontent/dspbios/index.html ici] et installer (par exemple dans le répertoire $HOME/TI/BIOS). === ''XDC Tools'' === A télécharger [http://software-dl.ti.com/dsps/dsps_registered_sw/sdo_sb/targetcontent/rtsc/index.html ici] et installer (par exemple dans le répertoire '$HOME/TI/xdctools). === ''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 : <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 :<pre>perl dsplinkcfg.pl</pre>et ajouter les options au fur et à mesure. Si tout se passe bien, le message suivant devrait apparaitre : <pre>Please edit the following files for toolchains, kernel sources, etc changes.GPP side distribution file: $DSPLINK/make/Linux/omap3530_2.6.mkGPP side distribution file: $DSPLINK/gpp/src/Rules.mkDSP 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 :=${HOME}/igep/linux-omap-2.6.28.10-igep0020b-2 # ----------------------------------------------------------------------------# Base for toolchain# ----------------------------------------------------------------------------BASE_TOOLCHAIN := /usr/local/poky/eabi-glibc # ----------------------------------------------------------------------------# Base directory for include files provided by GPP OS# ----------------------------------------------------------------------------BASE_OSINC := $(BASE_BUILDOS)/include OSINC_GENERIC := $(BASE_OSINC)OSINC_PLATFORM := $(BASE_TOOLCHAIN)/lib/gcc/arm-poky-linux-gnueabi/4.3.3/includeOSINC_TARGET := $(BASE_TOOLCHAIN)/arm-poky-linux-gnueabi/libc/usr/include # ============================================================================# COMPILER# ============================================================================ # ----------------------------------------------------------------------------# Name of the compiler# ----------------------------------------------------------------------------COMPILER := $(BASE_CGTOOLS)/arm-poky-linux-gnueabi-gccLD := $(BASE_CGTOOLS)/arm-poky-linux-gnueabi-ld CROSS_COMPILE := arm-poky-linux-gnueabi-export CROSS_COMPILE # ============================================================================# ARCHIVER2 - This denotes the archiver.# ============================================================================ARCHIVER := $(BASE_CGTOOLS)/arm-poky-linux-gnueabi-ar # ============================================================================# LINKER - The compiler is used for linking purpose as well.# ============================================================================LINKER := $(BASE_CGTOOLS)/arm-poky-linux-gnueabi-gcc</pre>Pour le fichier $DSPLINK/gpp/src/Rules.mk, changer (et adapter si besoin) :<pre>ifeq ("$(TI_DSPLINK_PLATFORM)", "OMAP3530")KERNEL_DIR := ${HOME}/igep/linux-omap-2.6.28.10-igep0020b-2TOOL_PATH := /usr/local/poky/eabi-glibc/binendif #ifeq ("$(TI_DSPLINK_PLATFORM)", "OMAP3530")</pre>ainsi que :<pre>ifeq ("$(TI_DSPLINK_GPPOSPREFIX)", "uc")CG_PREFIX = arm-linux-uclibcgnueabi-MAKE_OPTS = ARCH=arm CROSS_COMPILE=$(TOOL_PATH)/arm-linux-uclibcgnueabi-elseCG_PREFIX = arm-poky-linux-gnueabi-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) :<pre># ----------------------------------------------------------------------------# Base directory for the DSP OS# ----------------------------------------------------------------------------BASE_INSTALL := $(HOME)/TIBASE_SABIOS := $(BASE_INSTALL)/bios_5_41_03_17BASE_BUILDOS := $(BASE_SABIOS)/packages/ti/bios # ----------------------------------------------------------------------------# Base directory for the XDC tools# ----------------------------------------------------------------------------XDCTOOLS_DIR := $(BASE_INSTALL)/xdctools_3_15_00_50 # ----------------------------------------------------------------------------# Base for code generation tools - compiler, linker, archiver etc.# ----------------------------------------------------------------------------BASE_CGTOOLS := $(BASE_INSTALL)/TI_CGT_C6000_6.1.13BASE_CGTOOLSBIN := $(BASE_CGTOOLS)/bin</pre> Aller ensuite dans le répertoire $DSPLINK/dsp/src et faire : <pre>make -s</pre> de même dans le répertoire $DSPLINK/gpp/src :<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   ''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 noyau répertoire linuxutils_2_25_02_08/packages/ti/sdo/linuxutils/cmem et donner l'accès en écriture au fichier Rules.make :<pre>chmod +w Rules.make</pre>Puis éditer ce fichier et changer (adapter si besoin) :<pre># For "kernel_org" buildsMVTOOL_PREFIX=/usr/local/poky/eabi-glibc/bin/arm-poky-linux-gnueabi- # Equivalent path for uClibc compiler toolsUCTOOL_PREFIX=/usr/local/poky/eabi-glibc/bin/arm-poky-linux-gnueabi- # For OMAP3530 2.6.29 Linux kernelLINUXKERNEL_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".  === ''rootfsLocal Power Manager (LPM)'' === ''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 ''DSP'' à la volée. En effet, par défaut ''DSPLink'' garde dans la carte mémoire cache le programme exécuté par le ''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-2MVTOOL_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. 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/release/ === Librairies ==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 dsplibchanger 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 := $(BASE_BUILDOS)/includeBASE_CGTOOLSINC := $(BASE_CGTOOLS)/includeBASE_RTDXINC := $(BASE_RTDX)/include/c6000BASE_PSLINC := $(BASE_PSL)/includeBASE_CSLINC :=BASE_XDCINC := $(BASE_INSTALL)/xdctools_3_15_00_50/packagesBASE_FCINC := $(BASE_INSTALL)/framework_components_2_24_01/packagesBASE_FCTOOLINC := $(BASE_INSTALL)/framework_components_2_24_01/fctools/packagesBASE_IMGLIBINC := $(BASE_INSTALL)/imglib_v201/includeBASE_IQMATHINC := $(BASE_INSTALL)/IQmath_v213/include OSINC_GENERIC := $(BASE_OSINC)OSINC_PLATFORM := $(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/framework_components_2_24_01/packages/ti/sdo/fc/acpy3/lib/release/acpy3.a64P $DSPLINK/dsp/BUILD/OMAP3530_0/EXPORT/RELEASE/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> =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]
0
edits