porting ioccore onto - itron real-time kernel

18
Porting iocCore onto -ITRON real-time kernel EPICS collaboration meeting 2004 12/10/2004 G.Jiang, A.Akiyama, J.Odagiri, N.Yamamoto

Upload: ollie

Post on 01-Feb-2016

57 views

Category:

Documents


0 download

DESCRIPTION

Porting iocCore onto - ITRON real-time kernel. EPICS collaboration meeting 2004 12/10/2004 G.Jiang, A.Akiyama, J.Odagiri, N.Yamamoto. What is - ITRON?. An API-specification of real-time kernel Developed by Prof . Ken Sakamura of Tokyo Univ. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Porting iocCore onto  - ITRON real-time kernel

Porting iocCore onto -ITRON real-time kernel

EPICS collaboration meeting 2004

12/10/2004

G.Jiang, A.Akiyama, J.Odagiri,

N.Yamamoto

Page 2: Porting iocCore onto  - ITRON real-time kernel

An API-specification of real-time kernel Developed by Prof. Ken Sakamura of Tokyo Univ. Many different implementations of products are available on the

market Widely used in consumer electronics fields in Japan

Mobile phones TV-games Automobile Navigation System

Details : See http://tron.um.u-tokyo.ac.jp/TRON/ITRON/home-e.html

What is -ITRON?

Page 3: Porting iocCore onto  - ITRON real-time kernel

Why -ITRON?

Running iocCore on intelligent device controllers Many intelligent device controllers come with an Ethernet

interface Many of those have an SHx CPU and enough ROM/RAM

capacity to run iocCore Many of those run -ITRON

OPI

IOC Controller

VME or PC

CA

OPI

IOC

Controller

CA

Proprietary Protocol

Page 4: Porting iocCore onto  - ITRON real-time kernel

Intelligent device controllers running -ITRON

Commercial Devices PLC

Yokogawa FA-M3, used for Ion-source, vacuum etc. WE7000 measurement station

Digital oscilloscope (100kS/s, 1MS/s, 100MS/s and 1GS/s)

Custom Device Controllers EMB-LAN100

Initially designed for the Power supplies of DTL Q-magnet NDIM (Network Device Interface Module)

Developed by RIKEN for various control/monitoring

Page 5: Porting iocCore onto  - ITRON real-time kernel

Commercial devices

FA-M3 PLC

(Made by Yokogawa)

WE7000

(Made by Yokogawa)

Page 6: Porting iocCore onto  - ITRON real-time kernel

Custom device controllers EMB-LAN100

(Developed by KEK)

N-DIM(Developed by RIKEN)

Page 7: Porting iocCore onto  - ITRON real-time kernel

What are the benefits?

More distributed More load distribution More robust

Flatter hierarchy Save IOCs being used as “protocol transformer” No need for asynchronous driver

OPI

IOC Controller

MicroIOC

CA

OPI

IOC

Controller

CA

Proprietary Protocol

Page 8: Porting iocCore onto  - ITRON real-time kernel

What’s available on the market

The kernel, NORTi4, from MISPO Development environment

SHC (Super Hitachi Compiler) with a standard

C/C++ library Cygwin on Windows

Kasago TCP/IP + BSD socket library, from Elmic Systems, Inc.

We assume BSPs are available from the HW-

manufactures

Page 9: Porting iocCore onto  - ITRON real-time kernel

How hard is it?

We have implemented OSD libraries (not yet tested)

We have asked Elmic Systems, Inc. to port the TCP/IP + BSD socket onto our target board

There are some missing functions in STC library needed by iocCore

Recent versions of EPICS base use lots of C++ codes

We have gotten linkage errors with some of those

Page 10: Porting iocCore onto  - ITRON real-time kernel

OSD implementation

-ITRON has abundant functions for synchronization and communication

It’s relatively easy For example:

itron case:const T_CMTX cmtx = {TA_TINHERIT,0,""};struct epicsMutexOSD *epicsMutexOsdCreate(void){ ID id; ER ercd; ercd = acre_sem(&cmtx);

…}

Vxworks case:struct epicsMutexOSD * epicsMutexOsdCreate(void){ return((struct epicsMutexOSD *) semMCreate(SEM_DELETE_SAFE|SEM_INVERSION_SAFE|SEM_Q_PRIORITY));}

Page 11: Porting iocCore onto  - ITRON real-time kernel

BSD socket library

Elmic Systems, Inc. is going to develop libraries which interface their TCP/IP protocol stack with -ITRON/LAN

controller driver

S o ck e t s A PI

D e v ice D riv e rA PI

K a s a g o TC P/I PPro to co l S ta ck

K e rn e l A PI NO R Ti

D e vic e D r ive r

Page 12: Porting iocCore onto  - ITRON real-time kernel

Missing functions in STC library

extern FILE *fdopen(int handle, const char * tmp) {...}

extern char *getenv (char * tmp) {...}

extern int putenv (char * tmp) {...}

extern char *tmpnam (char * tmp) {...}

extern FILE *tmpfile (void) {...}

extern int atexit (void (*function)(void)) {...}

extern void exit(int status) {...}

void abort(void) {...}

Page 13: Porting iocCore onto  - ITRON real-time kernel

Building problems with C++ code

iocCore uses some methods not in SHC’s STD C++ library

logic_error::logic_error(); Some of external references can’t be resolved

Related with class Related with template Related with inline function

Page 14: Porting iocCore onto  - ITRON real-time kernel

Status and future plans

We are trying to solve the linkage problems with C++ code

If not, we are going to try another compiler exeGCC, based on gcc

We lose support from the companies on BSP&BSD socket library

We hope we can succeed in running iocCore on a target board before Mar. 2005

Page 15: Porting iocCore onto  - ITRON real-time kernel

MCU made by Nichizou

MCU running -ITRON SH4 (SH7751R-200 MHz)

FLASH ROM 16MBSDRAM 64MB

Page 16: Porting iocCore onto  - ITRON real-time kernel

External references can’t be resolvedrelated with class

Example:

L2310 (W) Undefined external symbol "type identifier for tcpRecvThread" referenced in "tcpiiu"

Details:

In "epics\base-3.14.6\src\ca\virtualCircuit.h", class was declared,

class tcpRecvThread : public epicsThreadRunable {…};

In "epics\base-3.14.6\src\ca\tcpiiu.cpp", the method is like this,

tcpRecvThread::tcpRecvThread ( … ) {…}

Page 17: Porting iocCore onto  - ITRON real-time kernel

External references can’t be resolvedrelated with template

Example:

L2310 (W) Undefined external symbol "type identifier for tsSLNode<tcpiiu>" referenced in "tcpiiu"

Details:

In "epics\base-3.14.6\include\tsSLList.h",declare is like this:

Template <class T>

class tsSLNode {

};

Page 18: Porting iocCore onto  - ITRON real-time kernel

External references can’t be resolvedrelated with inline function

Example:

L2310 (W) Undefined external symbol "comBuf::operator new(unsigned long)" referenced in "tcpiiu"

Details:

In "epics\base-3.14.6\src\ca\comBuf.h",

inline void * comBuf::operator new ( size_t size,

comBufMemoryManager & mgr )

{

return mgr.allocate ( size );

}