EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: using epics-base with yocto
From: "Seeberger, John T CIV USN NAS PAX MD \(USA\) via Tech-talk" <[email protected]>
To: "[email protected]" <[email protected]>
Date: Mon, 21 Oct 2019 18:31:52 +0000
Setup your env variables as outlined in epics documentation.
things like $EPICS_BASE, EPICS_HOST_ARCH etc
I build epics base and extensions as needed for my application. I used info gathered on forum to set up the configure/CONFIG_SITE:
CROSS_COMPILER_TARGET_ARCHS=linux-arm

Modify configure/os/CONFIG_SITE.linux-x86.linux-arm:
GNU_TARGET = aarch64-linux-gnu (determines architecture, this is 64 bit)
GNU_DIR = /sandbox/Xilinx/petalinux/petalinux-v2018.3-final/tools/linux-i386/aarch64-linux-gnu

Download the petalinux-tools and approriate bsp for dev board from Xilinx
Before build source the petalinux-ver/settings.sh so that the compilers are in path.
Currently I use aarch64 compile for an ultrascale project on a zcu106 dev board. After epics base is built. I also built some extensions.

Petalinux use yocto build

first create project:
petalinux-create -t project -s PATH_TO_DOWNLOADED_BSP/xilinx-zcu102-v2018.3-final.bsp

will create default project in folder
xilinx-zcu102-v2018.3

In my case I need an extra serial port for my ioc app so I enable the usbserial and pl2303 module
this give me /dev/ttyUSB0 when usb->serial cable used
Modify kernel:
petalinux-configure -c kernel
turn on the pl2303 module and whatever else needed
you can use
/pl2303 for search

rebuild petalinux system
petalinux-build

Now to integrate epics and epics app into petalinux:
I created 3 projects. This create the recipe templates in:

project-spec/meta-user/recipes-apps/

binaries needed for base:
petalinux-create -t apps --template install --name epics --enable

lib's needed
petalinux-create -t apps --template install --name epicsLib --enable

my ioc app targeting linux-arm
petalinux-create -t apps --template install --name iocaoasim --enable


Now look at epics
cd epics.
copy the $EPICS_BASE/bin/linux-arm binaries to files/

ls files:
acctst      caEventRate  cainfo     caput       caRepeater.service  catime
caConnTest  caget        camonitor  caRepeater  casw                softIoc

Now look at format of epics.bb
# This file is the epics recipe.
#

SUMMARY = "Simple epics application"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "file://acctst \
           file://caConnTest \
           file://caEventRate \
           file://caget \
           file://cainfo \
           file://camonitor \
           file://caput \
           file://caRepeater \
           file://caRepeater.service \
           file://casw \
           file://catime \
           file://softIoc \
        "

S = "${WORKDIR}"
#DEPENDS += "epicslib"
RDEPENDS_${PN} += "epicslib"

do_install() {
             install -d ${D}/${bindir}
             install -m 0755 ${S}/acctst ${D}/${bindir}
             install -m 0755 ${S}/caConnTest ${D}/${bindir}
             install -m 0755 ${S}/caEventRate ${D}/${bindir}
             install -m 0755 ${S}/caget ${D}/${bindir}
             install -m 0755 ${S}/cainfo ${D}/${bindir}
             install -m 0755 ${S}/camonitor ${D}/${bindir}
             install -m 0755 ${S}/caput ${D}/${bindir}
             install -m 0755 ${S}/caRepeater ${D}/${bindir}
             install -m 0755 ${S}/caRepeater.service ${D}/${bindir}
             install -m 0755 ${S}/casw ${D}/${bindir}
             install -m 0755 ${S}/catime ${D}/${bindir}
             install -m 0755 ${S}/softIoc ${D}/${bindir}
}

Next the epicslib app. The two could easily be combined but its how I did it.
The libs from the epicsbuild/lib/linux-arm + the lib's linux-arm of needed extensions
in this case libstream libasyn libgdd

I got errors using versioned and yocto tools, so I ended up using non versioned.
when using oe_soinstall as outlined in documentation it complains lib's are not versioned.

file epicslib.bb:
SUMMARY = "Simple epicslib application"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

#SRC_URI = "file://libca.so.3.15.5 \
#          file://libcas.so.3.15.5 \
#          file://libCom.so.3.15.5 \
#          file://libdbCore.so.3.15.5 \
#          file://libdbRecStd.so.3.15.5 \
#          file://libgdd.so.3.15.5 \
#       "

SRC_URI = "file://libca.so \
           file://libcas.so \
           file://libCom.so \
           file://libdbCore.so \
           file://libdbRecStd.so \
           file://libgdd.so \
           file://libasyn.so \
           file://libstream.so \
        "
S = "${WORKDIR}"

do_install() {
             install -d ${D}/${libdir}
#            oe_soinstall ${S}/libca.so.3.15.5 ${D}/${libdir}
#            oe_soinstall ${S}/libcas.so.3.15.5 ${D}/${libdir}
#            oe_soinstall ${S}/libCom.so.3.15.5 ${D}/${libdir}
#            oe_soinstall ${S}/libdbCore.so.3.15.5 ${D}/${libdir}
#            oe_soinstall ${S}/libdbRecStd.so.3.15.5 ${D}/${libdir}
#            oe_soinstall ${S}/libgdd.so.3.15.5 ${D}/${libdir}
             install ${S}/libca.so ${D}/${libdir}
             install ${S}/libcas.so ${D}/${libdir}
             install ${S}/libCom.so ${D}/${libdir}
             install ${S}/libdbCore.so ${D}/${libdir}
             install ${S}/libdbRecStd.so ${D}/${libdir}
             install ${S}/libgdd.so ${D}/${libdir}
             install ${S}/libasyn.so ${D}/${libdir}
             install ${S}/libstream.so ${D}/${libdir}
}

Lastly the ioc application app. In this case a simulation of an aviation six pack. The application is built for X86 desktop testing
and embedded hardware. This recipe just copies the whole application to the rootfs. The startup scrips modified to load the arm version.

file iocaoasim.bb:

#
# This file is the iocaoasim recipe.
#

SUMMARY = "Simple iocaoasim application"
SECTION = "PETALINUX/apps"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

INHIBIT_PACKAGE_STRIP = "1"

SRC_URI += " \
        file://ioc_AOA_sim_aarch64 \
        "

homedir = "/home/root"

RDEPENDS_${PN} += "epicslib"

S = "${WORKDIR}"

do_install() {
                install -d ${D}/home/root
                cp -r ${WORKDIR}/ioc_AOA_sim_aarch64 ${D}/home/root
}
FILES_${PN} += "/home/root/*"


Then:
petalinux-build
petalinux-package --boot --format BIN --fsbl images/linux/zynqmp_fsbl.elf \
--uboot images/linux/u-boot.elf --pmufw images/linux/pmufw.elf \
--fpga images/linux/*.bit --force

copy images/BOOT.BIN and image.ub to sdcard and boot on dev board



--------


Hello Dirk:
Many thanks for your help!
Did you implement a layer/recipes for yocto?
Regards, Mariano

-----Original Message-----
From: [email protected] <[email protected]> On
Behalf Of Dirk Zimoch
Sent: Wednesday, April 25, 2018 10:19 AM
To: [email protected]
Subject: Re: using epics-base with yocto

Hello Mariano,

I compile EPICS with Yocto 2.1 / Petalinux toolchain for the XILINX Zynq
Ultrascale.

My config file is attached. But it needs 3 additional macros:

GNU_HOST_ARCH=i686
GNU_HOST_OS=linux
are defined in my CONFIG_SITE.linux-x86.Common

GNU_HOST_ARCH_64=x86_64
is defined in my CONFIG_SITE.linux-x86_64.Common

(I use them in several embedded Linux cross compiler configs and did not
want to pull too many host specifics into a CONFIG.Common.* file.)

Also be aware that you have probably installed yocto somewhere else. Fix
SDK_DIR accordingly.

I could use this cross compiler only on a 64 bit host, but that should not
be much of a problem nowadays.

Best regards,
Dirk

On 24.04.2018 15:45, Mariano Ruiz wrote:
> Dear tech-talkers,
>
> I am trying to create a Linux embedded distribution using Yocto
> including epics-base.
>
> Does anyone have a yocto meta-layer already implemented?
>
> Thanks a lot
>
> Mariano Ruiz
>
> Professor
>
> Technical University of Madrid
>
>
>
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campai
gn=sig-email&utm_content=emailclient&utm_term=icon>
>       Virus-free. www.avast.com
> <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_
> campaign=sig-email&utm_content=emailclient&utm_term=link>
>
>
> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>


---

Subject:        RE: using epics-base with yocto
From:   "Mariano Ruiz" <[email protected]<mailto:mariano.ruiz_at_upm.es>>
To:     "'Dirk Zimoch'" <[email protected]<mailto:dirk.zimoch_at_psi.ch>>, <[email protected]<mailto:tech-talk_at_aps.anl.gov>>
Date:   Wed, 25 Apr 2018 10:25:09 +0200

Navigate by Date:
Prev: record logic tips Davis, Mark via Tech-talk
Next: Re: record logic tips Peterson, Kevin M. via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: [EXTERNAL] record logic tips Pearson, Matthew R. via Tech-talk
Next: asynR4-37 available Mark Rivers via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  <20192020  2021  2022  2023  2024 
ANJ, 21 Oct 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·