Porting ioc Core onto ITRON real time kernel

  • Slides: 18
Download presentation
Porting ioc. Core onto -ITRON real -time kernel EPICS collaboration meeting 2004 12/10/2004 G.

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

What is -ITRON? n An API-specification of real-time kernel n n n Developed by

What is -ITRON? n An API-specification of real-time kernel n n n 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 n n Mobile phones TV-games Automobile Navigation System Details : See n http: //tron. um. u-tokyo. ac. jp/TRON/ITRON/home-e. html

Why -ITRON? n Running ioc. Core on intelligent device controllers n n n Many

Why -ITRON? n Running ioc. Core on intelligent device controllers n n n Many intelligent device controllers come with an Ethernet interface Many of those have an SHx CPU and enough ROM/RAM capacity to run ioc. Core Many of those run -ITRON OPI Proprietary Protocol Controller CA IOC VME or PC OPI CA IOC Controller

Intelligent device controllers running -ITRON n Commercial Devices n PLC n n WE 7000

Intelligent device controllers running -ITRON n Commercial Devices n PLC n n WE 7000 measurement station n n Yokogawa FA-M 3, used for Ion-source, vacuum etc. Digital oscilloscope (100 k. S/s, 1 MS/s, 100 MS/s and 1 GS/s) Custom Device Controllers n EMB-LAN 100 n n Initially designed for the Power supplies of DTL Q-magnet NDIM (Network Device Interface Module) n Developed by RIKEN for various control/monitoring

Commercial devices FA-M 3 PLC (Made by Yokogawa) WE 7000 (Made by Yokogawa)

Commercial devices FA-M 3 PLC (Made by Yokogawa) WE 7000 (Made by Yokogawa)

Custom device controllers EMB-LAN 100 (Developed by KEK) N-DIM (Developed by RIKEN)

Custom device controllers EMB-LAN 100 (Developed by KEK) N-DIM (Developed by RIKEN)

What are the benefits? n More distributed n n n More load distribution More

What are the benefits? n More distributed n n n More load distribution More robust Flatter hierarchy n n Save IOCs being used as “protocol transformer” No need for asynchronous driver OPI Proprietary Protocol CA IOC Micro. IOC Controller OPI CA IOC Controller

What’s available on the market n n The kernel, NORTi 4, from MISPO Development

What’s available on the market n n The kernel, NORTi 4, from MISPO Development environment n n 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 HWmanufactures

How hard is it? n n We have implemented OSD libraries (not yet tested)

How hard is it? n n 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 ioc. Core Recent versions of EPICS base use lots of C++ codes n We have gotten linkage errors with some of those

OSD implementation n -ITRON has abundant functions for synchronization and communication It’s relatively easy

OSD implementation n -ITRON has abundant functions for synchronization and communication It’s relatively easy For example: itron case: const T_CMTX cmtx = {TA_TINHERIT, 0, ""}; struct epics. Mutex. OSD * epics. Mutex. Osd. Create(void) { ID id; ER ercd; ercd = acre_sem(&cmtx); … } Vxworks case: struct epics. Mutex. OSD * epics. Mutex. Osd. Create(void) { return((struct epics. Mutex. OSD *) sem. MCreate(SEM_DELETE_SAFE|SEM_INVERSI ON_SAFE|SEM_Q_PRIORITY)); }

BSD socket library Elmic Systems, Inc. is going to develop libraries which interface their

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

Missing functions in STC library extern FILE *fdopen(int handle, const char * tmp) {.

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) {. . . }

Building problems with C++ code n ioc. Core uses some methods not in SHC’s

Building problems with C++ code n ioc. Core uses some methods not in SHC’s STD C++ library n n logic_error: : logic_error(); Some of external references can’t be resolved n n n Related with class Related with template Related with inline function

Status and future plans n n We are trying to solve the linkage problems

Status and future plans n n We are trying to solve the linkage problems with C++ code If not, we are going to try another compiler exe. GCC, based on gcc n n We lose support from the companies on BSP&BSD socket library We hope we can succeed in running ioc. Core on a target board before Mar. 2005

MCU made by Nichizou MCU running -ITRON SH 4 (SH 7751 R-200 MHz) FLASH

MCU made by Nichizou MCU running -ITRON SH 4 (SH 7751 R-200 MHz) FLASH ROM 16 MB SDRAM 64 MB

External references can’t be resolved related with class Example: L 2310 (W) Undefined external

External references can’t be resolved related with class Example: L 2310 (W) Undefined external symbol "type identifier for tcp. Recv. Thread" referenced in "tcpiiu" n Details: In "epicsbase-3. 14. 6srccavirtual. Circuit. h", class was declared, class tcp. Recv. Thread : public epics. Thread. Runable {…}; In "epicsbase-3. 14. 6srccatcpiiu. cpp", the method is like this, tcp. Recv. Thread: : tcp. Recv. Thread ( … ) {…} n

External references can’t be resolved related with template Example: L 2310 (W) Undefined external

External references can’t be resolved related with template Example: L 2310 (W) Undefined external symbol "type identifier for ts. SLNode<tcpiiu>" referenced in "tcpiiu" n Details: In "epicsbase-3. 14. 6includets. SLList. h", declare is like this: Template <class T> class ts. SLNode { … }; n

External references can’t be resolved related with inline function Example: L 2310 (W) Undefined

External references can’t be resolved related with inline function Example: L 2310 (W) Undefined external symbol "com. Buf: : operator new(unsigned long)" referenced in "tcpiiu" n Details: In "epicsbase-3. 14. 6srccacom. Buf. h", inline void * com. Buf: : operator new ( size_t size, com. Buf. Memory. Manager & mgr ) { return mgr. allocate ( size ); } n