Free Development Environment for
Bus Coupling Units of the European
Installation Bus
BCU SDK Edition
Martin K¨ogler (mkoegler@auto.tuwien.ac.at)
November 10, 2007
Copyright
BCU SDK Documentation
Copyright (C) 2005-2007 Martin K¨ogler <mkoegler@auto.tuwien.ac.at>
You can redistribute and/or modify this document under the terms of the GNU Gen-
eral Public License as published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This document is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FIT-
NESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with this
document; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite
330, Boston, MA 02111-1307 USA
Where the GNU General Public License mentions ”source code”, these LaTeX files or
another editable file format, if it became the preferred format of modification, shall be
referred to. Any not ”source code” form derived from this ”source code” are regarded
as ”binary form”.
Modified versions, if the modification is beyond correcting errors or reformatting, must
be marked as such.
Acknowledgments
This text is based on my diploma thesis.
Wolfgang Kastner and Georg Neugschwandtner, Automations Systems Group, Tech-
nical University Vienna, have helped me a lot.
Georg Neugschwandtner is contributing to this document by proofreading and revising
changes.
3
4
Abstract
The European Installation Bus (EIB) is a field bus system for home and building au-
tomation. Bus Coupling Units (BCUs) provide a standardized platform for embedded
bus devices. They can be programmed and configured via the bus. BCUs are based
on the Freescale (Motorola) M68HC05 microcontroller family and provide a few tens
of bytes of RAM and less than 1 KB of EEPROM. A common integration tool (called
ETS) is used for the planning and installation of EIB systems.
Several problems exist for non commercial development projects. Although a free
SDK for the BCU 1 is available, there is no free C compiler. Additionally, only certified
programs can be processed by ETS. ETS as well as standard libraries for PC based bus
access are only available for Windows.
During the course of the present project, a set of free tools for developing programs
for BCU 1 and BCU 2 (twisted pair version) as well as loading them into the respective
BCU were created. A RAD (Rapid Application Development) like approach is used for
programming. Properties and event handlers of the used objects are described using a
special specification language. Necessary code elements are written in C (inline assembler
is also supported). An interface to an integration tool is also available.
A multi-user and network-capable Linux daemon to access the EIB was developed,
which provides access to the transport layer as well as complex device management
functions. Different interfaces for bus access are supported (PEI 16, FT 1.2, EIBnet/IP
Routing + Tunneling and TPUART).
The tool chain is based on the GNU tool chain. The hardware limitations of the target
system were a key point of the porting activities. It is described how GCC was ported
to an accumulator architecture with only two 8 bit registers – but with 16 bit address
space – and only one call stack.
Small code size is a primary requirement. Therefore, integers of 3, 5, 6 and 7 bytes are
supported for situations, where a two byte integer is too small, but 4 or 8 byte integer
types would be unnecessarily large. As the architecture uses variable length instruction
formats, a mechanism which selects the smallest variant was implemented into the linker.
A mechanism is shown which makes GCC distribute variables over non contiguous
segments automatically. This feature is required by the BCU 2 architecture. Addition-
ally, transparent access to the EEPROM was added. Its concept is related to ISO/IEC
TR 18037 named address spaces.
5