Top Banner
Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved. 05/31/2017 Yuichi Kusakabe SS Engineering Group Fujitsu TEN LIMITED How To Use AGL CAN Signal 1
34

How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Aug 16, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

05/31/2017

Yuichi Kusakabe

SS Engineering Group

Fujitsu TEN LIMITED

How To Use AGL CAN Signal

1

Page 2: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

About Myself

2

Yuichi Kusakabe (Fujitsu TEN LIMITED)

Software Engineer of IVI about 10 years (for 16-bit and 32-bit architecture)

Linux Software Engineer(2011-2013) Linux Software Lead Engineer(2013-Now)

BSP Porting/Customizing Supporting for in-house software developers AGL(Automotive Grade Linux) Advisory Board member

Page 3: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

Agenda

3

What’s CAR CAN signal

Standard Linux CAN IF & OSS CAN Tool

How to use CAN signal to AGL

Demonstration & Results

Conclusion

Page 4: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

What’s CAR CAN Signal

4

Page 5: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

What’s CAR CAN Signal

5

Standard CAN Signal format(11bit).

Data line: D+/D-/GND(want) Baud rate: 500kbps CAN ID: 11bit(0x000~0x7FF) Data size: 0~8byte CAN Bus load: 20~75%

Standard CAN Signal is Low Speed(500kbps), But High frequency(**us).

https://ja.wikipedia.org/wiki/Controller_Area_Network

Page 6: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

Standard Linux CAN IF & OSS CAN Tool

6

Page 7: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

Standard Linux CAN IF(SocketCAN)

7

Linux kernel all ready CAN IF with Socket CAN

https://en.wikipedia.org/wiki/SocketCAN

Page 8: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

Standard Linux CAN IF(CAN Driver)

8

Linux kernel all ready CAN IF with Socket CAN

https://www.kernel.org/doc/Documentation/networking/can.txt

Page 9: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

OSS CAN Tool(Powerful software)

9

can-utils easy to debug CAN Signal (read/write/play)

https://github.com/linux-can/can-utils

Page 10: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

OSS CAN Tool(Powerful software)

10 https://github.com/linux-can/can-utils

ID=333(11bit), DATA=33 send=can0 # cansend can0 333#33 ID=00004444(24bit), DATA=44 send=can0 # cansend can0 00004444#44

CAN data send(cansend)

recv=can # candump can0 -ta root@porter:~# candump can0 -ta (1478869757.430017) can0 344 [8] FF EE 00 00 00 00 EE AA (1478869757.431290) can0 226 [8] E4 00 00 EE 00 EE EE 00 recv=all # candump any -ta

CAN data recv(candump)

Page 11: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

How to use CAN signal to AGL

11

Page 12: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

AMB(Automotive Message Broker)

12

This time AGL provide AMB, but AGL remake new CAN Signal handing FW.

https://github.com/otcshare/automotive-message-broker

This is OLD software

Page 13: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

Low level CAN service

13

Low level CAN service made to decode and write on CAN bus

https://gerrit.automotivelinux.org/gerrit/gitweb?p=apps/low-level-can-service.git;a=summary

Page 14: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

CAN key technology

14

CAN signal filtering(setting SocketCAN)

CAN ID xxx -> xx CAN signal thinning out

CAN cycle xx ms -> xxx ms CAN data convert AGL Standard

CAN ID Filtering and CAN DATA Thinning out is very important

SocketCAN

Low level CAN service

CAN Sample App

CAN

filtering

thinning

CAN DATA

Page 15: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

AGL CAN Software stack

15

AGL support easy to use CAN data

/dev/input/js0

can-utils

R-CAR M3

slcan0 vcan0 can0

AGL Simple CAN Simulator

Low level CAN service(afb)

Sample CAN Apps Sample CAN Apps

AGL CAN Software stack

USB-HID CAN USB-Serial

Page 16: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

Public CAN protocol(OpenXC)

16 http://openxcplatform.com/

Page 17: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved. 17 https://github.com/openxc/openxc-message-format

19 CAN Data

Public CAN protocol(OpenXC)

Page 18: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

Public CAN protocol(FMS)

18 http://www.fms-standard.com/Truck/down_load/fms_document_ver03_vers_14_09_2012.pdf

Page 19: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved. 19 http://www.fms-standard.com/Truck/down_load/fms_document_ver03_vers_14_09_2012.pdf

56 CAN Data(include Bus)

Public CAN protocol(FMS)

Page 20: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

Demonstration & Results

20

Page 21: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

Target Hardware spec

21 http://elinux.org/R-Car/Boards/

AGL reference Hardware to Renesas R-CAR M3

Page 22: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

R-CAR Expansion board

22 https://www.renesas.com/ja-jp/about/press-center/news/2017/news20170524.html

Page 23: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

Target Hardware spec

23 http://www.can232.com/?page_id=16

CANUSB easy connect CAN IF

Page 24: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved. 24 http://www.can232.com/?page_id=16

CANUSB connected CAN IF simple Hardware

Target Hardware spec

Page 25: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

AGL CAN Demonstration

25

USB-HID

/dev/input/js0

can-utils

R-CAR M3

vcan0

AGL Simple CAN Simulator

Low level CAN service(afb)

CESDEMO CAN Apps

Page 26: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

Software setup

26

CONFIG_CAN=y CONFIG_CAN_VCAN=y CONFIG_CAN_RCAR=y <- Renesas board only CONFIG_CAN_SLCAN=y CONFIG_USB_SERIAL=y CONFIG_USB_SERIAL_FTDI_SIO=y

Add Kernel defconfig CAN driver and CANUSB

yocto local.conf IMAGE_INSTALL_append = “ can-utils iproute2”

Add rootfs “can-utils” and “iproute2”

Setup CAN and CANUSB

CAN0 ip link set can0 type can bitrate 500000 ip link set can0 up

CANUSB slcand -o -s 6 -t hw /dev/ttyUSB* ip link set slcan0 up

Page 27: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

Software setup

27

./afb-daemon --token=${AFB_CANIVI_TOKEN} --ldpaths=. | --port=${AFB_CANIVI_PORT}- | --rootdir=. ${SERVICE_VERBOSE}

Start Low level CAN service(afb-deamon)

./afb-client-demo ws://localhost:5555/api?token=3210 canivi subscribe { "event" : "*" } <- receive all data canivi subscribe { "event" : "VehicleSpeed" } <- receive Vehicle Speed only

Setting CAN data receive

Page 28: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

Demonstration

28

Page 29: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

Performance measurement result

29

Data used for measurement logtime = 1122 sec, CAN ID cnt = 129, datacnt = 1042673 can load ave= 19.04%, min = 18.82%, max = 37.89% cyc ave[us] = 929, min = 8, max = 8565

Support CAN ID 42, Thinning out time ** -> 100ms AMB(d-bus) AFB (websocket)

Process name CPU load(%) Process name CPU load(%) AMB/AFB (vs)

Service ambd 16.97 afb-daemon 1.34 17.4

dbus-daemon 6.33

Client(App) AMBDBus_tp 4.26 afb-client-demo

0.82 5.2

CAN Sim canplayer 2.36 canplayer 1.51 -

Total * 30.65 * 3.67 8.3

Page 30: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

Next future

30

Support all in-vehicle communication(many CAN DATA and many Vehicle IF)

R-CAR M3

Original driver can0 can1

Low level CAN service(afb)

Sample CAN Apps Sample CAN Apps

AGL CAN Software stack

CAN0 CAN1

OEM DATA Center

OEM original interface

Page 31: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

Conclusion

31

Linux Kernel all ready use to CAN

OSS CAN Tool “can utils” is good software

AGL support easy to use CAN data Next step

Define AGL public CAR CAN data format -> With the cockpit architecture team AGL simple CAN simulator provide Support all in-vehicle communication

Page 32: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

Extra information

32

Page 33: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved.

Japanese How to Use Linux CAN

33 http://qiita.com/yuichi-kusakabe/items/e5b50aa3edb712bb6916

Page 34: How To Use AGL CAN Signal · 2017. 5. 26. · Linux Kernel all ready use to CAN OSS CAN Tool “can utils” is good software AGL support easy to use CAN data Next step Define AGL

Copyright © 2017 FUJITSU TEN LIMITED. All rights reserved. 34

Thank you!!!

[email protected]