cancel
Showing results for 
Search instead for 
Did you mean: 

SMTF32F1x CAN bus Error Frame

Dick Lin
Senior
Posted on February 17, 2017 at 18:54

Hi,

I am seeing Error Frame from one of our project using STM32F1x MCU. Any recommendation how to debug this issue?

Thanks,

Dick

112.227000 1 108 Rx d 8 db 1f c0 69 ee 89 e8 3e

112.227000 1 109 Rx d 8 86 31 94 43 00 00 00 00

112.227000 1 10a Rx d 8 00 00 00 00 6d 86 ec bf

112.228000 1 10b Rx d 8 00 00 00 00 04 00 00 40

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 ErrorFrame ECC: 11011001

112.228000 1 6fe Rx d 8 00 49 82 56 53 29 39 16

112.229000 1 6fe Rx d 8 00 32 4e 38 37 86 23 21

112.229000 1 6fe Rx d 8 00 50 65 55 49 54 30 02
16 REPLIES 16
Posted on March 16, 2017 at 23:52

Hi,

power off the whole system, and use a multimeter to read 60Ohms...

120Ohms at each end is 60Ohms

Dick Lin
Senior
Posted on March 17, 2017 at 00:56

I did try both battery power and power supply, same result.

Posted on March 17, 2017 at 01:37

are the issues more or less obvious when the UAV is operating ?

how thick is the ground wire ?

what did you do to suppress the 5V Switcher noise ?

do you have an isolated CAN module ? Can you try one ?

Jeroen3
Senior
Posted on March 17, 2017 at 07:43

What is the bus load and how much are error frames?

You are to expect error frames, CAN bus can handle this up the bus-off limit. It will retransmit. If you go over the bus-off limit, then you should be worried.

If you application is idling, thus no noise generating devices are enabled, do you have errors?

Are you following the standard? Eg: no two nodes transmit the same ID, nodes have a little pause between identical identifiers. Cable is twisted pair. Cable can be shielded.

Both ends of the bus are 120 ohm terminated, preferably split termination. Stub length is under 1.5 meter. (for 250 kbit)

I've build a system with ~40 meters of cable and ~50 nodes at 250kbit with many VFD's and relays. Sometimes when relays switch, an error frame occurs.

CAN is designed to handle this. Is your application?

Dick Lin
Senior
Posted on March 17, 2017 at 15:42

The definition of the error I have. See below. Thx

ErrorFrame ECC: 11011001

11 other type of error

  • 0 TX
  • 0x19 acknowledge slot

Bit 7 Bit 6 Meaning

0 0 bit error

0 1 form error

1 0 stuff error

1 1 other type of error

Bit 5 Meaning

0 TX; error occurred during transmission

1 RX; error occurred during reception

Bit 4..0 Meaning

0x03 start of frame

0x02 ID.28 to ID.21

0x06 ID.20 to ID.18

0x04 bit SRTR

0x05 bit IDE

0x07 ID.17 to ID.13

0x0F ID.12 to ID.5

0x0E ID.4 to ID.0

0x0C bit RTR

0x0D reserved bit 1

0x09 reserved bit 0

0x0B data length code

0x0A data field

0x08 CRC sequence

0x18 CRC delimiter

0x19 acknowledge slot

0x1B acknowledge delimiter

0x1A end of frame

0x12 intermission

0x11 active error flag

0x16 passive error flag

0x13 tolerate dominant bits

0x17 error delimiter

0x1C overload flag

ACK slot

The acknowledge slot is used to acknowledge the receipt of a valid CAN frame.

Each node that receives the frame without finding an error, transmits a dominant level in the ACK slot and thus overrides the recessive level of the transmitter.

If a transmitter detects a recessive level in the ACK slot it knows that no receiver found a valid frame.

A receiving node may transmit a recessive to indicate that it did not receive a valid frame, but another node that did receive a valid frame may override this with a dominant.

The transmitting node cannot know that the message has been received by all of the nodes on the CAN network.

ACKNOWLEDGEMENT ERROR

Detected by the transmitter if a dominant value is not found in the

ack slot
Dick Lin
Senior
Posted on March 17, 2017 at 15:51

Bus load about 20~25%. I think it's pretty normal.

Posted on March 17, 2017 at 19:57

Do you have ACK errors?  How many active nodes are bus-on? You need at least 2 active nodes for CAN bus to work.

A receiving node may transmit a recessive to indicate that it did not receive a valid frame, but another node that did receive a valid frame may override this with a dominant.

If a receiving node does not receive a correct CAN frame, it won't ACK but it will send and error frame. This is, iirc, 6 dominant bit times. (violates stuffing rule, is an error frame)

Either all nodes receive the message, or no nodes receive the message. If some nodes do, they will discard it on an error frame.