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: Re: Linux DMA driver and device support for Xilinx FPGA
From: "Madden, Timothy J. via Tech-talk" <[email protected]>
To: "[email protected]" <[email protected]>, "[email protected]" <[email protected]>
Date: Mon, 11 Nov 2019 18:43:28 +0000
We at APS RF group are working with the controls group at SNS, Oakridge Lab. We have a working xilinx FPGA that does DMA over PCI, a Linux kernel driver, and EPICS support.

There is a paper published in LLRF2019 Archive at
arXiv.org




Tim Madden
Argonne Lab



From: Tech-talk <[email protected]> on behalf of [email protected] <[email protected]>
Sent: Monday, November 11, 2019 11:43 AM
To: [email protected] <[email protected]>
Subject: Tech-talk Digest, Vol 13, Issue 455
 
Send Tech-talk mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://mailman.aps.anl.gov/mailman/listinfo/tech-talk
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Tech-talk digest..."


Today's Topics:

   1. Re: Linux DMA driver and device support for Xilinx FPGA
      (Hinko Kocevar)
   2. Re: Linux DMA driver and device support for Xilinx FPGA
      (Cobb, Tom (DLSLtd,RAL,LSCI))
   3. using stream failed (=?gb18030?B?t+fQ0Muu?=)
   4. Segmentation fault when Record Processing in StreamDevice
      (Donny?Domagoj Cosic)
   5. RE: Segmentation fault when Record Processing in StreamDevice
      (Mark Rivers)


----------------------------------------------------------------------

Message: 1
Date: Mon, 11 Nov 2019 09:03:37 +0000
From: Hinko Kocevar <[email protected]>
To: "Ha, Kiman" <[email protected]>, "[email protected]"
        <[email protected]>
Subject: Re: Linux DMA driver and device support for Xilinx FPGA
Message-ID: <[email protected]>
Content-Type: text/plain; charset="Windows-1252"

> Does anyone have to experience generic DMA support for the  Xilinx Zynq or Zynq ultrascal+ core or have a plan for the development?

Not sure what you mean by "generic" DMA support. Couple of software and firmware developers here at ESS are working on a firmware using XDMA ip core, that is supported by Xilinx xdma kernel driver (sources online). Running on the Ultrascale FPGA (not zynq) on an AMC sitting in a uTCA crate. This means we are not developing our own DMA / PCIe core but utilizing Xilinx one, available free of charge.
Some preliminary tested are showing ~88% PCIe link utilization when transferring data in bulk over DMA; i.e. Gen3 4 lanes rate is ~3.5 GB/s card to host.

All of this is still in prototyping stage.

We have no EPICS driver for this, yet. The plan is to, first develop userpace library that would abstract away details and let the user work with clocks, triggers, data channels..; compared to to "raw FPGA registers". Then, the EPICS driver will be built on top of this userspace library.

//hinko
________________________________________
From: Tech-talk <[email protected]> on behalf of Ha, Kiman via Tech-talk <[email protected]>
Sent: Saturday, November 9, 2019 11:22:03 PM
To: [email protected]
Subject: Linux DMA driver and device support for Xilinx FPGA

Hello,

I am looking for the DMA driver and epics device support module for the Xilinx Zynq and Zynq ultrascal+ core.
Does anyone have to experience generic DMA support for the  Xilinx Zynq or Zynq ultrascal+ core or have a plan for the development?

For example, we developed four channel 500 MHz digitizer for the bunch by bunch beam position monitor (performance looks good, < 300 nm turn by tune position for the NSLS-II).
Currently, prototype supports an FPGA logic block ram (BRAM, 8 K/16 K * 16bit * 4, 500MHz clock rate) .
I have plan provides at least 1 M * 16bit * 4)  or 2 M points from the external DDR3/4 memory (FPGA side we implemented DMA core, but Linux part needs help) .
Because our physics group wants to minimum 1000 turns BxB position data.
If we have an epics device support, that?s very valuable for many diagnostics applications, especially beam diagnostics and physics applications.

Thanks,
Kiman




------------------------------

Message: 2
Date: Mon, 11 Nov 2019 11:34:38 +0000
From: "Cobb, Tom (DLSLtd,RAL,LSCI)" <[email protected]>
To: "Mooney, Tim M. via Tech-talk" <[email protected]>, "Ha,
        Kiman" <[email protected]>
Subject: Re: Linux DMA driver and device support for Xilinx FPGA
Message-ID:
        <DB7PR01MB49667A9DBFC76C2B9A0C266ED6740@DB7PR01MB4966.eurprd01.prod.exchangelabs.com>
       
Content-Type: text/plain; charset="windows-1252"

Hi Kiman,

Just a clarification on PandA, it does indeed have its own kernel driver but I didn't write it. The VHDL side was written by Isa Uzun (no longer at Diamond), and the kernel driver was written by Michael Abbott (copied).  The DMA engine is a special streaming engine built into the firmware.

Thanks,
Tom

________________________________
From: Tech-talk <[email protected]> on behalf of Mooney, Tim M. via Tech-talk <[email protected]>
Sent: 09 November 2019 23:30
To: [email protected] <[email protected]>; Ha, Kiman <[email protected]>
Subject: Re: Linux DMA driver and device support for Xilinx FPGA

Hi Kiman,

softGlueZynq uses a DMA component in the FPGA with a PetaLinux kernel driver from Xilinx, and a kernal-to-user-space driver written by a Xilinx engineer, though not supplied with PetaLinux.  It won't do the transfer rate you describe, however.  The estimate I recall was around 240 MB/s to kernel space, and around 130 MB/s to user space.  In softGlueZynq, the DMA transfer is initiated by an aSub record which also stores the data.  Everything - FPGA content, PetaLinux config and code, and EPICS code - is here: https://github.com/epics-modules/softGlueZynq

As you know, the PandaBox also does DMA with the Zynq.  I don't know the details, except that Tom Cobb wrote his own kernel driver.

I think both your and our detector groups are getting higher data-transfer speeds using transceivers.

Tim Mooney ([email protected]) (630)252-5417
Beamline Controls Group (www.aps.anl.gov)
Advanced Photon Source, Argonne National Lab

________________________________
From: Tech-talk <[email protected]> on behalf of Ha, Kiman via Tech-talk <[email protected]>
Sent: Saturday, November 9, 2019 4:22 PM
To: [email protected] <[email protected]>
Subject: Linux DMA driver and device support for Xilinx FPGA


Hello,



I am looking for the DMA driver and epics device support module for the Xilinx Zynq and Zynq ultrascal+ core.

Does anyone have to experience generic DMA support for the  Xilinx Zynq or Zynq ultrascal+ core or have a plan for the development?



For example, we developed four channel 500 MHz digitizer for the bunch by bunch beam position monitor (performance looks good, < 300 nm turn by tune position for the NSLS-II).

Currently, prototype supports an FPGA logic block ram (BRAM, 8 K/16 K * 16bit * 4, 500MHz clock rate) .

I have plan provides at least 1 M * 16bit * 4)  or 2 M points from the external DDR3/4 memory (FPGA side we implemented DMA core, but Linux part needs help) .

Because our physics group wants to minimum 1000 turns BxB position data.

If we have an epics device support, that?s very valuable for many diagnostics applications, especially beam diagnostics and physics applications.



Thanks,

Kiman





--
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail.
Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd.
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.aps.anl.gov/pipermail/tech-talk/attachments/20191111/e65ca278/attachment.html>

------------------------------

Message: 3
Date: Sun, 10 Nov 2019 20:17:21 +0800
From: "=?gb18030?B?t+fQ0Muu?=" <[email protected]>
To: "=?gb18030?B?dGVjaC10YWxr?=" <[email protected]>
Subject: using stream failed
Message-ID: <[email protected]>
Content-Type: text/plain; charset="gb18030"

Hi all,
&nbsp;&nbsp; I met a series of problems when using stream.
&nbsp;&nbsp; centOS 7(64). asyn and stream, both them was downloaded in git, so i have no idea about version.

I did?
makeBaseApp.pl -t example test&nbsp;&nbsp;&nbsp;&nbsp;
makeBaseApp.pl -i -t example test&nbsp;&nbsp;&nbsp; (I want create the example first)
modify configre/RELEASE(add asyn,sream), testApp/src/xxxSupport.dbd(following), testApp/src/Makefile(following), st.cmd(following).&nbsp;&nbsp;

Answer:
Test example was good, but failed after modify.

My quesiton:
The test(example) worked well when I did not add the stream. Why the message came out,"unknow type ai,aai,..." after add stream.

I did set epicsEnvSet "STREAM_PROTOCOL_PATH" "/opt/test/db" in st.cmd. But it seem that did not work, the PATH was still ".".

Thank you so much
Feng W


Here is some information of mine.
-------------
Directory
---------
/opt
&nbsp;&nbsp; base-3.15.6/
&nbsp;&nbsp; extensions/
&nbsp;&nbsp; base@
&nbsp;&nbsp; .swp
&nbsp;&nbsp; modules/
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; asyn/
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; calc/
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; seq/
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stream/
&nbsp;&nbsp; test/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # my file
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bin/
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; configure/
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; db/
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dbd/
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; include/
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iocBoot/
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; lib/
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; testApp/
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Makefile


-------------------
testApp/src/xxxSupport.dbd
--------------------
include "xxxRecord.dbd"
device(xxx,CONSTANT,devXxxSoft,"SoftChannel")
include "stream.dbd"
registrar(drvAsynIPPortRegisterCommands)
registrar(drvAsynSerialPortRegisterCommands)

#include "base.dbd"
##include "asyn.dbd"


------------------
testApp/src/Makefile
------------------
TOP=../..

include $(TOP)/configure/CONFIG
#----------------------------------------
#&nbsp; ADD MACRO DEFINITIONS BELOW HERE

# xxxRecord.h will be created from xxxRecord.dbd
DBDINC += xxxRecord

# Install xxxSupport.dbd into <top&gt;/dbd
DBD += xxxSupport.dbd

# Build an IOC support library
LIBRARY_IOC += testSupport

# Compile and add the code to the support library
testSupport_SRCS += xxxRecord.c
testSupport_SRCS += devXxxSoft.c

# Link locally-provided code into the support library,
# rather than directly into the IOC application.
# This is required for Windows DLL builds.
testSupport_SRCS += dbSubExample.c
testSupport_SRCS += testHello.c
testSupport_SRCS += initTrace.c

testSupport_LIBS += $(EPICS_BASE_IOC_LIBS)


# Build the IOC application
PROD_IOC = test

# test.dbd will be created and installed
DBD += test.dbd

# test.dbd will include these files:
test_DBD += base.dbd
test_DBD += xxxSupport.dbd
test_DBD += dbSubExample.dbd
test_DBD += testHello.dbd
test_DBD += initTrace.dbd

test_DBD += stream.dbd
test_DBD += asyn.dbd
test_DBD += drvAsynSerialPort.dbd

# test_registerRecordDeviceDriver.cpp derives from test.dbd
test_SRCS += test_registerRecordDeviceDriver.cpp

# Build the main IOC entry point where needed
test_SRCS_DEFAULT += testMain.cpp
test_SRCS_vxWorks += -nil-

# Link in the code from our support library
test_LIBS += testSupport

test_LIBS += asyn stream
#test_LIBS += calc

# To build SNL programs, SNCSEQ must be defined
# in the <top&gt;/configure/RELEASE file
ifneq ($(SNCSEQ),)
&nbsp;&nbsp;&nbsp; # Build sncExample into testSupport
&nbsp;&nbsp;&nbsp; sncExample_SNCFLAGS += +r
&nbsp;&nbsp;&nbsp; test_DBD += sncExample.dbd
&nbsp;&nbsp;&nbsp; # A .stt sequence program is *not* pre-processed:
&nbsp;&nbsp;&nbsp; testSupport_SRCS += sncExample.stt
&nbsp;&nbsp;&nbsp; testSupport_LIBS += seq pv
&nbsp;&nbsp;&nbsp; test_LIBS += seq pv

&nbsp;&nbsp;&nbsp; # Build sncProgram as a standalone program
&nbsp;&nbsp;&nbsp; PROD_HOST += sncProgram
&nbsp;&nbsp;&nbsp; sncProgram_SNCFLAGS += +m
&nbsp;&nbsp;&nbsp; # A .st sequence program *is* pre-processed:
&nbsp;&nbsp;&nbsp; sncProgram_SRCS += sncProgram.st
&nbsp;&nbsp;&nbsp; sncProgram_LIBS += seq pv
&nbsp;&nbsp;&nbsp; sncProgram_LIBS += $(EPICS_BASE_HOST_LIBS)
endif

# Finally link IOC to the EPICS Base libraries
test_LIBS += $(EPICS_BASE_IOC_LIBS)

include $(TOP)/configure/RULES
#----------------------------------------
#&nbsp; ADD EXTRA GNUMAKE RULES BELOW HERE

include $(TOP)/configure/CONFIG
#----------------------------------------
#&nbsp; ADD MACRO DEFINITIONS BELOW HERE

# xxxRecord.h will be created from xxxRecord.dbd
DBDINC += xxxRecord

# Install xxxSupport.dbd into <top&gt;/dbd
DBD += xxxSupport.dbd

# Build an IOC support library
LIBRARY_IOC += testSupport

# Compile and add the code to the support library
testSupport_SRCS += xxxRecord.c
testSupport_SRCS += devXxxSoft.c
# Link locally-provided code into the support library,
# rather than directly into the IOC application.
# This is required for Windows DLL builds.
testSupport_SRCS += dbSubExample.c
testSupport_SRCS += testHello.c
testSupport_SRCS += initTrace.c

testSupport_LIBS += $(EPICS_BASE_IOC_LIBS)


# Build the IOC application
PROD_IOC = test

# test.dbd will be created and installed
DBD += test.dbd
# test.dbd will include these files:
test_DBD += base.dbd
test_DBD += xxxSupport.dbd
test_DBD += dbSubExample.dbd
test_DBD += testHello.dbd
test_DBD += initTrace.dbd

test_DBD += stream.dbd
test_DBD += asyn.dbd
test_DBD += drvAsynSerialPort.dbd

# test_registerRecordDeviceDriver.cpp derives from test.dbd
test_SRCS += test_registerRecordDeviceDriver.cpp

# Build the main IOC entry point where needed
test_SRCS_DEFAULT += testMain.cpp
test_SRCS_vxWorks += -nil-

# Link in the code from our support library
test_LIBS += testSupport

test_LIBS += asyn stream
#test_LIBS += calc

# To build SNL programs, SNCSEQ must be defined
# in the <top&gt;/configure/RELEASE file
ifneq ($(SNCSEQ),)
&nbsp;&nbsp;&nbsp; # Build sncExample into testSupport
&nbsp;&nbsp;&nbsp; sncExample_SNCFLAGS += +r
&nbsp;&nbsp;&nbsp; test_DBD += sncExample.dbd
&nbsp;&nbsp;&nbsp; # A .stt sequence program is *not* pre-processed:
&nbsp;&nbsp;&nbsp; testSupport_SRCS += sncExample.stt
&nbsp;&nbsp; testSupport_LIBS += seq pv
&nbsp;&nbsp;&nbsp; test_LIBS += seq pv

&nbsp;&nbsp;&nbsp; # Build sncProgram as a standalone program
&nbsp;&nbsp;&nbsp; PROD_HOST += sncProgram
&nbsp;&nbsp;&nbsp; sncProgram_SNCFLAGS += +m
&nbsp;&nbsp;&nbsp; # A .st sequence program *is* pre-processed:
&nbsp;&nbsp;&nbsp; sncProgram_SRCS += sncProgram.st
&nbsp;&nbsp;&nbsp; sncProgram_LIBS += seq pv
&nbsp;&nbsp;&nbsp; sncProgram_LIBS += $(EPICS_BASE_HOST_LIBS)
endif

# Finally link IOC to the EPICS Base libraries
test_LIBS += $(EPICS_BASE_IOC_LIBS)

include $(TOP)/configure/RULES
#----------------------------------------
#&nbsp; ADD EXTRA GNUMAKE RULES BELOW HERE





-----------------
output of st.cmd
-----------------
../../bin/linux-x86_64/test st.cmd
#!../../bin/linux-x86_64/test
## You may have to change test to something else
## everywhere it appears in this file
< envPaths
epicsEnvSet("IOC","ioctest")
epicsEnvSet("TOP","/opt/test")
epicsEnvSet("EPICS_BASE","/opt/base")
epicsEnvSet("ASYN","/opt/modules/asyn")
epicsEnvSet("STREAM","/opt/modules/stream")
epicsEnvSet("SNCSEQ","/opt/modules/seq")
epicsEnvSet "STREAM_PROTOCOL_PATH" "/opt/test/db"
epicsEnvSet "P" "Meter"
epicsEnvSet "R" ""
cd "/opt/test"
## Register all support components
dbLoadDatabase "dbd/test.dbd"
Declaration of recordtype(scalcout) preceeded full definition.
Error at or before "}" in file "dbd/test.dbd" line 13647
test_registerRecordDeviceDriver pdbbase
registerRecordDeviceDriver failed aSub
registerRecordDeviceDriver failed ai
registerRecordDeviceDriver failed stringin
registerRecordDeviceDriver failed sub
## Load record instances
dbLoadTemplate "db/user.substitutions"
Record "lyx:aiExample" is of unknown type "ai"
Error at or before ")" in file "db/dbExample1.db" line 1
Record "lyx:aiExample1" is of unknown type "ai"
Error at or before ")" in file "db/dbExample2.db" line 23
Record "lyx:aiExample2" is of unknown type "ai"
Error at or before ")" in file "db/dbExample2.db" line 23
Record "lyx:aiExample3" is of unknown type "ai"
Error at or before ")" in file "db/dbExample2.db" line 23
dbLoadRecords "db/dbSubExample.db", "user=lyx"
Record "lyx:subExample" is of unknown type "sub"
Error at or before ")" in file "db/dbSubExample.db" line 1
dbLoadRecords "db/devMeter.db", "P=Meter,R=,PORT=L0,A=0"
## Set this to see messages from mySub
#var mySubDebug 1
drvAsynSerialPortConfigure("L0",/dev/ttyS0,0,0,0)
asynSetOption("L0",-1,"baud","115200")
asynSetOption("L0",-1,"bits","8")
asynSetOption("L0",-1,"parity","none")
asynSetOption("L0",-1,"stop","1")
asynSetOption("L0",-1,"baud","115200")
asynOctetSetInputEos("L0",-1,"\r\n")
asynOctetSetOutputEos("L0",-1,"\r\n")
asynSetTraceIOMask("L0",-1,0x2)
asynSetTraceIOMask("L0",-1,0x9)
## Run this to trace the stages of iocInit
#traceIocInit
cd "/opt/test/iocBoot/ioctest"
iocInit
Starting iocInit
############################################################################
## EPICS R3.15.6
## EPICS Base built Nov&nbsp; 8 2019
############################################################################
Forward-link uses Channel Access without pointing to PROC field
&nbsp;&nbsp;&nbsp; lyx:calcExample1.FLNK =&gt; lyx:aiExample1
Forward-link uses Channel Access without pointing to PROC field
&nbsp;&nbsp;&nbsp; lyx:calcExample2.FLNK =&gt; lyx:aiExample2
Forward-link uses Channel Access without pointing to PROC field
&nbsp;&nbsp;&nbsp; lyx:calcExample3.FLNK =&gt; lyx:aiExample3
2019/11/10 08:56:55 Can't find readable file 'devMeter.proto' in '.'
2019/11/10 08:56:55 while reading protocol 'range1' for 'range1'
2019/11/10 08:56:55 range1: Protocol parse error
2019/11/10 08:56:55 range1: Record initialization failed
Bad init_rec return value&nbsp; PV: range1 ao: init_record

iocRun: All initialization complete
## Start any sequence programs
#seq sncExample, "user=lyx"
epics&gt;




--------------
grep -i stream dbd/test.dbd
------------
device(calcout, INST_IO, devcalcoutStream, "stream")
device(lsi, INST_IO, devlsiStream, "stream")
device(stringout, INST_IO, devstringoutStream, "stream")
device(aai, INST_IO, devaaiStream, "stream")
device(bo, INST_IO, devboStream, "stream")
device(mbbi, INST_IO, devmbbiStream, "stream")
device(mbbo, INST_IO, devmbboStream, "stream")
device(ao, INST_IO, devaoStream, "stream")
device(aao, INST_IO, devaaoStream, "stream")
device(mbbiDirect, INST_IO, devmbbiDirectStream, "stream")
device(waveform, INST_IO, devwaveformStream, "stream")
device(longin, INST_IO, devlonginStream, "stream")
device(bi, INST_IO, devbiStream, "stream")
device(lso, INST_IO, devlsoStream, "stream")
device(mbboDirect, INST_IO, devmbboDirectStream, "stream")
device(longout, INST_IO, devlongoutStream, "stream")
device(scalcout, INST_IO, devscalcoutStream, "stream")
device(ai, INST_IO, devaiStream, "stream")
device(stringin, INST_IO, devstringinStream, "stream")
driver(stream)
registrar(streamRegistrar)
variable(streamDebug, int)
variable(streamError, int)


----------------
dbior
----------------
no output
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.aps.anl.gov/pipermail/tech-talk/attachments/20191110/b3603f2a/attachment.html>

------------------------------

Message: 4
Date: Mon, 11 Nov 2019 10:48:36 +0100
From: Donny?Domagoj Cosic <[email protected]>
To: [email protected]
Subject: Segmentation fault when Record Processing in StreamDevice
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8; format=flowed

Hi,

I have an IOC to read data from a radiation monitor that continuously
send out data, however every so often the device sends out a header
which is formatted differently and this is causing a Segmentation fault
and crashing the IOC.

The output from the probe:

??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
<\f>User File Number:          1<\r>
<\r>
   Date     Time    M.Time       A           B    <\r>
                     min       uSv/h       uSv/h  <\r>
--------------------------------------------------<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>


My DB file:

record (ai, "RAD:P10Probe1")
{
        field(DTYP, "stream")
        field(INP, "@rad.proto getProbe1(RAD:message) PORT10")
        field(SCAN, "I/O Intr")
        field(HIHI, "10.0")
        field(HIGH, "1.0")
        field(HHSV, "MAJOR")
        field(HSV, "MINOR")
        field(LOPR, "0")
        field(EGU, "uS/hr")
}

record (ai, "RAD:P10Probe2")
{
        field(DTYP, "stream")
        field(INP, "@rad.proto getProbe2(RAD:message) PORT10")
        field(SCAN, "I/O Intr")
        field(HIHI, "10.0")
        field(HIGH, "1.0")
        field(HHSV, "MAJOR")
        field(HSV, "MINOR")
        field(LOPR, "0")
        field(EGU, "uS/hr")
}

My proto file:

Terminator = CR;

getProbe1
{
   in "%*8s\_%*8s\_%*f\_%f(%*d)\_%*f(%*d)";
   ExtraInput = Ignore;
   @mismatch
   {
     in "%(\$1)52c";
   }

}

getProbe2
{
   in "%*8s\_%*8s\_%*f\_%*f(%*d)\_%f(%*d)";
   ExtraInput = Ignore;
   @mismatch
   {
     in "%(\$1)52c";
   }

}

I noticed that when the header is received, the mismatch exception
handler is not triggered, but this might because the SCAN field is set
to "I/O Intr" as the data rate depends on the dose measured at the
probe. Why would this reading error cause a Segmentation Error and crash
the IOC? Is there any other way read the string from the probe?

Thank you in advance for you time,

Regards,
Donny

--
Donny?Domagoj Cosic
  Institut Ru?er Bo?kovi?, Bijeni?ka cesta 54, 10000 Zagreb, Croatia


------------------------------

Message: 5
Date: Mon, 11 Nov 2019 17:43:08 +0000
From: Mark Rivers <[email protected]>
To: 'Donny?Domagoj Cosic' <[email protected]>
Cc: "[email protected]" <[email protected]>
Subject: RE: Segmentation fault when Record Processing in StreamDevice
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"

What versions of asyn and stream are you running?

You should the IOC under gdb and run the "backtrace" command when it crashes.  That will give us a stack dump, showing where and why it crashed.

Mark


-----Original Message-----
From: Tech-talk <[email protected]> On Behalf Of Donny?Domagoj Cosic via Tech-talk
Sent: Monday, November 11, 2019 3:49 AM
To: [email protected]
Subject: Segmentation fault when Record Processing in StreamDevice

Hi,

I have an IOC to read data from a radiation monitor that continuously send out data, however every so often the device sends out a header which is formatted differently and this is causing a Segmentation fault and crashing the IOC.

The output from the probe:

??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
<\f>User File Number:          1<\r>
<\r>
   Date     Time    M.Time       A           B    <\r>
                     min       uSv/h       uSv/h  <\r>
--------------------------------------------------<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>
??/??/?? ??:??:??     0.1     0.19(1)     0.15(1)<\r>


My DB file:

record (ai, "RAD:P10Probe1")
{
        field(DTYP, "stream")
        field(INP, "@rad.proto getProbe1(RAD:message) PORT10")
        field(SCAN, "I/O Intr")
        field(HIHI, "10.0")
        field(HIGH, "1.0")
        field(HHSV, "MAJOR")
        field(HSV, "MINOR")
        field(LOPR, "0")
        field(EGU, "uS/hr")
}

record (ai, "RAD:P10Probe2")
{
        field(DTYP, "stream")
        field(INP, "@rad.proto getProbe2(RAD:message) PORT10")
        field(SCAN, "I/O Intr")
        field(HIHI, "10.0")
        field(HIGH, "1.0")
        field(HHSV, "MAJOR")
        field(HSV, "MINOR")
        field(LOPR, "0")
        field(EGU, "uS/hr")
}

My proto file:

Terminator = CR;

getProbe1
{
   in "%*8s\_%*8s\_%*f\_%f(%*d)\_%*f(%*d)";
   ExtraInput = Ignore;
   @mismatch
   {
     in "%(\$1)52c";
   }

}

getProbe2
{
   in "%*8s\_%*8s\_%*f\_%*f(%*d)\_%f(%*d)";
   ExtraInput = Ignore;
   @mismatch
   {
     in "%(\$1)52c";
   }

}

I noticed that when the header is received, the mismatch exception handler is not triggered, but this might because the SCAN field is set to "I/O Intr" as the data rate depends on the dose measured at the probe. Why would this reading error cause a Segmentation Error and crash the IOC? Is there any other way read the string from the probe?

Thank you in advance for you time,

Regards,
Donny

--
Donny?Domagoj Cosic
  Institut Ru?er Bo?kovi?, Bijeni?ka cesta 54, 10000 Zagreb, Croatia

------------------------------

Subject: Digest Footer

_______________________________________________
Tech-talk mailing list [email protected]
https://mailman.aps.anl.gov/mailman/listinfo/tech-talk


------------------------------

End of Tech-talk Digest, Vol 13, Issue 455
******************************************

Navigate by Date:
Prev: Re: Linux DMA driver and device support for Xilinx FPGA Ralph Lange via Tech-talk
Next: RE: Linux DMA driver and device support for Xilinx FPGA Ha, Kiman 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: Linux DMA driver and device support for Xilinx FPGA Ha, Kiman via Tech-talk
Next: using stream failed =?gb18030?b?t+fQ0Muu?= 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, 11 Nov 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·