CN103425123A - Automated testing method for CAN (controller area network) bus based on software script - Google Patents
Automated testing method for CAN (controller area network) bus based on software script Download PDFInfo
- Publication number
- CN103425123A CN103425123A CN2013103551016A CN201310355101A CN103425123A CN 103425123 A CN103425123 A CN 103425123A CN 2013103551016 A CN2013103551016 A CN 2013103551016A CN 201310355101 A CN201310355101 A CN 201310355101A CN 103425123 A CN103425123 A CN 103425123A
- Authority
- CN
- China
- Prior art keywords
- bus
- microcontroller
- testing method
- automated testing
- test
- 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
- Debugging And Monitoring (AREA)
Abstract
The invention relates to a testing system and method for a CAN (controller area network) bus. The system comprises a microcontroller, at least two CAN controllers and a USB (universal serial bus) module. The system is characterized in that the microcontroller is connected with the CAN controllers, each CAN controller can be independently connected to one CAN bus, a testing script is edited on an upper computer and directly executed in a memory of the upper computer after compiled by the upper computer, a control command is transmitted to a lower computer by a USB interface in the testing process, and related equipment with CAN interfaces is automatically tested.
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 the test procedure for the entry write specialized of needs test, and 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.
The test procedure of the entry write specialized of testing for needs has the following disadvantages: 1, special test procedure is executable program, in test process, revises certain parameter if need, or increase certain tested entries, all need this program is modified, compiling again, development efficiency is low; 2, special test procedure is portable poor, and node that need to be tested for each is write a test procedure, poor expandability
Summary of the invention
Purpose of the present invention, exactly in order to overcome the defect itself had of writing of carrying out CAN bus automatic test program based on PC, replace special test procedure with test script, make the tester only need to pay close attention to writing and debugging of script, and need not be concerned about the structure of whole test macro and the data transmission problems in test process, so improve development efficiency; Carry out secondary development by script, also increased the extensibility of test procedure simultaneously
Concrete technical scheme provided by the invention is as follows:
A kind of CAN bus automated testing method based on software scripts, use microcontroller to be connected with at least two CAN controllers, each CAN controller is connected to respectively on the CAN bus, thereby microcontroller carries out by usb bus and PC the transmitting-receiving that data transmission realizes the CAN message, carry out test script on PC, the relevant device with CAN interface is carried out to automatic test.
A kind of CAN bus automated testing method based on software scripts, comprise hardware circuit, program of lower computer and host computer procedure.
A kind of CAN bus automated testing method based on software scripts, 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 software scripts, 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 software scripts, after described USB module receives the order of host computer, be configured microcontroller, comprises configuration of CAN bus parameter etc.
A kind of CAN bus automated testing method based on software scripts, described test script will be edited and be compiled in the Application Program Interface of host computer, and the file loaded after compiling by testing engine is carried out automatic test.
A kind of CAN bus automated testing method based on software scripts, the test script of described testing engine based on having compiled, the data of returning according to USB interface, with the particular event in test process, generation is handed down to the message of tested node, be issued to the lower computer hardware circuit by USB interface, and send on the bus with tested node place via the lower computer hardware circuit.
A kind of CAN bus automated testing method based on software scripts, its advantage is, 1, reasonable in design, clear in structure, given full play to text editing ability that host computer is stronger and the advantage of processing power; 2, extensibility is good, and test script can be modified easily, and is transplanted on similar tested node.
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), local CAN sends buffer zone (203), local CAN reception buffer zone (204), testing engine (205), test data reception buffer zone (208), test data sends buffer zone (209), computer CPU (211), test execution application program (212)
In Fig. 3, USB driver (301), USB reception buffer zone (302), data processor (303), USB sends buffer zone (304), compilation script (305), script compile program (306), test script editing machine (307), test process display routine (308), testing engine (309), the dependent event in test process (310)
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 saved in test data buffer zone (209) by calling receiver function (204) by the message of receiving, by USB module (106) by these data upload to PC (109).
The transmission flow of lower computer hardware circuit (110) is, slave computer microcontroller (101) reads the message data that will send from USB module (106) from test data reception buffer zone (208), send buffer zone by sending the CAN that function (203) will send to the message of tested node to put into CAN controller (102) again, send to the CANH(104 of CAN bus via CAN controller (102) by CAN transceiver (103)) and CANL(105) on.
In Fig. 3, the test execution 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).
The flow process that host computer test executive (212) is monitored tested node is, by USB driver (301), the message of the tested node of monitoring is put into to USB reception buffer zone (302), and via host computer test executive (212), received message is passed to data processor (303), after processing, by test process display routine (308), shown.
The flow process that host computer test executive (212) is carried out automatic test is, the test script of use test script-editor (307) compiles user, and compile it as compiler test script (305) by script compile program (306), carry out compiler test script (305) by testing engine (309), in implementation, testing engine is according to current received CAN bus data, with the dependent event (310) in test process, judge that current testing procedure is success or failure, generate the test packet that need to issue simultaneously, and put it in USB transmission buffer zone (304), and be handed down to lower computer hardware circuit (110) via USB driver (301), and by the lower computer hardware circuit, send on the CAN bus at tested node place.
Claims (7)
1. the CAN bus automated testing method based on software scripts, by microcontroller, at least two CAN controllers and a USB module, formed, 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, thereby microcontroller carries out by usb bus and PC the transmitting-receiving that data transmission realizes the CAN message, carries out test script on PC, the relevant device with CAN interface is carried out to automatic test.
2. a kind of CAN bus automated testing method based on software scripts 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 software scripts 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 software scripts according to claim 3, it is characterized in that, 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.
5. a kind of CAN bus automated testing method based on software scripts according to claim 4, is characterized in that, after described USB module receives the order of host computer, microcontroller is configured, and comprises configuration of CAN bus parameter etc.
6. a kind of CAN bus automated testing method based on software scripts according to claim 2, it is characterized in that, at the Application Program Interface inediting test script of host computer procedure, and script is compiled, and the file loaded after compiling by testing engine is carried out automatic test.
7. a kind of CAN bus automated testing method based on software scripts according to claim 6, it is characterized in that, the test script of described testing engine based on having compiled, the data of returning according to USB interface, with the particular event in test process, generation is handed down to the message of tested node, by USB interface, is issued to the lower computer hardware circuit, and sends on the bus with tested node place via the lower computer hardware circuit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2013103551016A CN103425123A (en) | 2013-08-15 | 2013-08-15 | Automated testing method for CAN (controller area network) bus based on software script |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2013103551016A CN103425123A (en) | 2013-08-15 | 2013-08-15 | Automated testing method for CAN (controller area network) bus based on software script |
Publications (1)
Publication Number | Publication Date |
---|---|
CN103425123A true CN103425123A (en) | 2013-12-04 |
Family
ID=49650024
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2013103551016A Pending CN103425123A (en) | 2013-08-15 | 2013-08-15 | Automated testing method for CAN (controller area network) bus based on software script |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103425123A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106445751A (en) * | 2016-08-30 | 2017-02-22 | 大唐微电子技术有限公司 | Debugging board, debugging system and debugging method |
CN106789449A (en) * | 2017-02-22 | 2017-05-31 | 安徽优旦科技有限公司 | A kind of CAN exploitation and method of testing and system |
CN106850372A (en) * | 2017-02-22 | 2017-06-13 | 重庆长安汽车股份有限公司 | A kind of method of testing and system of controller CAN signal |
CN109406916A (en) * | 2018-12-14 | 2019-03-01 | 武汉精鸿电子技术有限公司 | A kind of test platform for semiconductor memory ageing tester |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101494571A (en) * | 2009-01-22 | 2009-07-29 | 上海华魏自动化设备有限公司 | CAN bus self detection recovery device and method |
CN101882108A (en) * | 2010-06-30 | 2010-11-10 | 三一重机有限公司 | Embedded software automatic test system and method thereof |
CN102479134A (en) * | 2010-11-25 | 2012-05-30 | 上海华虹集成电路有限责任公司 | System and method for testing universal interface |
JP2013077159A (en) * | 2011-09-30 | 2013-04-25 | Hitachi Solutions Ltd | Test automation system |
-
2013
- 2013-08-15 CN CN2013103551016A patent/CN103425123A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101494571A (en) * | 2009-01-22 | 2009-07-29 | 上海华魏自动化设备有限公司 | CAN bus self detection recovery device and method |
CN101882108A (en) * | 2010-06-30 | 2010-11-10 | 三一重机有限公司 | Embedded software automatic test system and method thereof |
CN102479134A (en) * | 2010-11-25 | 2012-05-30 | 上海华虹集成电路有限责任公司 | System and method for testing universal interface |
JP2013077159A (en) * | 2011-09-30 | 2013-04-25 | Hitachi Solutions Ltd | Test automation system |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106445751A (en) * | 2016-08-30 | 2017-02-22 | 大唐微电子技术有限公司 | Debugging board, debugging system and debugging method |
CN106789449A (en) * | 2017-02-22 | 2017-05-31 | 安徽优旦科技有限公司 | A kind of CAN exploitation and method of testing and system |
CN106850372A (en) * | 2017-02-22 | 2017-06-13 | 重庆长安汽车股份有限公司 | A kind of method of testing and system of controller CAN signal |
CN106850372B (en) * | 2017-02-22 | 2020-04-21 | 重庆长安新能源汽车科技有限公司 | Method and system for testing controller CAN signal |
CN109406916A (en) * | 2018-12-14 | 2019-03-01 | 武汉精鸿电子技术有限公司 | A kind of test platform for semiconductor memory ageing tester |
CN109406916B (en) * | 2018-12-14 | 2021-07-23 | 武汉精鸿电子技术有限公司 | Test platform for semiconductor memory aging test device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107704346B (en) | SOC chip debugging method and system | |
CN103440187A (en) | Hardware script-based automated CAN (Controller Area Network) bus test method | |
CN102662835B (en) | A kind of program debugging method for embedded system and embedded system | |
CN112653738B (en) | Internet of things network debugging system and method | |
CN107907814B (en) | Method for improving mass production test efficiency of chips | |
CN102917095A (en) | Method and device for testing terminal based on Android | |
US9292411B2 (en) | Wireless debugging and updating of firmware | |
JP2007147352A (en) | Wireless interface module and electronic equipment | |
CN103425123A (en) | Automated testing method for CAN (controller area network) bus based on software script | |
CN102854455A (en) | Integrated circuit testing system and control method for same | |
CN104219003A (en) | Communication device, test system and test method thereof | |
CN103269291A (en) | ADB debugging method by utilizing point-to-point radio frequency equipment on android platform | |
CN103428050A (en) | Multipath CAN (controller area network) simulation system based on CAN bus | |
CN204347211U (en) | A kind of many relay functions proving installation | |
CN203754167U (en) | Handheld terminal for elevator debugging and maintenance | |
CN103092800A (en) | Data conversion experimental platform | |
CN113630294B (en) | Switch modularization detection method and device | |
CN103414606A (en) | FlexRay bus automated testing method based on hardware script | |
CN202453435U (en) | Debug control device, debug execution device and debug system | |
CN103414622A (en) | Simulation method based on CAN buses | |
CN103428049A (en) | Automated testing method for FlexRay bus based on software script | |
CN101582928B (en) | Adaptive device and data transmission method for communication of veneer and peripheral device | |
CN103414620A (en) | Double-channel CAN simulation system based on CAN buses | |
CN103269292B (en) | Short distance microwave telecommunication devices are utilized to carry out the method for debugging acid ADB debugging | |
CN103269293A (en) | ADB debugging method by utilizing microwave communication equipment on android platform |
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: 20131204 |