User Manual
GAMMA instabus
Release: 12/2015
Application Program Bus Interface Modules M130, M131, M132 and M135
Runtime Environment for KNX-Processors 184/11 and 184/21
Technical Manual pages 17 Siemens AG
Building Technologies
Control Products and Systems
page 8 © Siemens AG 2015 P. O. Box 10 09 53,
Subject to change without further notice. D-93009 Regensburg
The ‘NEAR_ID’ contains the value for the ram variables that have to be initialized at startup
of the user application program through ‘cstartup’.
Const data is placed in ‘CONST’.
The segment ‘RCODE’ contains the ‘cstartup’ code and the runtime library code.
‘CODE’ contains the normal program code.
The user application programmer can change or divide the segments ‘ADDRTAB’,
‘ASSOCTAB’, ‘COMTAB’, ‘NEAR_ID’, ‘CONST’, ‘RCODE’ and ‘CODE’ if there is the need to
do this, for example if the segment ‘PARAM’ is not used or must be increased. This segment
is normally used to store parameters of the application program at fix addresses.
When the debug session is started in the IAR Embedded Workbench, the debugger tries to
rewrite the reset vector so that it points to the entry point of the 'cstartup.asm' file. To prevent
this the 'cstartup.asm' was modified in that way that if the project configuration 'DEBUG' is
chosen a manual generated complete interrupt vector table is linked to the address where
the normal interrupt vector table has to be. This is done with the 'ORG' directive in
assembler. The interrupt vector table that is defined in the cstartup file in the user application
program is exactly the table as it is in the BIM / chipset operating system. That means if the
user application programmer starts the debug session the controller will start with the
operating system which is already loaded in the microcontroller and not with the user
application program. The operating system in turn will start the user application program.
This is done by initializing the task switch system and an immediate task switch to the user
application program. After this task switch the user application program starts at the entry
point in the cstartup where the task switch will be disabled. This is done to allow the user
application program to do all initializations that are necessary before the operating system
does the next system cycle. In the cstartup of the user application program all ram variables
that are located in the high speed ram are initialized either with zero or with their initial value.
After this the main function is called where more initializations could be done, for example
some init functions of the used API functionality. When the user application program has
finished the initializations the macro ‘FORCE_TASKSWITCH’ has to be called to enable the
task switch again and to do a system cycle immediately. The complete startup of the user
application program from the beginning of the cstartup to the call of 'FORCE_TASKSWITCH'
should not take more then 10ms.