CN103440187A - Hardware script-based automated CAN (Controller Area Network) bus test method - Google Patents
Hardware script-based automated CAN (Controller Area Network) bus test method Download PDFInfo
- Publication number
- CN103440187A CN103440187A CN2013103550901A CN201310355090A CN103440187A CN 103440187 A CN103440187 A CN 103440187A CN 2013103550901 A CN2013103550901 A CN 2013103550901A CN 201310355090 A CN201310355090 A CN 201310355090A CN 103440187 A CN103440187 A CN 103440187A
- Authority
- CN
- China
- Prior art keywords
- bus
- test
- script
- microcontroller
- hardware
- 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.)
- Pending
Links
Images
Landscapes
- Test And Diagnosis Of Digital Computers (AREA)
Abstract
The invention relates to a hardware script-based automated CAN bus test system and a hardware script-based automated CAN bus test method which are aimed at CAN buses. The hardware script-based automated CAN bus test system comprises a microcontroller, at least two CAN controllers and a USB (Universal Serial Bus) module, and is characterized in that the microcontroller is connected with the CAN controllers, each CAN controller can be independently connected with a CAN bus, a test script is edited on an upper computer, the upper computer compiles and then downloads the test script into the memory of the microcontroller, and the test script is executed in the memory of the microcontroller to automatically test a related device with a CAN interface.
Description
Technical field
The present invention relates to the method for testing of electronic technology field, particularly a kind of method of testing for the CAN bus.
Background technology
The CAN bus, as the communication interface between each microcontroller, has a wide range of applications in automobile and industry, along with the complicacy of each microcontroller internal processes based on the CAN bus is more and more higher, just increasing problem may appear in actual applications, this just needs by the method based on the CAN bus test, send relevant message as test input to unit under test, and the response message that obtains unit under test feeds back as content measurement, and the content of feedback and expection are compared, come to the same thing and think that the performance index of current test reach requirement, otherwise be not up to standard, need to modify and carry out repetition measurement the logic of microcontroller, thereby find as early as possible and deal with problems, guarantee reliability and the robustness of corresponding microcontroller in actual moving process.
Based on the CAN bus, tested ECU (Electrical Control Unit) is carried out to automatic test, common way is to write one by one test case for the entry of needs test, and on host computer, carry out one by one, by corresponding interface (such as USB turns the equipment of CAN bus), the message that needs are sent is issued on the bus be connected with tested node, read the response of tested node from bus, thereby compare at host computer simultaneously.
At host computer operation test script, have the following disadvantages: 1, host computer is non-real-time system, and there is unpredictable time delay in system, thereby can not guarantee that the message of precise time sends, and receives and timing function; 2, by specific CAN translation interface, computing machine is connected with the CAN bus, making an event on the CAN bus pass to host computer has huge time overhead, be all usually Millisecond other, test macro can not be made response in time, testing efficiency is low.
Summary of the invention
Purpose of the present invention, exactly in order to overcome the defect of carrying out the real-time deficiency of CAN bus automatic test based on PC, a kind of scheme of hardware implement test script is provided, thereby has eliminated the non real-time property of host computer and the impact that transmission delay is brought, improved testing efficiency and precision.
Concrete technical scheme provided by the invention is as follows:
A kind of CAN bus automated testing method based on the hardware script, use microcontroller to be connected with at least two CAN controllers, each CAN controller is connected to respectively on the CAN bus, in the microcontroller internal memory, carries out test script, and the relevant device with CAN interface is carried out to automatic test.
A kind of CAN bus automated testing method based on the hardware script, comprise hardware circuit, program of lower computer and host computer procedure.
A kind of CAN bus automated testing method based on the hardware script, described hardware circuit is comprised of microcontroller, at least two CAN controllers, USB modules; Microcontroller is connected with at least two CAN controllers, and each CAN controller connects a CAN transceiver, and each CAN transceiver all is connected to one independently on the CAN bus.
A kind of CAN bus automated testing method based on the hardware script, after described CAN controller listens to CAN message or erroneous frame on bus, by the data feedback monitored to microcontroller, microcontroller reads in local message reception buffer zone by it, and the data in reception buffer zone are uploaded to PC by the USB module.
A kind of CAN bus automated testing method based on the hardware script, described local message reception buffer zone, will be read by microcontroller, and carry out the comparison in test process, and comparison result is uploaded to host computer by the USB module.
A kind of CAN bus automated testing method based on the hardware script, after receiving the order of host computer by described USB module, microcontroller is configured, comprises the configuration of carrying out test script, the configuration of CAN bus parameter, the startup of test and stopping etc.
A kind of CAN bus automated testing method based on the hardware script, described PC control can be controlled test process, by USB interface, the data of returning in test process is shown in Application Program Interface simultaneously.
A kind of CAN bus automated testing method based on the hardware script, described test script will be edited and be compiled in the Application Program Interface of host computer, and by USB interface, the content after compiling be downloaded to the slave computer preservation and carries out
A kind of CAN bus automated testing method based on the hardware script, its advantage is, 1, reasonable in design, clear in structure, given full play to the microcontroller real-time good, and host computer has stronger text editing ability and the advantage of display capabilities; 2, real-time performance is good, and in the test script implementation, response can be accomplished the microsecond rank, and delay and the control data transmission of having eliminated system responses postpone, and efficiency is greatly improved
The accompanying drawing explanation
Fig. 1 is CAN bus automatic test hardware general frame figure in the invention process method
The process flow diagram that Fig. 2 is slave computer in the invention process method
Fig. 3 is host computer process flow diagram in the invention process method
In Fig. 1, microcontroller (101), CAN controller (102), CAN transceiver (103), CAN bus CANH(104), CAN bus CANL(105), USB module (106), PC (109), lower computer hardware circuit (110), USB line (111), tested node (112)
In Fig. 2, CAN controller reception buffer zone (201), the CAN controller sends buffer zone (202), and local CAN sends buffer zone (203), local CAN reception buffer zone (204), testing engine (205), the dependent event in test process (206), the test script compiled (207), test data reception buffer zone (208), test data sends buffer zone (209), computer CPU (211), test configurations application program (212)
In Fig. 3, USB driver (301), USB reception buffer zone (302), data processor (303), USB sends buffer zone (304), configuration data (305), script compile program (306), test script editing machine (307), test process display routine (308)
Embodiment
In Fig. 1, lower computer hardware circuit (110) comprises microcontroller (101), USB module (106) and CAN transceiver (103), lower computer hardware circuit (110) is connected to PC (109) by USB cable (111), simultaneously by CAN bus CANH(104) and CANL(105) be connected to tested node (112).
The inner integrated CAN transceiver of tested node (112) (103).
Microcontroller (101) connects at least two CAN controllers (102), the TX pin of each CAN controller and RX pin are connected respectively TX pin and the RX pin of CAN transceiver (103), the CANH of CAN transceiver is connected to CAN bus CANH(104), the CANL of CAN transceiver is connected to the CANL(105 of CAN bus).
Microcontroller (101), inner integrated CPU and internal memory, be connected with one or more independently CAN controllers; Or inner integrated one or more CAN controllers; What Fig. 1 showed is the situation of inner integrated two the CAN controllers of microcontroller (102).
CAN controller (102), as the protocol conversion chip of CAN bus, be responsible for the information such as the message on the CAN bus and erroneous frame are fed back to microcontroller, and each CAN controller has TX and the RX pin be connected with the CAN transceiver.
In Fig. 2, lower computer hardware circuit (110) is connected to PC (109) by USB cable (111), and PC (109) comprises at least one central processing unit (211), PC (109) internal operation test configurations application program (212).
Lower computer hardware circuit (110) is by connecting CAN bus CANH(104) and CAN bus CANL(105) with tested node, communicate.
The flow process that lower computer hardware circuit (110) receives the message of tested node is, after its CAN controller (102) listens to the CAN message by CAN transceiver (103), by its buffer memory to inner CAN reception buffer zone (201), and notice microcontroller (101), microcontroller (101) is submitted to testing engine (205) by calling receiver function (204) by the message of receiving, testing engine (205) judges according to received telegraph literary composition whether test case is passed through; Simultaneously microcontroller is saved in test data buffer zone (209) by it, by USB module (106) by these data upload to PC (109).
The testing process of lower computer hardware circuit (110) is, slave computer microcontroller (101) reads the relevant test data from USB module (106) from test data reception buffer zone (208), these test datas configure and issue by PC (109), microcontroller (101) always extracts the test script (207) compiled in the test data of self-test data reception buffer zone (208), and flow to testing engine (205), the test script (207) of testing engine based on having compiled, the message (204) returned according to current state-event (206) and tested node determines that current testing procedure is success or failure, and generation sends to the message of tested node, by sending function (203), will send to the message of tested node to put into the CAN transmission buffer zone of CAN controller (102), send to the CANH(104 of CAN bus by CAN transceiver (103) via CAN controller (102)) and CANL(105) on.
In Fig. 3, the test configurations application program (212) of host computer internal operation is connected to USB cable (111) by USB driver (301), thereby and sets up usb communication between lower computer hardware circuit (110).
Host computer test configurations program (212) shows that the flow process of current test mode is, the usb data that to upload from slave computer is put into USB reception buffer zone (302), reading out data from USB reception buffer zone (302) again, and, after processing by data processor (303), via test process display routine (308), show.
The process that host computer test configurations program (212) transmits test configurations to lower computer hardware is, the test script of use test script-editor (307) compiles user, and compile it as corresponding configuration data (305) by script compile program (306), and transfer data in USB transmission buffer zone (304), be issued to slave computer via USB driver (301).
Claims (8)
1. the CAN bus automated testing method based on the hardware script, it comprises microcontroller, at least two CAN controllers, a USB module, it is characterized in that, use microcontroller to be connected with at least two CAN controllers, each CAN controller is connected to respectively on the CAN bus, at host computer editor test script, at host computer compiler test script, and by USB interface, the test script compiled is downloaded to slave computer, and carry out test script in the microcontroller internal memory of slave computer, the relevant device with CAN interface is carried out to automatic test.
2. a kind of CAN bus automated testing method based on the hardware script according to claim 1, is characterized in that, system comprises hardware circuit, program of lower computer and host computer procedure.
3. a kind of CAN bus automated testing method based on the hardware script according to claim 2, is characterized in that, the hardware circuit of system is comprised of microcontroller, at least two CAN controllers, USB modules; Microcontroller is connected with at least two CAN controllers, and each CAN controller connects a CAN transceiver, and each CAN transceiver all is connected to one independently on the CAN bus.
4. a kind of CAN bus automated testing method based on the hardware script according to claim 3, it is characterized in that, after the CAN controller of system listens to CAN message or erroneous frame on bus, by the data feedback monitored to microcontroller, microcontroller reads in local message reception buffer zone by it, and the data in reception buffer zone are uploaded to PC by the USB module.
5. a kind of CAN bus automated testing method based on the hardware script according to claim 4, it is characterized in that, microcontroller reads described local message reception buffer zone, and carries out the comparison in test process, and comparison result is uploaded to host computer by the USB module.
6. a kind of CAN bus automated testing method based on the hardware script according to claim 5, after receiving the order of host computer by described USB module, program of lower computer is configured, comprise the configuration of carrying out test script, the configuration of CAN bus parameter, the startup of test and stopping etc.
7. a kind of CAN bus automated testing method based on the hardware script according to claim 2, it is characterized in that, described host computer procedure can be controlled test process, by USB interface, the data of returning in test process is shown in Application Program Interface simultaneously.
8. a kind of CAN bus automated testing method based on the hardware script according to claim 7, it is characterized in that, described test script will be edited and be compiled in the Application Program Interface of host computer, and by USB interface, the content after compiling be downloaded to the slave computer preservation and carries out.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2013103550901A CN103440187A (en) | 2013-08-15 | 2013-08-15 | Hardware script-based automated CAN (Controller Area Network) bus test method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2013103550901A CN103440187A (en) | 2013-08-15 | 2013-08-15 | Hardware script-based automated CAN (Controller Area Network) bus test method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103440187A true CN103440187A (en) | 2013-12-11 |
Family
ID=49693878
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2013103550901A Pending CN103440187A (en) | 2013-08-15 | 2013-08-15 | Hardware script-based automated CAN (Controller Area Network) bus test method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103440187A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105677560A (en) * | 2015-12-31 | 2016-06-15 | 北京经纬恒润科技有限公司 | Testing method, device and system |
CN106789449A (en) * | 2017-02-22 | 2017-05-31 | 安徽优旦科技有限公司 | A kind of CAN exploitation and method of testing and system |
CN106886214A (en) * | 2017-03-28 | 2017-06-23 | 天津大学 | CAN controller chip functions test system and method for testing |
CN107533494A (en) * | 2015-05-11 | 2018-01-02 | 高通股份有限公司 | Extended pattern interframe space (EIFS) is exempted |
CN109062747A (en) * | 2018-08-03 | 2018-12-21 | 北京航空航天大学 | Digital satellite embedded simulation environment intelligent test method |
CN112612264A (en) * | 2020-12-22 | 2021-04-06 | 北京时代民芯科技有限公司 | Serial port self-testing method in CAN bus controller |
CN113094029A (en) * | 2020-01-08 | 2021-07-09 | 广州汽车集团股份有限公司 | Automatic CAPL code generation method and system and automobile |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060088044A1 (en) * | 2004-10-26 | 2006-04-27 | Robert Hammerl | Node for a bus network, a bus network and a method for configuration of the network |
US20100162090A1 (en) * | 2001-10-20 | 2010-06-24 | Christoph Emde | Method of detecting data transmission errors in a CAN controller, and a CAN controller for carrying out the method |
CN101882108A (en) * | 2010-06-30 | 2010-11-10 | 三一重机有限公司 | Embedded software automatic test system and method thereof |
CN102393738A (en) * | 2011-12-16 | 2012-03-28 | 哈尔滨工业大学 | Diagnostic device and test method of automobile electronic control unit (ECU) |
CN102565671A (en) * | 2011-12-16 | 2012-07-11 | 电子科技大学 | Dynamic allocation method for on-line programming of integrated circuit tester |
CN102929277A (en) * | 2012-11-22 | 2013-02-13 | 山东省科学院自动化研究所 | Universal test tool for autobody electronic unit and working method thereof |
-
2013
- 2013-08-15 CN CN2013103550901A patent/CN103440187A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20100162090A1 (en) * | 2001-10-20 | 2010-06-24 | Christoph Emde | Method of detecting data transmission errors in a CAN controller, and a CAN controller for carrying out the method |
US20060088044A1 (en) * | 2004-10-26 | 2006-04-27 | Robert Hammerl | Node for a bus network, a bus network and a method for configuration of the network |
CN101882108A (en) * | 2010-06-30 | 2010-11-10 | 三一重机有限公司 | Embedded software automatic test system and method thereof |
CN102393738A (en) * | 2011-12-16 | 2012-03-28 | 哈尔滨工业大学 | Diagnostic device and test method of automobile electronic control unit (ECU) |
CN102565671A (en) * | 2011-12-16 | 2012-07-11 | 电子科技大学 | Dynamic allocation method for on-line programming of integrated circuit tester |
CN102929277A (en) * | 2012-11-22 | 2013-02-13 | 山东省科学院自动化研究所 | Universal test tool for autobody electronic unit and working method thereof |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107533494A (en) * | 2015-05-11 | 2018-01-02 | 高通股份有限公司 | Extended pattern interframe space (EIFS) is exempted |
CN105677560A (en) * | 2015-12-31 | 2016-06-15 | 北京经纬恒润科技有限公司 | Testing method, device and system |
CN105677560B (en) * | 2015-12-31 | 2018-07-03 | 北京经纬恒润科技有限公司 | A kind of test method, apparatus and system |
CN106789449A (en) * | 2017-02-22 | 2017-05-31 | 安徽优旦科技有限公司 | A kind of CAN exploitation and method of testing and system |
CN106886214A (en) * | 2017-03-28 | 2017-06-23 | 天津大学 | CAN controller chip functions test system and method for testing |
CN109062747A (en) * | 2018-08-03 | 2018-12-21 | 北京航空航天大学 | Digital satellite embedded simulation environment intelligent test method |
CN109062747B (en) * | 2018-08-03 | 2020-11-13 | 北京航空航天大学 | Intelligent testing method for digital satellite embedded simulation platform |
CN113094029A (en) * | 2020-01-08 | 2021-07-09 | 广州汽车集团股份有限公司 | Automatic CAPL code generation method and system and automobile |
CN113094029B (en) * | 2020-01-08 | 2023-08-22 | 广汽埃安新能源汽车有限公司 | CAPL code automatic generation method, system and automobile |
CN112612264A (en) * | 2020-12-22 | 2021-04-06 | 北京时代民芯科技有限公司 | Serial port self-testing method in CAN bus controller |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103440187A (en) | Hardware script-based automated CAN (Controller Area Network) bus test method | |
CN103714029B (en) | Novel two-line synchronous communication protocol and application | |
CN107704346B (en) | SOC chip debugging method and system | |
CN107066746B (en) | Method for realizing PCA9555 function through CPLD based on I2C interface | |
CN104407279A (en) | Code type data, apparatus and test method for automatically testing chip MDIO bus protocol | |
CN105183575A (en) | Processor fault diagnosis method, device and system | |
KR101185971B1 (en) | Communication system, test device, communication device, communication method, and test method | |
CN104219003A (en) | Communication device, test system and test method thereof | |
CN103425123A (en) | Automated testing method for CAN (controller area network) bus based on software script | |
CN103428050A (en) | Multipath CAN (controller area network) simulation system based on CAN bus | |
CN110247936B (en) | Communication protocol conversion card and communication protocol conversion system | |
CN202975800U (en) | CAN (controller area network) bus diagnosis system based on WIFI (wireless fidelity) and mobile intelligent terminal | |
CN103414606A (en) | FlexRay bus automated testing method based on hardware script | |
CN105068967B (en) | Control method, device and the terminal of I2C equipment | |
CN103414620A (en) | Double-channel CAN simulation system based on CAN buses | |
CN110096002A (en) | A kind of automatization test system and test method based on CANFD bus | |
CN103414622A (en) | Simulation method based on CAN buses | |
CN106130829B (en) | Bus test method and device | |
CN103428049A (en) | Automated testing method for FlexRay bus based on software script | |
CN103517307B (en) | A kind of remote debugging system based on TD-SCDMA | |
CN103812830A (en) | Protocol authentication method used for bus slave station equipment | |
CN103269292B (en) | Short distance microwave telecommunication devices are utilized to carry out the method for debugging acid ADB debugging | |
CN110557309A (en) | CAN FD bus automatic control system and method based on hardware logic | |
CN101833528A (en) | Method for regulating transmission speed of electronic equipment | |
CN109981394B (en) | Communication method and device based on enhanced CAN bus protocol analyzer |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C02 | Deemed withdrawal of patent application after publication (patent law 2001) | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20131211 |