FSD230: SimpleCAN Implementation

Description

This document describes the implementation of the SimpleCAN protocol in Safety Simplifier.

Motivations

Motivation: Title MOTIVATION_230_001
status: PASS
tags: fsd230
Source: SC_REQ_03

Safety simplifier operates in high demand continuous mode.

Motivation: Title MOTIVATION_230_002
status: PASS
tags: fsd230
Source: SC_REQ_04

See FSD350 SimpleCAN specification calculations.

Motivation: Title MOTIVATION_230_003
status: PASS
tags: fsd230
Source: SC_REQ_05

In simplecan_common.h, when data is received, the age is calculated. Before every logic tick, in canradio_update_age_timers, the age is checked. If the age is greater than the maximum age, the data is set to 0.

Motivation: Title MOTIVATION_230_004
status: PASS
tags: fsd230
Source: SC_REQ_06

Simplifier is compliant with 61508.

Motivation: Title MOTIVATION_230_005
status: PASS
tags: fsd230
Source: SC_REQ_07

see IEC 61000-6-7 (EMC) (CERT_0003)

Motivation: Title MOTIVATION_230_006
status: PASS
tags: fsd230
Source: SC_REQ_08

Safety data is independent from non-safety data: safety checksum is calculated only on safety data.

Motivation: Title MOTIVATION_230_007
status: PASS
tags: fsd230
Source: SC_REQ_09

No acknowledgement used.

Motivation: Title MOTIVATION_230_008
status: PASS
tags: fsd230
Source: SC_REQ_10

Model A used for transmission and reception.

Motivation: Title MOTIVATION_230_009
status: PASS
tags: fsd230, manual
Source: SC_REQ_11

The manual specifies how to use SimpleCAN with EN 11989-1.

Motivation: Title MOTIVATION_230_010
status: PASS
tags: fsd230
Source: SC_REQ_12

16 entries used in the SDD in Simplifier. These are mapped to 16 TX or RX IDs.

Motivation: Title MOTIVATION_230_011
status: PASS
tags: fsd230
Source: SC_REQ_14

Fatal errors are triggered directly from the SimpleCAN software implementation.

Motivation: Title MOTIVATION_230_012
status: PASS
tags: fsd230
Source: SC_REQ_15

16 node hashes are used to calculate the corresponding checksum for each TX/RX packet.

Motivation: Title MOTIVATION_230_013
status: PASS
tags: fsd230
Source: SC_REQ_16

The structure MM_CanConfig contains the safety configuration. It contains:

  • baud rate

  • mode

  • cycle time

  • tx slot index

  • number of tx packets

  • number of rx packets

  • which IDs to TX and RX

The node hashes are in MM_SimpleCAN_NetworkConfig.

Motivation: Title MOTIVATION_230_014
status: PASS
tags: fsd230
Source: SC_REQ_17

Hardware CRC with polynomial 04c11db7h is used.

Motivation: Title MOTIVATION_230_015
status: PASS
tags: fsd230
Source: SC_REQ_18

TX slot index determines when to transmit data.

Motivation: Title MOTIVATION_230_016
status: PASS
tags: fsd230
Source: SC_REQ_20

In simplecan_common.h, when data is received, the age is calculated. Before every logic tick, in canradio_update_age_timers, the age is checked. If the age is greater than the maximum age, the data is set to 0.

Motivation: Title MOTIVATION_230_017
status: PASS
tags: fsd230
Source: SC_REQ_21

PC software ensures the configuration contains two empty slots at the end of the cycle.

Motivation: Title MOTIVATION_230_018
status: PASS
tags: fsd230
Source: SC_REQ_22

Sync packets are sent the next cycle 200ms after last sync packet.

Motivation: Title MOTIVATION_230_019
status: PASS
tags: fsd230
Source: SC_REQ_23

simplecan_cfg_abort_sync_if_failed handles the abort of sync packets if failed.

Motivation: Title MOTIVATION_230_020
status: PASS
tags: fsd230
Source: SC_REQ_24

CPU1 forwards packets to CPU2 in model A.

Motivation: Title MOTIVATION_230_021
status: PASS
tags: fsd230
Source: SC_REQ_25

CPU1 handles the master determination. If a master with lower ID is heard, the current master is demoted to slave. If no master with lower ID is heard for 2000ms, the node takes over as master.

Motivation: Title MOTIVATION_230_022
status: PASS
tags: fsd230
Source: SC_REQ_26

If a node is master and hears a master with higher ID for 2000ms, it triggers fatal error.

Motivation: Title MOTIVATION_230_023
status: PASS
tags: fsd230
Source: SC_REQ_27

If a node can act as master it waits 200ms + 10*its lowest ID before sending the first time sync packet. If a lower ID is heard it switches to slave mode.

Motivation: Title MOTIVATION_230_024
status: PASS
tags: fsd230
Source: SC_REQ_28

If a node tried to send a sync packet and it fails it will back off and try again.

Motivation: Title MOTIVATION_230_025
status: PASS
tags: fsd230

All nodes start in unsynced state.

Motivation: Title MOTIVATION_230_026
status: PASS
tags: fsd230
Source: SC_REQ_30

Two time sync packets from the same master are required to enter synced state.

Motivation: Title MOTIVATION_230_027
status: PASS
tags: fsd230
Source: SC_REQ_31

12MHz 50ppm crystal is used.

Motivation: Title MOTIVATION_230_028
status: PASS
tags: fsd230
Source: SC_REQ_32

time_since_good_sync_ms checks this.

Motivation: Title MOTIVATION_230_029
status: PASS
tags: fsd230

CAN buffers are checked every ms. Max buffer time = 1ms.

Motivation: Title MOTIVATION_230_030
status: PASS
tags: fsd230
Source: SC_REQ_34

check_simplecan_config_or_fatal verifies configuration at startup.

Motivation: Title MOTIVATION_230_031
status: PASS
tags: fsd230
Source: SC_REQ_35

Configuration tool performs configuration download to SR devices in the network.

Motivation: Title MOTIVATION_230_032
status: PASS
tags: fsd230
Source: SC_REQ_36

Configuration tool reads back the configuration after download.

Motivation: Title MOTIVATION_230_033
status: PASS
tags: fsd230
Source: SC_REQ_37

Manual describes how to address SR devices on the network.

Motivation: Title MOTIVATION_230_034
status: PASS
tags: fsd230
Source: SC_REQ_38

Manual describes how to address SR devices on the network.

Motivation: Title MOTIVATION_230_035
status: PASS
tags: fsd230
Source: SC_REQ_39

Safety Simplfier can only be configured in configuration mode.

Motivation: Title MOTIVATION_230_036
status: PASS
tags: fsd230
Source: SC_REQ_40

SimpleCAN is not initialized in safe state.

Motivation: Title MOTIVATION_230_037
status: PASS
tags: fsd230
Source: SC_REQ_41

SimpleCAN is only initialized at normal mode startup.

Motivation: Title MOTIVATION_230_038
status: PASS
tags: fsd230
Source: SC_REQ_42

bad_rx_pkts_counter checks the number of packets with incorrect CRC per hour.

Motivation: Title MOTIVATION_230_039
status: PASS
tags: fsd230
Source: SC_REQ_43

Unauthorized access is checked for configuration via radio. Configuration directly via USB/CAN is not protected.

Motivation: Title MOTIVATION_230_040
status: PASS
tags: fsd230
Source: SC_REQ_44

Manual describes this in the SimpleCAN section.

Motivation: Title MOTIVATION_230_041
status: PASS
tags: fsd230
Source: SC_REQ_45

The age of all data is calculated and checked before every logic tick. The safety reaction time is configured for the SimpleCAN network by the user in the configuration tool.

Motivation: Title MOTIVATION_230_042
status: PASS
tags: fsd230
Source: SC_REQ_46

Manual describes this in the SimpleCAN section.