dSPACEInternalBypassingServiceImplementation
dSPACEInternalBypassingServiceImplementation
Implementation
For dSPACE Internal Bypassing Service 1.3
To access the Web version of this document, click the following link or scan the QR code:
https://www.dspace.com/dspace-help/ma4EN
To access the Web version, you must have a mydSPACE account. For more information on the
mydSPACE registration process, refer to https://www.dspace.com/faq?097.
How to Contact dSPACE
Mail: dSPACE GmbH
Rathenaustraße 26
33102 Paderborn
Germany
Tel.: +49 5251 1638-0
E-mail: [email protected]
Web: https://www.dspace.com
If possible, always provide the serial number of the hardware, the relevant dSPACE License
ID, or the serial number of the CmContainer in your support request.
Important Notice
This publication contains proprietary information that is protected by copyright. All rights
are reserved. The publication may be printed for personal or internal use provided all the
proprietary markings are retained on all printed copies. In all other cases, the publication
must not be copied, photocopied, reproduced, translated, or reduced to any electronic
medium or machine-readable form, in whole or in part, without the prior written consent
of dSPACE GmbH.
This publication and the contents hereof are subject to change without notice.
Contents
3
May 2024 dSPACE Internal Bypassing Service Implementation
Contents
Index 33
4
dSPACE Internal Bypassing Service Implementation May 2024
About This Reference
Contents This document gives you information on how to implement the dSPACE Internal
Bypassing Service in your ECU code. It also provides information on the available
functions and macros needed to specify and configure the service.
Note
Symbol Description
Indicates a hazardous situation that, if not avoided,
V DANGER
will result in death or serious injury.
Indicates a hazardous situation that, if not avoided,
V WARNING could result in death or serious injury.
Indicates a hazardous situation that, if not avoided,
V CAUTION could result in minor or moderate injury.
Indicates a hazard that, if not avoided, could result in
NOTICE
property damage.
Indicates important information that you should take
Note
into account to avoid malfunctions.
Indicates tips that can make your work easier.
Tip
5
May 2024 dSPACE Internal Bypassing Service Implementation
About This Reference
Symbol Description
Indicates a link that refers to a definition in the
glossary, which you can find at the end of the
document unless stated otherwise.
Follows the document title in a link that refers to
another document.
Naming conventions dSPACE user documentation uses the following naming conventions:
Special Windows folders Windows‑based software products use the following special folders:
Accessing dSPACE Help and After you install and decrypt Windows‑based dSPACE software, the
PDF files documentation for the installed products is available in dSPACE Help and as PDF
files.
dSPACE Help (local) You can open your local installation of dSPACE Help:
§ On its home page via Windows Start Menu
§ On specific content using context-sensitive help via F1
PDF files You can access PDF files via the icon in dSPACE Help. The PDF
opens on the first page.
6
dSPACE Internal Bypassing Service Implementation May 2024
License Agreement for the dSPACE Internal Bypassing Service
Introduction If you want to work with the dSPACE Internal Bypassing Service, you have to
accept the License Agreement first.
License Agreement
This license is a legal Agreement between you, the end user, either individually
or as an authorized representative of the company acquiring the license,
and dSPACE GmbH acting directly or through its local dSPACE companies or
authorized distributors (collectively “dSPACE”), concerning the use of the C
code containing the dSPACE Internal Bypassing Service (hereinafter referred
to as “the Service”) together with any other materials which are provided
for use in connection with the Service, including without limitation the
executable for installation of the Service, any associated user manual and
internal documentation (hereinafter collectively referred to as “the Program”).
BY IMPLEMENTING THE EXECUTABLE AND INSTALLING THE PROGRAM, YOU
AGREE TO COMPLY WITH THE FOLLOWING TERMS AND RESTRICTIONS. IF YOU
DO NOT AGREE TO THE TERMS OF THIS AGREEMENT, DO NOT INSTALL OR
USE THE PROGRAM AND PROMPTLY RETURN IT TO THE PLACE WHERE YOU
OBTAINED IT, OR DELETE THE PROGRAM IF YOU RECEIVED IT ELECTRONICALLY.
1. Grant of License Unless explicitly agreed otherwise, dSPACE grants you a nonexclusive license to
use the Program and execute the Service as described in the respective product
description or documentation for the sole purpose of product development
involving dSPACE tools.
7
May 2024 dSPACE Internal Bypassing Service Implementation
License Agreement for the dSPACE Internal Bypassing Service
2. Restrictions of Use You may not market, distribute or transfer copies of the Program, in whole or
in part, to third parties (including any subsidiary, affiliate or company under
common control with you) or transfer the Program (directly or indirectly) via
Internet or network applications (such as Citrix, Microsoft Remote Desktop or
other terminal servers) or grant third parties any access to the Program by any
means. You may not rent, lease or loan the Program.
These restrictions do not prevent you from providing compiled object code
versions of the Service as part of your own ECU code to third parties, subject
to the condition that:
§ This takes place in the course of a project where (amongst others) dSPACE
tools are used, and
§ The code is used for the sole purpose of product development and not for use
in any end product or production.
The recipient of your respective ECU code needs to be instructed accordingly and
shall undertake to comply with these restrictions and to agree to the Limitation
of Liability according to Clause 4 hereunder. dSPACE reserves the right to ask for
written confirmation that appropriate instructions have been issued.
Upon request and at the sole discretion of dSPACE, you may be granted
permission to provide the Service itself, in whole or in part, to third parties as
part of your own ECU source code, subject to the conditions stated above. To be
valid, such permission needs to be granted in writing by dSPACE.
For the avoidance of doubt, in any case any transfer of or granting of access to
parts of the Program other than the Service itself is explicitly prohibited.
4. Limitation of Liability The Program was designed and tested solely for use in research and product
development and is supplied to you by dSPACE exclusively for this purpose. It
must be put into operation exclusively by suitably trained and expert operating
personnel under strict compliance with the safety measures described in the
software documentation. Any use of the Program or compiled object code
versions of the Service for purposes and under conditions other than the above,
including but not only any use in end products, constitutes inappropriate use.
Any liability by dSPACE under mandatory law, including but not restricted to
product liability law, for damages of any kind that may be caused by using the
Program or compiled object code versions of the Service in areas other than
product development shall be limited, even to the point of total exclusion, as the
case may be. In the event of claims by third parties against dSPACE that are due
to such inappropriate use of the Program or of compiled object code versions
of the Service by you or with your permission, you agree to indemnify dSPACE
against all such claims.
8
dSPACE Internal Bypassing Service Implementation May 2024
License Agreement
In the event that any of the above terms is or becomes invalid, the remaining
terms shall continue in full force and effect.
Any failure to enforce, or any waiver of, any right under this Agreement by
dSPACE shall not be construed as a waiver of future rights.
The legal regulations shall apply in addition to the terms of this Agreement,
except in cases where they conflict with said terms. This Agreement shall be
governed by the laws of the Federal Republic of Germany, excluding the UN
Convention on Contracts for the International Sale of Goods (CISG).
9
May 2024 dSPACE Internal Bypassing Service Implementation
License Agreement for the dSPACE Internal Bypassing Service
10
dSPACE Internal Bypassing Service Implementation May 2024
Introduction to the dSPACE Internal Bypassing Service Implementation
Access to ECU application and During the development of an ECU, it is often necessary to access the application
resources running on it. For example, values must be modified, and algorithms used to
calculate values must be replaced or extended.
11
May 2024 dSPACE Internal Bypassing Service Implementation
Introduction to the dSPACE Internal Bypassing Service Implementation
The dSPACE Internal Bypassing Service provides interfaces to extend the ECU
application by inserting additional functionality by means of internal bypassing.
Internal bypassing Using the dSPACE Internal Bypassing Service together with the RTI Bypass
Blockset allows you to perform internal bypassing (also called on‑target
prototyping). Functions of the original ECU application are bypassed, and the
new ECU functions are executed on the target ECU by additional internal-
bypass-specific ECU applications. Specific ECU memory areas are used for
internal bypassing.
Call
Read
Before the original ECU function is calculated, the ECU application is interrupted
by a service call. This service call triggers the following actions: The input
parameters relevant for internal bypassing are sampled and stored in a buffer
located in the bypass RAM, the input parameters are read from the buffer, the
bypass function is calculated, and the calculated output values are saved to the
buffer. A second service call, placed after the ECU function to be bypassed,
triggers the replacement of the ECU's results by the results of the bypass
function.
12
dSPACE Internal Bypassing Service Implementation May 2024
dSPACE Internal Bypassing Service Files
Introduction The functions and configuration options used to implement the dSPACE Internal
Bypassing Service are contained in different header and code files which you
must compile and link to the ECU code.
Note
File structure The following tables show the header and code files for the dSPACE Internal
Bypassing Service.
Note
You must compile and link the files to your ECU application. The ECU
application only has to include the dsECUIntSvc.h header file. You do not
have to make any configuration settings in the file. Optionally you can make
compiler‑specific adaptations.
13
May 2024 dSPACE Internal Bypassing Service Implementation
Introduction to the dSPACE Internal Bypassing Service Implementation
Data types The dsECUIntCfg.h file defines the data types for the dSPACE Internal
Bypassing Service. The default values listed below match most ECU processors:
typedef unsigned char DSECUINT_UInt8;
typedef signed char DSECUINT_Int8;
typedef unsigned short DSECUINT_UInt16;
typedef signed short DSECUINT_Int16;
typedef unsigned long DSECUINT_UInt32;
typedef signed long DSECUINT_Int32;
typedef float DSECUINT_Flt32;
typedef double DSECUINT_Flt64;
14
dSPACE Internal Bypassing Service Implementation May 2024
Integration of the dSPACE Internal Bypassing Service
Introduction The ECU application must be instrumented by the dSPACE Internal Bypassing
Service.
Introduction The dSPACE Internal Bypassing Service provides API functions for initializing the
service and performing command processing.
Foreground service The foreground service of the dSPACE Internal Bypassing Service is called to
execute functions provided by the internal bypass functionality of the RTI Bypass
15
May 2024 dSPACE Internal Bypassing Service Implementation
Integration of the dSPACE Internal Bypassing Service
Blockset. These bypass functions perform one or more of the following actions,
depending on the bypass model:
§ Sampling data (copying data from the ECU application RAM to ECU RAM
areas available for internal bypassing)
§ Calculating new data by using bypass functions
§ Stimulating data (copying data from ECU RAM areas reserved for internal
bypassing back to the ECU RAM used by the ECU application)
Introduction The ECU application must be instrumented by dSPACE Internal Bypassing Service
API functions. Different functions must be called according to the purpose the
service is to be used for.
General integration The initialization function must always be integrated in the ECU code. The
dsEcuInt_init initialization function is called during start‑up prior to any ECU
task.
Integration for internal The ECU application can consist of several ECU tasks which are called at fixed
bypassing time intervals (time rasters) or synchronously to specific ECU events (for example,
crankshaft‑synchronously).
16
dSPACE Internal Bypassing Service Implementation May 2024
Integrating the dSPACE Internal Bypassing Service in the ECU Code
dsEcuInt_service(1) dsEcuInt_service(2)
The ECU task consists of three functions, and function 2 is to be bypassed. The
dsEcuInt_service function is called at the beginning of function 2 (to read
the function arguments and calculate the new data) and at the end of function 2
(to write the calculated data back to the ECU application).
17
May 2024 dSPACE Internal Bypassing Service Implementation
Integration of the dSPACE Internal Bypassing Service
18
dSPACE Internal Bypassing Service Implementation May 2024
dSPACE Internal Bypassing Service API Functions
Introduction Some functions of the dSPACE Internal Bypassing Service API must be called by
the ECU application to initialize the service or to trigger actions provided by the
internal bypass tool.
Besides the API functions described in the following topics, there are further
functions and options for advanced service configuration. For information,
contact dSPACE Support.
dsEcuInt_init............................................................................................ 19
To initialize the dSPACE Internal Bypassing Service.
dsEcuInt_service...................................................................................... 20
To start the dSPACE Internal Bypassing Service foreground service.
dsEcuInt_init
19
May 2024 dSPACE Internal Bypassing Service Implementation
dSPACE Internal Bypassing Service API Functions
The dsEcuInt_init function must be called prior to any other function of the
dSPACE Internal Bypassing Service. A typical location in the ECU code is where
other initializations of the ECU are performed. For further information, refer to
Integrating the dSPACE Internal Bypassing Service in the ECU Code on page 16.
The internal bypass code is also initialized via the dsEcuInt_init function, too.
You can define additional functionality to be performed during initialization from
within the internal bypassing tool (RTI Bypass Blockset) by declaring and using
a service instance assigned to the service ID 0. For example, you can use an RTI
Bypass Interrupt block, for which a service instance associated with service ID 0 is
specified, to call a subsystem that performs some post‑initialization actions.
Parameters None
Example dsEcuInt_init();
dsEcuInt_service....................................................................................................................... 20
dSPACE Internal Bypassing Service API Functions...................................................................... 19
dsEcuInt_service
Description The function calls a bypass hook which is used to start a dedicated action
according to the related bypass model of the internal bypassing tool (RTI Bypass
Blockset with internal bypass option).
For bypassing purposes, one or two function calls are necessary, depending on
the bypass scenario:
§ Bypassing with two function calls
One function call is needed at the beginning of the function or task to be
bypassed (to read the arguments of the functions to be bypassed and typically
20
dSPACE Internal Bypassing Service Implementation May 2024
dsEcuInt_service
execute the bypass functions). The other function call is needed at the end
of the function or task to be bypassed (to write the results calculated by the
internal‑bypass‑specific applications back to the ECU application).
§ Bypassing with one function call
The function call is placed at the end of the function or task to be bypassed
(to read the arguments of the functions to be bypassed, to execute the bypass
functions and to write the function results back to the ECU application).
Note
The following error definitions can be used as flags, that is, they can be
combined with a binary OR operation:
Example dsEcuInt_service(5);
dsEcuInt_init............................................................................................................................. 19
dSPACE Internal Bypassing Service API Functions...................................................................... 19
21
May 2024 dSPACE Internal Bypassing Service Implementation
dSPACE Internal Bypassing Service API Functions
22
dSPACE Internal Bypassing Service Implementation May 2024
dSPACE Internal Bypassing Service Configuration Options
Introduction The features of the dSPACE Internal Bypassing Service can be configured.
DSECUINT_SERVICE_REMOVED............................................................... 24
To enable or disable the dSPACE Internal Bypassing Service completely.
DSECUINT_SVC_RESOLVE_SERVICE_ID.................................................... 24
To specify the algorithm used to search for the service ID in a list.
DSECUINT_CONST................................................................................... 25
To place data in the ROM or RAM.
DSECUINT_SVC_PID................................................................................ 26
To enable or disable data abstraction for position-independent data.
Feature configuration The features of the dSPACE Internal Bypassing Service can be configured.
Configuration is done by means of conditional compilation with preprocessor
instructions (#define) in the dSPACE Internal Bypassing Service configuration file
dsECUIntCfg.h.
23
May 2024 dSPACE Internal Bypassing Service Implementation
dSPACE Internal Bypassing Service Configuration Options
External tools The dSPACE Internal Bypassing Service supports one external tool at a time.
DSECUINT_SERVICE_REMOVED
Parameters None
DSECUINT_SVC_RESOLVE_SERVICE_ID
Purpose To specify the algorithm used to search for the service ID in a list.
24
dSPACE Internal Bypassing Service Implementation May 2024
DSECUINT_CONST
in the dsEcuInt_service function. The first two methods are linear, starting
at the end or the beginning of the list. The last method is a binary search. It is
faster, but the function code is more complex.
DSECUINT_CONST
Description DSECUINT_CONST is used to place service structures in the ROM or RAM. For
most applications, the default define value 'const' can be used and the structures
are placed in the ROM. If no value is specified for the define, the service
structures are placed in the RAM.
Parameters … Define that is set if the structures are placed in the RAM.
25
May 2024 dSPACE Internal Bypassing Service Implementation
dSPACE Internal Bypassing Service Configuration Options
DSECUINT_SVC_PID
26
dSPACE Internal Bypassing Service Implementation May 2024
Configuring the ECU Memory Locations of the Service Configurations
Introduction The ECU memory locations of the service configurations used by the
dSPACE Internal Bypassing Service and the external tool are defined in the
dsECUIntCfg.h and dsECUIntcustom.c files.
Introduction The ECU memory locations of the service configurations used by the
dSPACE Internal Bypassing Service and the external tool are defined in the
dsECUIntCfg.h and dsECUIntcustom.c files. You can change the locations of
the service configurations in the ECU memory by adding compiler‑specific section
or location directives modifying the start addresses in the dsECUIntCfg.h and
dsECUIntcustom.c files.
Modifying the memory The dsECUIntCfg.h and dsECUIntcustom.c files provide the initial definitions
locations of the service and the external declarations of the service configuration structures used by the
configurations dSPACE Internal Bypassing Service and the external tool. You can change the
locations of the service configurations in the ECU memory by specifying new
start addresses for them in the dsECUIntCfg.h and dsECUIntcustom.c files.
Use compiler‑specific statements (e.g., pragma sections) for this.
Note
27
May 2024 dSPACE Internal Bypassing Service Implementation
Configuring the ECU Memory Locations of the Service Configurations
Note
Example The following excerpt from the dsECUIntcustom.c file shows the modification
of the start addresses of the service configurations using the GNU GCC compiler.
...
/* custom configuration structure definitions *********************************/
/* Start of custom external tool configuration definition */
#pragma section .svccfgextsect
volatile DSECUINT_CONST DSECUINT_Service_Config_External_Tool DsEcuIntSvcExtToolCfg =
DSECUINT_SVC_CONFIG_DEFAULT_EXTERNAL_TOOL;
#pragma section
/* End of custom external tool configuration definition */
The following excerpt from the dsECUIntCfg.h file shows the corresponding
modifications for the external declarations of the service configurations using the
GNU GCC compiler.
...
/* custom configuration structure definitions *********************************/
/* Start of custom external tool configuration definition */
#pragma section .svccfgextsect
extern volatile DSECUINT_CONST DSECUINT_Service_Config_External_Tool DsEcuIntSvcExtToolCfg;
#pragma section
/* End of custom external tool configuration definition */
28
dSPACE Internal Bypassing Service Implementation May 2024
Specifying the Start Addresses of the Service Configurations in the ECU Memory
29
May 2024 dSPACE Internal Bypassing Service Implementation
Configuring the ECU Memory Locations of the Service Configurations
30
dSPACE Internal Bypassing Service Implementation May 2024
dSPACE Internal Bypassing Service Interface Description
Introduction To communicate with an ECU with integrated dSPACE Internal Bypassing Service,
the interface used for bypassing must be described.
Interface Description
Required interface‑specific The A2L file must include an IF_DATA element specific to the bypass
information interface used. The IF_DATA element contains interface-specific information.
This information must comply with a special format, which is described in ASAP2
Meta Language (AML) files. The AML specification of the interface must also be
contained in the A2L file.
Note
For information on the interface‑specific IF_DATA element and details on its data
format, refer to the Interface Description Data Reference .
31
May 2024 dSPACE Internal Bypassing Service Implementation
dSPACE Internal Bypassing Service Interface Description
32
dSPACE Internal Bypassing Service Implementation May 2024
Index
Index
C
Common Program Data folder 6
configuring the memory locations of service
configurations 27
D
data types for dSPACE Internal Bypassing
Service 14
Documents folder 6
DSECUINT_CONST 25
dsEcuInt_init 19
dsEcuInt_service 20
DSECUINT_SERVICE_REMOVED 24
DSECUINT_SVC_PID 26
DSECUINT_SVC_RESOLVE_SERVICE_ID 24
dSPACE Internal Bypassing Service
API 15
configuration 23
configuring the memory locations of service
configurations 27
data types 14
file structure 13
foreground service 15
initialization 15
integration in ECU code 16
license agreement 7
specifying start addresses of service
configurations 27
I
integrating the dSPACE Internal Bypassing
Service 15
L
license agreement 7
license agreement for dSPACE Internal Bypassing
Service 7
Local Program Data folder 6
S
service configuration
dSPACE Internal Bypassing Service 23
specifying start addresses of service
configurations 27
33
May 2024 dSPACE Internal Bypassing Service Implementation
Index
34
dSPACE Internal Bypassing Service Implementation May 2024