You are on page 1of 4

CAN FD: Measuring and

Tools

reprogramming
The complexity of the CAN FD technology is equivalent to the regular CAN
network but it offers a significantly increased bandwidth. It is therefore an
alternative to Flexray or Ethernet networks.

Author

Armin Happel

Erik Sparrer

XCP on CAN FD data


C AN with a flexible data
rate (CAN FD) is a tech-
nological evolution of the
and Calibration Protocol)
measurement and calibra-
tion protocol that has been
throughput
CAN network. It provides standardized by ASAM e.V. To estimate the maximum
Peter Decker more bandwidth than CAN In the current protocol ver- available data through-
with less complexity than sion 1.2, CAN FD is intro- put of XCP over CAN re-
Vector Informatik GmbH Flexray. The network spe- duced as a new XCP trans- spective to CAN FD, the
Ingersheimer Str. 24 cialists at Vector investigat- port layer. XCP enables the frame size versus the avail-
DE-70499 Stuttgart ed two typical applications, utilization of measurement able payload within a frame
Tel.: +49-711-80670-0 measurement of ECU in- and calibration tools such has been investigated for
Fax: +49-711-80670-111 ternal signals via XCP and as Vector’s CANape (Fig- a measurement of multi-
ECU reprogramming, using ure 1) to modify parameters ple ECU signals. The data
Links the CAN FD system. during real-time operation throughput calculations
www.vector.com and measure the altered are based on the assump-
ECU measurement behavior of the ECU. Con- tion of 100 % bus load. The
Literature: with XCP on CAN FD sidering a CAN system the actual size of the frame
CAN-FD specification V1.0, bandwidth of the transmis- fields for CAN and CAN FD
Robert Bosch GmbH In ECU development, the sion medium may quickly are shown in Table 1 and
measurement and cal- become exhausted, depen- Table 2. However, frame
ibration of multiple sig- ding on the number of sizes cannot be predict-
nals and parameters for signals to be monitored. ed precisely for either CAN
open and closed loop con- XCP on CAN FD signifi- or CAN FD. To assure syn-
trol algorithms represents cantly extends the capabil- chronization of bus nodes
an important calibration ities with up to 64 bytes of to signal edges, in depen-
use case. ECU develop- payload and data rates of dence of its content an a-
ers prefer to use the XCP at least 5 Mbit/s in the data priori unknown amount of
(Universal Measurement phase. additional stuff bits is in-

48 CAN Newsletter 3/2014


Figure 1: Measurement over XCP on CAN FD with CANape

serted into the frame. To factor 1.3 up to 5.4 depen-


model the stuff bit depen- ding on the system’s con-
dent frame size variation, figuration (Table 4).
a best and worst case sce- Above its already im-
nario has been analyzed. proved bandwidth, XCP
The results of data over CAN FD possess-
throughput calculations are es further potential for im-
graphically represented as provement. Due to the
a sector (Figure 2, Table 3), equivalent physical com-
where a frame may reside munication basis of CAN
in dependent of its actual and CAN FD, it is likely that
contents. To verify the theo- the communication paths
retical calculation, a realis- of existing ECU software
tic measurement reflecting will still be limited to an
a practical measurement eight-byte data transmis-
use case was processed sion after migrating to CAN
based on a simulation en- FD. In this case XCP can
vironment. At the laborato- only benefit from the high-
ry setup – which consists er data transmission rate
of CANape measurement but cannot utilize the full 64
and calibration software, bytes of payload available
suitable interface hardware in CAN FD frames. To opti-
and a PC-based ECU em- mize the data transmission
ulation – the time of flight rate, the payload of small
between the in- and output XCP packets could be con-
of the CAN/CAN FD driver catenated as a large CAN
was measured in both di- FD frame (Figure 3). Vec-
rections. The experimental- tor is currently working on
ly measured values greatly a proposal that enables
meet the mathematical pre- packet concatenation for
diction (Figure 2, Table 5) XCP over CAN FD in a fu-
and hence verify the mod- ture XCP specification.
eling of the available data
throughput. Comparing Flash programming
the acquired measurement
data needed for a trans- (Re-) programming of flash
mission using CAN versus memory is the second use
CAN FD, the data through- case in which significant
put of CAN FD has been improvements are expect-
found to be increased by ed through the utilization of

Table 1: Structure of a CAN Table 2: Structure of a CAN


frame FD frame
Ethernet with Diagnos- With the transport
Tools

tics over IP (DoIP) per ISO layer that is used, the the-
13400-2 is also well-suited oretically attainable trans-
for fast reprogramming of mission rate in flashing
ECUs. In testing 100 Mbit over CAN FD is 270 kB/s to
Ethernet and a typical mi- 370 kB/s at 4 Mbit/s in the
crocontroller with a pure CAN FD data phase. How-
flash write rate of 180 kB/s, ever, real measured values
results were largely a func- lie well below this (Figure
tion of the buffer size of the 4). Surprisingly, the com-
Transfer-Data service. A 16 pression and pipelining op-
KiB buffer enables through- timization strategies were
put of around 150 kB/s, counterproductive for CAN
which is already near the FD in the test environment
limit of the flash memory that was used. The reason
used in the test. is that, in the laboratory set-
up used, the programming
Figure 2: Measured and calculated CAN FD data Reprogramming via time for the internal flash
throughput in ECU measurement CAN FD memory became the lim-
iting factor in the flashing
fast network protocols. In pipelined programming. Al- Since semiconductor man- process. So this made op-
the three flash phases “de- though compression by an ufacturers do not offer any timizations to the download
lete”, “download/program” LZSS (Lempel-Ziv-Storer- microcontrollers that pro- phase ineffective. Howev-
and “verify”, the download Szymanski) algorithm re- vide CAN FD support yet, er, further tests with more
time is a key factor in con- duces the volume of data network specialists at Vec- powerful CPUs are need-
ventional CAN systems, to be transmitted, its effi- tor used a microcontroller ed to arrive at more gener-
that can be accelerated by ciency is highly dependent in which the CAN FD con- al conclusions about data
faster bus systems such as on the data structure, and troller was implemented in throughput and the effec-
Flexray, Ethernet and CAN data extraction in the ECU an FPGA for their CAN FD tiveness of optimizations. A
FD. generates additional CPU measurements. The soft- key finding of the measure-
Regardless of the load that need to be tak- ware stack on the board ments is that CAN FD de-
transmission protocol, it en into account. Pipelined consists of a standard Vec- livers a significantly higher
makes sense to use addi- programming, on the other tor UDS bootloader. The data throughput than CAN
tional optimization strate- hand, represents a type of ISO 15765-2 transport lay- (Figure 4), and the effort
gies for downloading, such parallelization: while a data er and CAN driver were ex- required for migration is
as data compression and segment is still being writ- tended for support of CAN negligible.
ten in the ECU, transmis- FD. To permit a quick test
Table 3: Calculated data sion of the next segment is setup process for download Summary and
throughputs of data already started. Therefore, testing, the CANoe simu- outlook
measurement with XCP on the potential performance lation and testing tool was
CAN FD (fA=500 kbit/s) gain from this method is used, because the tool al- Overall, it is still difficult to
the greatest when program- ready offers CAN FD sup- arrive at an objective com-
ming times are shorter than port. This software uses parison of the serial bus
data transmission times. an external DLL which pro- systems CAN FD, Flexray
Flexray offers a trans- vides the flash program- and Ethernet due to their
mission rate of 10 Mbit/s, ming procedure and trans- different microcontrollers
but it is not fully available port layer functions. In the and constraints, but certain
for (re-) programming. In future, the Vector vFlash tendencies can be clear-
Table 4: Comparison of the periodic communica- flash tool will become avail- ly discerned. In the case
measured data throughputs tion sequence of the time- able for CAN FD. of Flexray, high download
of data measurement with triggered protocol, all PDUs
XCP on CAN and CAN FD (Protocol Data Unit) are
predefined in fixed slots. If
many slots are reserved for
diagnostic service requests
such as for download, this
reduces bandwidth for the
useful data. Realistic con-
Table 5: Measured data figurations provide for
throughputs of a data 4 PDUs to 8 PDUs with
measurement with XCP on 42 bytes to 255 bytes each
CAN FD (fA=500 kbit/s). per cycle for diagnose ser-
vices. Vector engineers
have measured download
rates of 40 to 60 kB/s when
pipelined programming is Figure 3: Faster data transmission by multiple XCP
used. packets combined in one CAN FD frame

50 CAN Newsletter 3/2014


cols are based on the same
physical layer, and this en-
ables reuse of transceivers,
wiring and bus topologies.
Since the communication
principle has not changed
either, existing know-how
can still be applied. The
modifications to affected
software layers in calibra-
tion and reprogramming
that need to be made are
relatively minor.
CAN FD enables sig-
nificant throughput gains
in both measurement and
reprogramming of ECUs.
In (re-) programming, this
shifts the bottleneck more
to the flash memory. Fur-
ther development to short-
en the memory access
times of the MCUs that are
Figure 4: Comparison of download and programming times with CAN and CAN FD used promise additional
performance gains. Efforts
speeds and high perfor- complex software con- tential for further improve- by Vector to extend the
mance for the real time figuration, and its hard- ment at moderate costs. In XCP specifications to in-
data payload are not both ware costs are higher than addition, it is relatively easy clude packet concatenation
achievable at the same for CAN FD. CAN FD ap- to migrate to the improved with CAN FD also offer the
time. 100 Mbit Ethernet de- pears to be the most bal- CAN, because of the close potential for increasing per-
livers the fastest transmis- anced solution, it offers similarities between CAN formance of the new proto-
sion rates, but it requires high data rates and the po- and CAN FD. Both proto- col that is still untapped.

You might also like