CN101783759B - Bus error recovery processing method - Google Patents

Bus error recovery processing method Download PDF

Info

Publication number
CN101783759B
CN101783759B CN2010103004646A CN201010300464A CN101783759B CN 101783759 B CN101783759 B CN 101783759B CN 2010103004646 A CN2010103004646 A CN 2010103004646A CN 201010300464 A CN201010300464 A CN 201010300464A CN 101783759 B CN101783759 B CN 101783759B
Authority
CN
China
Prior art keywords
bus
node
error
controller
state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN2010103004646A
Other languages
Chinese (zh)
Other versions
CN101783759A (en
Inventor
李书福
杨健
赵福全
朱祝阳
蔡伟杰
李亚南
熊想涛
王建磊
郑士岑
丁武俊
陈文强
由毅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Changshu intellectual property operation center Co.,Ltd.
Original Assignee
Zhejiang Geely Holding Group Co Ltd
Zhejiang Geely Automobile Research Institute Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Geely Holding Group Co Ltd, Zhejiang Geely Automobile Research Institute Co Ltd filed Critical Zhejiang Geely Holding Group Co Ltd
Priority to CN2010103004646A priority Critical patent/CN101783759B/en
Publication of CN101783759A publication Critical patent/CN101783759A/en
Application granted granted Critical
Publication of CN101783759B publication Critical patent/CN101783759B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The invention provides a bus error recovery processing method, which belongs to the technical field of CAN buses. The invention solves the problem that when the existing bus node enters a bus-off state by error, the bus node is difficult to recover to a normal operation state. In the bus error recovery processing method, the node detects the error and enters the 'bus-off state' to carry out error recovery processing operation which comprises the following steps: a, an error detection module detects error from time to time, and meanwhile, an error handling module controls the node to be in a corresponding state according to the counted error detected by the error detection module; b, a main controller controls the node to be disconnected with the CAN bus; c, the disconnection time T0 is kept, and when the time T0 is up, the step d is carried out; d, the main controller controls a CAN controller to be restarted up; and e, the CAN controller monitors the level signal of the CAN bus. The bus error recovery processing method has the advantage of timely eliminating the error detected on the node.

Description

A kind of bus error recovery processing method
Technical field
The invention belongs to CAN bussing technique field, relate to a kind of bus error recovery processing method.
Background technology
The CAN agreement provides complete wrong detection and error condition mechanism; Can detect crc error, affirmation mistake, format error, bit-errors and position fill-error etc.; When certain node detection when bus is made mistakes, will report to every other node with the form of erroneous frame.The transmission of error message will be ended, and resends as early as possible.And according to the count value of internal error counter (Tx, Rx), each CAN node can be set to initiatively error condition, passive error condition and these three kinds of mode of operations of bus closed condition.
When sending mistake or count of receive error all less than 128 the time, node is in " initiatively error condition "; Make a mistake or count of receive error greater than 128 o'clock, node is in " passive error condition "; Count greater than 256 o'clock and make a mistake, node is in " bus closed condition ".When node gets into " bus closed condition ", node will be in " bus closed condition " all the time and close the recovery sequence until receiving bus, and bus is closed and recovered sequence and be made up of 11 that repeat 128 times recessive continuously positions.
Can find out; Existing node is after getting into " bus closed condition "; Do not have corresponding valid function and handle, cause the CAN controller level on the monitoring bus always, just get into normal state (initiatively error condition) after only meeting 11 recessive continuously positions that monitor 128 times; The node that causes being in the bus closed condition will be waited for satisfying of this monitoring condition always, and can not work normally.
Summary of the invention
The objective of the invention is to the existing the problems referred to above of existing bus node, and proposed a kind of bus error recovery processing method that can after each node entering " bus closed condition ", can carry out recovery operation.
The object of the invention can be realized through following technical proposal: a kind of bus error recovery processing method; The node that is arranged on the CAN bus comprises CAN controller and master controller; Described CAN controller and master controller have error detection module and fault processing mechanism module respectively; Error detection module can be carried out wrong detection to CAN bus and node itself; Fault processing mechanism module then may command node is in " initiatively error condition ", " passive error condition " or " bus closed condition ", it is characterized in that, described node carries out the wrong operation that recovers to handle and comprises the steps: after detecting wrong also entering " bus closed condition "
A, error detection module be faults constantly, and fault processing mechanism module is in corresponding state according to the detected error count Control Node of error detection module simultaneously; Send wrong or receive wrong counting all less than 128 the time when detecting node, node is in " initiatively error condition ", and this state is the state that node can normally be participated in the CAN bus communication; When making a mistake or receiving wrong counting more than or equal to 128 and smaller or equal to 255 the time, node is in " passive error condition ", and this state is that node is prone to cause wrong state; When sending wrong counting greater than 256 the time, node is in " bus closed condition ", and this state is that node can not be participated in the state of communicating by letter on the bus, and gets into step b;
B, main controller controls node and CAN bus are broken off, and get into step c;
C, maintenance T0 opening time treat that timing T0 completely gets into steps d in the back;
D, main controller controls CAN controller are restarted, and restart posterior nodal point and are connected with the CAN bus again and get among the step e;
E, CAN controller are monitored level signal on the CAN bus, if the CAN controller monitors 11 continuous recessive positions 128 times in time T 1, then node gets into " initiatively error condition "; Otherwise then node gets into " bus closed condition ", and returns step b.
After each node is in the bus closed condition, in the time of appointment, do the bus error Restoration Mechanism according to aforesaid operations.
In above-mentioned a kind of bus error recovery processing method, among the described step e, count when returning step b, when counting more than or equal to N, node gets into " limping state ", and under this state, node can receive, but can not send.
In above-mentioned a kind of bus error recovery processing method, described N is 8~15.
In above-mentioned a kind of bus error recovery processing method, among the described step b, before main controller controls node and CAN bus are broken off, have one section time of delay T2.Utilize and supply CAN controller adjustment program during this period of time, the wrong detection of interrupt error detection module is restarted the back up to the CAN controller and is recovered.
Compared with prior art; This bus error recovery processing method can each node owing to inner software and hardware mistake of CAN controller self or bus on physical layer error get into " bus closed condition " back fault is investigated; So that respective nodes can be recovered rapidly, put into normal operating conditions from mistake.The bus that this processing method can be got rid of on the software or temporary mistake causes is closed, and detects to infer whether be the bus close state that permanent error (physical layer error) causes, so that let ECU get into " limping state ".
Description of drawings
Fig. 1 is the operational flowchart of this bus error recovery processing method.
Embodiment
Below be specific embodiment of the present invention and combine accompanying drawing, technical scheme of the present invention is done further to describe, but the present invention is not limited to these embodiment.
Node in this bus error recovery processing method is connected on the CAN bus; Include CAN controller and master controller (MCU); CAN controller and master controller (MCU) have error detection module and fault processing mechanism module respectively, and error detection module can be carried out wrong detection to CAN bus and node itself.CAN controller MCP2510 has two error counters: count of receive error device (REC), and send error counter (TEC).And master controller (MCU) can read the value of these two counters, and these two counters increase and decrease counting according to the CAN bus specification.Each node can be in " initiatively error condition ", " passive error condition " and " bus closed condition " these three kinds of states according to error count in this bus error recovery processing method, and concrete condition is following:
If the value of two counters is lower than simultaneously at 128 o'clock, node is in " initiatively error condition "; When the value of two counters wherein has a counting more than or equal to 128 and smaller or equal to 255 the time, node is in " passive error condition "; When the value of sending error counter (TEC) greater than 256 the time, node is in " bus closed condition ".These states rely on transmission error count and acceptance error to count and manage, and which kind of state decision gets into according to count value.The relation of error condition and count value is as shown in the table:
Figure G201010300464620100119D000031
" initiatively error condition " is common state; It is the state that normally to participate in bus communication; The node that is in this state can not receive any message and active erroneous frame (being made up of the dominance position) of restrictedly sending; When the unit that is in " initiatively error condition " detected mistake, output is error flag initiatively.
" passive error condition " is to be prone to cause wrong state.Be in " passive error condition " though the unit can participate in bus communication, for not hindering other unit communications, can not send error notification energetically during reception, but can send message and passive erroneous frame (constituting) by recessive position.Be in " passive error condition " though the unit make mistake, and other is in " initiatively error condition " if the unit do not find mistake, whole bus also is considered to not have wrong.
" bus closed condition " is to participate in the state of communicating by letter on the bus, and the reception of information and transmission all are under an embargo.
In addition, the node in this bus error recovery processing method can also get into " limping state ", and under this state, node can receive, but can not send data.
As shown in Figure 1, node carries out the wrong operation that recovers to handle and comprises the steps: after detecting wrong also entering " bus closed condition "
A, error detection module detect CAN bus and the mistake of node own constantly; When the value of sending error counter (TEC) and count of receive error device (REC) all less than 128 the time, node is in " active error condition "; When making a mistake or receiving wrong counting more than or equal to 128 and smaller or equal to 255 the time, node is in " passive error condition "; When sending wrong counting greater than 256 the time, node is in " bus closed condition ", and gets into step b;
The situation that causes node to get into " bus closed condition " has two kinds, and the inner software and hardware of a kind of CAN of being controller is made mistakes and caused node to get into " bus closed condition ", and this situation possibly be because CAN controller internal processes is made mistakes; Another kind of situation is that the bus physical layer mistake causes node to get into " bus closed condition ".
Behind b, the time of delay T2, master controller (MCU) Control Node and CAN bus are broken off, and get into step c; Utilize this section T2 time of delay to supply CAN controller adjustment program, the wrong detection of interrupt error detection module is restarted the back up to the CAN controller and is recovered.
C, maintenance T0 opening time treat that timing T0 completely gets into steps d in the back.This opening time, T0 was used for that master controller (MCU) is revised the register value of CAN controller the inside so that the CAN controller level on the monitoring bus no longer.
D, master controller (MCU) control CAN controller is restarted, and restarts posterior nodal point and is connected with the CAN bus again and gets among the step e;
E, CAN controller are monitored level signal on the CAN bus, if the CAN controller monitors 11 continuous recessive positions 128 times in time T 1, then node gets into " initiatively error condition "; Otherwise then node gets into " bus closed condition ", returns step b.CAN control restart the back send error counter (TEC) and count of receive error device (REC) all can zero clearing; Therefore node at first can get into " initiatively error condition "; If the count value of sending error counter (TEC) and count of receive error device (REC) afterwards reaches the condition of entering " passive error condition ", then node gets into " passive error condition ".Bus is exactly to detect 11 continuous recessive positions 128 times at the unique conditional of " bus closed condition " entering " initiatively error condition ".
If still can't fix a breakdown at the appointed time so that node when getting into " initiatively error condition " or " passive error condition ", judges that promptly the CAN controller is other inner permanent error, so entering " limping state " through above-mentioned steps.Make all nodes get into " initiatively error condition " as if fixing a breakdown at the appointed time according to above-mentioned steps, promptly be regarded as the bus physical layer permanent error, each node all gets into " limping state ".After node gets into " limping state ", receive only external data and no longer give the outside data (think self internal data unreliable) of sending, self some basic function of inter-process is to guarantee the basic function of car.If can recover at the appointed time, so unified entering the " initiatively error condition ".
Specific embodiment described herein only is that the present invention's spirit is illustrated.Person of ordinary skill in the field of the present invention can make various modifications or replenishes or adopt similar mode to substitute described specific embodiment, but can't depart from spirit of the present invention or surmount the defined scope of appended claims.

Claims (2)

1. bus error recovery processing method; The node that is arranged on the CAN bus comprises CAN controller and master controller; The wrong detection module of described CAN controling appliance; Described master controller has fault processing mechanism module, and error detection module can be carried out wrong detection to CAN bus and node itself, and fault processing mechanism module then may command node is in " initiatively error condition ", " passive error condition " or " bus closed condition "; It is characterized in that described bus error recovery processing method comprises the steps:
A, error detection module be faults constantly, and fault processing mechanism module is in corresponding state according to the detected error count Control Node of error detection module simultaneously; When detect node send wrong with receive wrong counting all less than 128 the time, node is in " initiatively error condition ", this state is the state that node can normally be participated in the CAN bus communication; When making a mistake or receiving wrong counting more than or equal to 128 and smaller or equal to 255 the time, node is in " passive error condition ", and this state is that node is prone to cause wrong state; When sending wrong counting greater than 256 the time, node is in " bus closed condition ", and this state is that node can not be participated in the state of communicating by letter on the bus, and gets into step b;
Behind b, the time of delay T2, main controller controls node and CAN bus are broken off, and get into step c; Utilize this section T2 time of delay to supply CAN controller adjustment program, the wrong detection of interrupt error detection module is restarted the back up to the CAN controller and is recovered;
C, maintenance T0 opening time treat that timing T0 completely gets into steps d in the back; This opening time, T0 was used for that master controller is revised the register value of CAN controller the inside so that the CAN controller level on the monitoring bus no longer;
D, main controller controls CAN controller are restarted, and restart posterior nodal point and are connected with the CAN bus again and get among the step e;
E, CAN controller are monitored level signal on the CAN bus, if the CAN controller monitors 11 continuous recessive positions 128 times in time T 1, then node gets into " initiatively error condition "; Otherwise then node gets into " bus closed condition ", and returns step b; Count when returning step b, when counting more than or equal to N, node gets into " limping state ", and under this state, node can receive, but can not send.
2. bus error recovery processing method according to claim 1 is characterized in that, described N is 8~15.
CN2010103004646A 2010-01-19 2010-01-19 Bus error recovery processing method Active CN101783759B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2010103004646A CN101783759B (en) 2010-01-19 2010-01-19 Bus error recovery processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2010103004646A CN101783759B (en) 2010-01-19 2010-01-19 Bus error recovery processing method

Publications (2)

Publication Number Publication Date
CN101783759A CN101783759A (en) 2010-07-21
CN101783759B true CN101783759B (en) 2012-02-01

Family

ID=42523584

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2010103004646A Active CN101783759B (en) 2010-01-19 2010-01-19 Bus error recovery processing method

Country Status (1)

Country Link
CN (1) CN101783759B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104635549A (en) * 2013-11-07 2015-05-20 北汽福田汽车股份有限公司 Can bus error processing method and can controller
CN105159285B (en) * 2015-09-17 2017-09-12 北京汽车股份有限公司 CAN controller bus failure treating method and apparatus
KR102474800B1 (en) * 2016-12-15 2022-12-06 현대자동차주식회사 Gateway and Method for controlling Gateway
CN107659465B (en) * 2017-09-13 2020-06-23 北京新能源汽车股份有限公司 Device and method for checking error frames of CAN (controller area network) bus of whole vehicle
CN110147090B (en) * 2019-06-30 2020-12-22 潍柴动力股份有限公司 Method and system for processing controller local area network bus closing fault
CN110601945A (en) * 2019-10-31 2019-12-20 上海无线电设备研究所 Dual-redundancy CAN bus communication system and communication method
CN113098654A (en) * 2019-12-23 2021-07-09 北京神经元网络技术有限公司 User running state detection method and device of high-speed industrial communication system
CN113037584B (en) * 2019-12-25 2023-10-20 北京东土科技股份有限公司 Node state detection method, device, equipment and storage medium
CN111273636A (en) * 2020-01-19 2020-06-12 湖北三江航天红峰控制有限公司 Method for processing power-on error frame of CAN bus
CN114679374B (en) * 2020-12-24 2024-08-06 上海汽车集团股份有限公司 Reset control method and device and electronic equipment
CN112859713B (en) * 2021-02-08 2022-04-19 航天科工空间工程发展有限公司 Autonomous error correction management method for CAN bus of spacecraft
CN114265807A (en) * 2021-12-22 2022-04-01 飞瑞医疗器械(嘉兴)有限公司 Self-recovery method and device for closing beam limiter CAN bus and electronic equipment
CN114495365A (en) * 2022-02-16 2022-05-13 深圳万橙物联科技有限公司 Intelligent meal taking cabinet and control method thereof

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1909484A (en) * 2006-08-22 2007-02-07 哈尔滨工业大学 CAN wrong frame generating and detecting system and its method
CN101217444A (en) * 2008-01-21 2008-07-09 浙江大学 Network control method based on CAN bus
CN101458528A (en) * 2008-12-23 2009-06-17 华东理工大学 On-line fault detection system based on CAN bus

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1909484A (en) * 2006-08-22 2007-02-07 哈尔滨工业大学 CAN wrong frame generating and detecting system and its method
CN101217444A (en) * 2008-01-21 2008-07-09 浙江大学 Network control method based on CAN bus
CN101458528A (en) * 2008-12-23 2009-06-17 华东理工大学 On-line fault detection system based on CAN bus

Also Published As

Publication number Publication date
CN101783759A (en) 2010-07-21

Similar Documents

Publication Publication Date Title
CN101783759B (en) Bus error recovery processing method
CN103377083B (en) For the method for the automated system for running redundancy
US11385951B2 (en) Monitoring and analyzing watchdog messages in an internet of things network environment
RU2606053C2 (en) Method of controlling change in state interconnection node
US8665700B2 (en) Fault detection and mitigation for in-vehicle LAN network management
US8823498B2 (en) Transceiver
CN102984059B (en) Gigabit Ethernet redundancy network interface card and link switching condition criterion output control method thereof
JP2011526110A (en) Fault node detection method
CN103516571A (en) System architecture and method for ensuring data communication reliability by means of double CAN buses
CN101296065A (en) Method and system for improving reliability of redundancy main station
CN101420350A (en) Master node failure tolerant method for TTCAN bus network time
US20090290485A1 (en) Distributed communication system and corresponding communication method
US8228953B2 (en) Bus guardian as well as method for monitoring communication between and among a number of nodes, node comprising such bus guardian, and distributed communication system comprising such nodes
KR20130100780A (en) Apparatus and method for providing global time information in event-controlled bus communication
CN103095703A (en) Method and equipment and system for achieving data interaction between network and serial port
JP2014054911A (en) Electronic controller
US10055322B2 (en) Interpreting signals received from redundant buses
EP2940935B1 (en) Controller area network (CAN) device and method for controlling CAN traffic
CN103279404A (en) Multi-computer system synchronization and reliability detection method based on heartbeat status words
CN103840956A (en) Backup method for gateway device of Internet of Things
CN101674201B (en) Method for actively triggering active standby switch of Ethernet switch clustering
JP6028717B2 (en) COMMUNICATION SYSTEM, GATEWAY DEVICE, AND COMMUNICATION METHOD
CN101964731A (en) Method and device for monitoring data link
Pattanaik et al. Recovery and reliability prediction in fault tolerant automotive embedded system
TWI784379B (en) control system, control method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20201021

Address after: Unit 2414-2416, main building, no.371, Wushan Road, Tianhe District, Guangzhou City, Guangdong Province

Patentee after: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd.

Address before: 317000 No. 229 Dongfang Avenue, Linhai City, Zhejiang Province

Patentee before: ZHEJIANG GEELY AUTOMOBILE RESEARCH INSTITUTE Co.,Ltd.

Patentee before: ZHEJIANG GEELY HOLDING GROUP Co.,Ltd.

Effective date of registration: 20201021

Address after: 215500 No.13, Caotang Road, Changshu, Suzhou, Jiangsu Province

Patentee after: Changshu intellectual property operation center Co.,Ltd.

Address before: Unit 2414-2416, main building, no.371, Wushan Road, Tianhe District, Guangzhou City, Guangdong Province

Patentee before: GUANGDONG GAOHANG INTELLECTUAL PROPERTY OPERATION Co.,Ltd.

CP02 Change in the address of a patent holder
CP02 Change in the address of a patent holder

Address after: 215500 5th floor, building 4, 68 Lianfeng Road, Changfu street, Changshu City, Suzhou City, Jiangsu Province

Patentee after: Changshu intellectual property operation center Co.,Ltd.

Address before: No.13 caodang Road, Changshu City, Suzhou City, Jiangsu Province

Patentee before: Changshu intellectual property operation center Co.,Ltd.