CAN Status

Purpose

Provide access to the CAN bus status

Library

STM32

Description

../../_images/can_status.svg

The block provides access to the error counter registers of a can interface. All nodes on a CAN bus detect errors and maintain two error counters: Transmit Error Counter and a Receive Error Counter. Each node can be in one of the following 3 error modes:

error active (1)

This is the start mode of all the nodes, when both error counters are less than \(128\). In this mode, a node fully participates in bus communication and transmits an active error flag when it detects errors.

error passive (2)

When one of the two error counters is greater than \(127\), a node goes into error passive mode. In this mode, a node still participates in bus activities, but transmits a passive error flag when it detects errors.

bus-off (3)

When the Transmit Error Counter is greater than \(255\), a node goes into a bus-off mode. When in this mode, the node is disconnected from the bus and can no longer participate in bus activities. If Auto bus-on is not enabled, a bus-off condition has to be cleared by setting the enable signal to \(0\), and then back to \(1\). After recovering from bus-off condition, both the error counters are reset to \(0\) and the node goes into error active mode.

The output REC provides the Receive Error Counter, the output TEC the Transmit Error Counter. The output st is \(1\) to signal error active status, \(2\) to signal error passive status and \(3\) to signal bus-off status.

Parameters

CAN interface

Selects the CAN interface to use. The selected CAN interface must be configured using a CAN Port block.