
AT32F413
Series Reference Manual
2022.06.27
Page 302
Rev 2.00
20.6.7 Error management
The status of CAN nodes is indicated by the receive error counter (TEC) and transmit error counter
(REC) bits in the CAN_ESTS register. In the meantime, the ETR[2: 0] bit in the CAN_ESTS register is
used to record the last error source, and the corresponding interrupts will be generated when the
CAN_INTEN register is enabled.
Error active flag: When both TEC and REC are lower than 128, the system is in the error active
state. An error active flag is set when an error is detected.
Error passive flag: When either TEC or REC is greater than 127, the system is in the error passive
state. An error passive flag is set when an error is detected.
Bus-off state: The bus-off state is entered when TEC is greater than 255. In this state, it is
impossible to transmit and receive messages. The CAN resumes from bus-off state in two ways:
Option 1: When AEBOEN=0 in the CAN_MCTRL register, in communication mode, the software
requests to enter Frozen mode and exit Frozen mode, and CAN will then resume from bus-off
state after 128 occurences of 11 consecutive recessive bits have been detected on the CAN RX
pin.
Option 2: When AEBOEN=1 in the CAN_MCTRL register, the CAN will resume from bus-off state
automatically after 128 occurrences of 11 consecutive recessive bits have been detected on the
CAN RX pin
20.7 CAN registers
These peripheral registers must be accessed by word (32 bits).
Table 20-1
CAN register map and reset values
Register
Offset
Reset value
MCTRL
000h
0x0001 0002
MSTS
004h
0x0000 0C02
TSTS
008h
0x1C00 0000
RF0
00Ch
0x0000 0000
FR1
010h
0x0000 0000
INTEN
014h
0x0000 0000
ESTS
018h
0x0000 0000
BTMG
01Ch
0x0123 0000
Reserved
020h~17Fh
xx
TMI0
180h
0xXXXX XXXX
TMC0
184h
0xXXXX XXXX
TMDTL0
188h
0xXXXX XXXX
TMDTH0
18Ch
0xXXXX XXXX
TMI1
190h
0xXXXX XXXX
TMC1
194h
0xXXXX XXXX
TMDTL1
198h
0xXXXX XXXX
TMDTH1
19Ch
0xXXXX XXXX
TMI2
1A0h
0xXXXX XXXX
TMC2
1A4h
0xXXXX XXXX
TMDTL2
1A8h
0xXXXX XXXX
TMDTH2
1ACh
0xXXXX XXXX
RFI0
1B0h
0xXXXX XXXX