GPIO driver test system, method, device and storage medium
By designing the GPIO-driven test system and using the automated testing process of the main controller and other modules, the differences caused by manual GPIO-driven test in the existing technology are solved, and more accurate and effective test results are achieved.
Patent Information
- Application Number
- CN202410052581.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-12
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2044-01-12
AI Technical Summary
In the prior art, most of the GPIO-driven testing processes are carried out manually, which are prone to manual testing differences, which affects the accuracy of the test results.
A GPIO-driven test system was designed, including the main controller, test hardware module, signal matrix module and GPIO test suite module. Through automated testing processes, differences caused by manual testing are avoided.
It realizes automation of GPIO-driven testing, reduces the error caused by manual testing, and provides more accurate and effective test results.
Smart Images

Figure CN117851150B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of GPIO testing technology, and in particular to a GPIO driver testing system, method, device and storage medium. Background Art
[0002] The application needs to call the GPIO (General Purpose Input / Output) driver to control and detect external devices. For example, it can output a "high" level or a "low" level through GPIO to drive the internal circuit of the external hardware device, thereby controlling each external device; it can read the digital level input through GPIO to detect the external device.
[0003] In order to ensure the stability of the GPIO driver, it needs to undergo corresponding functional tests, such as level input / output test, level flip speed test, maximum drive current test, etc. In the development of the GPIO driver, the chip platform itself cannot verify whether the code function is correct, and it often needs to use other measuring instruments (such as oscilloscopes, multimeters) and external functional test modules (such as circuits that implement different functions) for auxiliary verification.
[0004] In the related art, for GPIO driver testing, the testing process is mostly manual testing by developers or testers, and the testing process requires connecting various functional test modules and measuring instruments, which is prone to manual testing differences and affects the test results. Summary of the invention
[0005] The embodiments of the present application provide a GPIO driver test system, method, device and storage medium, which solve the problem that the manual testing process is prone to cause differences and affect the test results. This solution can complete automated testing and effectively avoid the differences caused by manual testing, which helps to provide more accurate and effective test results.
[0006] In a first aspect, an embodiment of the present application provides a GPIO driver test system, which includes a main controller, a test hardware module, a signal matrix module and a GPIO test suite module.
[0007] Among them, the main controller is used to output signals through the communication interface thereon; the test hardware module is connected to the main controller through the firmware download port to burn the test firmware, and the test hardware module is also communicated with the main controller, and the test hardware module is used to output the tested signal through GPIO or feedback the output signal corresponding to the test result to the main controller when the first control instruction output by the main controller is received; the signal matrix module is connected to the test hardware module, the signal matrix module is provided with multiple input interfaces to connect the GPIO of the test hardware module, and the signal matrix module is also communicated with the main controller, and the signal matrix module is used to select the output channel according to the second control instruction received from the main controller; the GPIO test suite module is connected to the signal matrix module, and the GPIO test suite module is provided with multiple detection interfaces to connect the output end of the signal matrix module one by one, the GPIO test suite module is also communicated with the main controller, and the GPIO test suite module is used to select a signal for detection according to the third control signal received from the main controller.
[0008] In a second aspect, an embodiment of the present application further provides a GPIO driver test method, the GPIO driver test method uses a main controller in the above-mentioned GPIO driver test system, the main controller is provided with a GPIO driver and a test script, the method comprising:
[0009] Compile the GPIO driver to generate firmware corresponding to the GPIO driver;
[0010] Importing firmware to the test hardware module so that the test hardware module can load the firmware;
[0011] Run the test script to send corresponding control signals to the test hardware module, the signal matrix module and the GPIO test suite module respectively, and make the test hardware module or the GPIO test suite module output an output signal corresponding to the test result;
[0012] When an output signal corresponding to a test result is received, a test report corresponding to the test result is generated based on a preset report template.
[0013] In a third aspect, an embodiment of the present application further provides a GPIO driver test device, which uses a main controller in the above-mentioned GPIO driver test system, and a GPIO driver program and a test script are provided in the main controller, and the device includes:
[0014] A program compiling module, configured to compile the GPIO driver to generate firmware corresponding to the GPIO driver;
[0015] a firmware import module, configured to import the firmware into the test hardware module so that the test hardware module loads the firmware;
[0016] A script running module, configured to run the test script to send corresponding control signals to the test hardware module, the signal matrix module and the GPIO test suite module respectively;
[0017] The report output module is configured to generate a test report corresponding to the test result based on a preset report template when an output signal corresponding to the test result is received.
[0018] In a fourth aspect, an embodiment of the present application further provides a storage medium storing computer executable instructions, which are used to execute the above-mentioned GPIO driver test method when executed by a processor.
[0019] In the present application, the main controller can control other modules in the GPIO driver test system by running the set test script, thereby providing an output channel from the GPIO to the test module for the signal under test to complete the functional test. The main controller can also generate a test report corresponding to the test results in combination with the signal feedback from the test hardware module and / or the GPIO test suite module for the tester to review. The test process is simple and does not require manual testing by the tester, thereby effectively avoiding the differences caused by manual testing and helping to provide more accurate and effective test results. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A schematic diagram of the structure of a GPIO driver test system provided in one embodiment of the present application;
[0021] Figure 2 A schematic diagram of the steps of a GPIO driver testing method provided in one embodiment of the present application;
[0022] Figure 3 A schematic diagram of controlling a GPIO driver test provided in an embodiment of the present application;
[0023] Figure 4 A schematic diagram of the structure of a GPIO driver test device provided in one embodiment of the present application;
[0024] Figure 5 A schematic diagram of the structure of a main controller provided in one embodiment of the present application. DETAILED DESCRIPTION
[0025] The embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are only used to explain the embodiments of the present application, rather than to limit the embodiments of the present application. It should also be noted that, for ease of description, only the parts related to the embodiments of the present application rather than all structures are shown in the accompanying drawings, and those skilled in the art should be able to think of it after reading the specification of this application that as long as the technical features do not contradict each other, any combination of the technical features can constitute an optional implementation method.
[0026] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally a class, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally represents that the objects associated with each other are in an "or" relationship. In the description of the present application, "multiple" means two or more, and "several" means one or more.
[0027] In order to ensure the stability of the GPIO driver, GPIO needs to undergo "complete" functional tests, such as level input / output test, level flip speed test, maximum drive current test, interrupt response test, etc. And for GPIO driver testing, related technologies usually require developers or testers to manually test, which will introduce manual test differences in the test results, making the test results inaccurate.
[0028] In this regard, the present application provides a GPIO driver testing system. Figure 1 A structural diagram of a GPIO driver test system provided for an embodiment of the present application, as shown in the figure, the system includes a main controller, a test hardware module, a signal matrix module and a GPIO test suite module, wherein the main controller is respectively connected to the test hardware module, the signal matrix module and the GPIO test suite module in communication, such as the main controller establishes communication connections with the test hardware module, the signal matrix module and the GPIO test suite module respectively through a CAN bus, and therefore, the main controller outputs corresponding signals to each module through a communication interface thereon. It should be noted that in some embodiments, the main controller can also establish communication connections with the above modules through buses such as I2C, RS485, and SPI.
[0029] The test hardware module is also connected to the main controller through the firmware download port, so that the main controller burns the test firmware to the test hardware module. It is conceivable that the test hardware module can be an MCU (Microcontroller Unit) platform, such as DSP (Digital Singnal Processor), FPGA (Field Programmable Gate Array), etc., and accordingly, the main controller can also be configured with a program download tool related to the test hardware module to burn the test firmware.
[0030] The signal matrix module is also connected to the test hardware module, and the multi-channel input interface of the signal matrix module is respectively connected to the GPIO of the test hardware module. It can be understood that the main controller can send a first control instruction to the test hardware module, so that the test hardware module responds to the instruction and outputs the measured signal through the GPIO thereon, or feeds back the output signal corresponding to the test result to the main controller. Therefore, the measured signal output by the test hardware module through the GPIO can be transferred to the signal matrix module.
[0031] The signal matrix module is provided with multiple output channels to transfer the measured signals connected from the multiple input interfaces to the next level modules accordingly. Moreover, the signal matrix module is connected to the main controller in communication, that is, the main controller can output the second control signal to the signal matrix module to select the corresponding output channel.
[0032] The GPIO test suite module is connected to the signal matrix module, and the multi-channel detection interface of the GPIO test suite module is respectively connected to the output end of the signal matrix module, so as to access the measured signal selected through the corresponding output channel. It can be understood that the GPIO test suite module is connected to the main controller in communication, and accordingly, the main controller can output a third control signal to the GPIO test suite module so that the GPIO test suite module selects one signal for testing.
[0033] It is understandable that the main controller is provided with a corresponding GPIO driver and test script, and the GPIO driver needs to be loaded into the test hardware module for the test hardware module to run. The test script is a program for the control system to perform GPIO driver testing. When running the test script, the main controller can output corresponding control signals to control the test hardware module, signal matrix module and GPIO test suite module in the system. Therefore, after the main controller loads the GPIO driver into the test hardware module, the main controller runs the program under test to send corresponding control signals to each module, thereby completing the corresponding functional test.
[0034] It can be seen from the above scheme that the main controller burns the test firmware to the test hardware module so that the test hardware module can output the test signal through the GPIO thereon, and the main controller can also output corresponding control signals to the test hardware module, the signal matrix module and the GPIO test suite module, so that the test signal enters the GPIO test suite module through the output channel in the signal matrix module for functional testing. Therefore, through signal control, the test signal can be connected to the corresponding test module for testing without the need for manual testing by the tester, which effectively avoids the differences caused by manual testing and helps to provide more accurate and effective test results.
[0035] In some embodiments, the test hardware module is provided with a plurality of GPIOs, and accordingly, the signal matrix module includes a DB50 interface, a signal relay unit and a DB8 interface. It can be imagined that the DB50 interface is used as an interface in the signal matrix module for connecting the GPIO of the test hardware module, which can access the signals output by 50 GPIOs and output 50 signals in turn. Therefore, the number of DB50 interfaces provided in the signal matrix module satisfies the number of GPIOs. For example, if the number of GPIOs is 200, the number of DB50 interfaces is 4 accordingly.
[0036] Moreover, the number of signal relay units is adapted to the number of output terminals of all DB50 interfaces, and the input terminal of each signal relay unit is respectively connected to the output terminal of the corresponding DB50 interface. It can be understood that if the number of DB50 interfaces is 4 and each signal relay unit has 8 input terminals and 8 output terminals, then correspondingly, 25 signal relay units can be set to connect the output terminals of 4 DB50 interfaces.
[0037] The DB8 interface can receive 8 signals and output 8 signals in turn. The output ends of multiple signal relay units are connected to the DB8 interface in a parallel cascade manner, that is, the output end of each signal relay unit is connected to the DB8 interface, so that the signal matrix module can convert multiple signal inputs into 8 signal outputs. Moreover, the signal matrix module can control the signal relay unit to switch the corresponding output channel according to the control signal sent by the main controller, thereby completing the selection of the output channel, and then output the signal of the selected output channel as 8 signals.
[0038] Therefore, the signal matrix module provides multiple on-off controlled output channels, which can select the corresponding output channel according to the control signal output by the main controller to select a specific number of signals from the multiple input signals and output them to the next-level module, thereby better utilizing the tested signals for functional testing.
[0039] In one embodiment, the signal relay unit includes 8 input terminals and 8 output terminals to form 8 output channels, and the signal relay unit includes an MCU, a communication interface, and a driver unit. Among them, the MCU is connected to the main controller through the communication interface, and the MCU is connected to the driver unit. It can be understood that the control signal output by the main controller to the signal driver module can be received by the MCU through the communication interface, so that the MCU outputs a corresponding signal to the driver unit to adjust the on and off of the 8 output channels, and then selects one of the output channels, thereby realizing the selection of the signal output by one GPIO.
[0040] It is understandable that the signals provided by the multiple GPIOs of the test hardware module are connected by the signal matrix module and the corresponding channels are selected to be turned on according to the control signal sent by the main controller, so as to pass the signal to the GPIO test suite module. Therefore, after the main controller runs the test script, the control signal sent to the signal matrix module can be received by the MCU in the signal relay unit through the communication interface, thereby controlling the on and off of the output channel. Similarly, other signal relay units also select the corresponding output channel to be turned on in response to the control signal, and then select 8 signals from the multiple signals and output them to the GPIO test suite module to assist in functional testing and help to better complete the test.
[0041] In some embodiments, the GPIO test suite module includes a signal bridge module and multiple test modules. The signal bridge module has multiple input terminals and multiple output terminals. The input terminal of the signal bridge module is connected to the output terminal of the signal matrix module. For example, the signal matrix module has 8 output terminals. Accordingly, the GPIO test suite module has 8 detection interfaces to correspondingly connect the 8 output terminals of the signal matrix module. The input terminal of the signal bridge module is connected to the above-mentioned detection interface to access the signal transmitted by the signal matrix module.
[0042] The multiple output ends of the signal bridge module are connected to each test module respectively, that is, after receiving the control signal sent by the main controller, the signal bridge module is used to connect one signal to a test module. The test module is used to perform different functional tests, such as level input / output test, level flip speed test, maximum drive current test, etc. It can be imagined that different test modules are used to perform different functional tests. The test module is a related circuit for functional testing. After the signal under test is connected to the test module, the test module can generate a test result accordingly, so that the GPIO test suite module can feedback the output signal corresponding to the test result.
[0043] The test module is used to perform different functional tests. The GPIO test suite module bridges a test signal to the corresponding test module according to the control signal sent by the main controller. For example, the test module includes a module for testing the GPIO low-level input and floating input functions. The test module can control whether the tested signal is grounded through a switch to perform a low-level input test when grounded or a floating input test when suspended. It can be imagined that when performing a low-level input test or a floating input test, it is also necessary to detect the voltage in the current scenario, so that the main controller can determine whether the tested signal output through the GPIO can meet the corresponding voltage requirements in the two test scenarios.
[0044] Therefore, the GPIO test suite module can select and conduct the corresponding path according to the control signal of the main controller to connect the tested signal to the corresponding test module. During the test, the tester can use the main controller to output the corresponding control signal, without the need for manual testing by the tester, which reduces the differences caused by manual testing and helps to improve the accuracy of the test results.
[0045] In one embodiment, the signal bridge module includes two signal relay units, each signal relay unit includes 8 input terminals and 8 output terminals to form 8 outputs. In the signal bridge module, the 8 output terminals of one signal relay unit are integrated into one output as the target output terminal, that is, the 8 output terminals of the signal relay unit are connected to the same terminal, and then serve as a common output terminal, that is, the target output terminal; and the 8 input terminals of the other signal relay unit are integrated into one input as the target input terminal, that is, the 8 input terminals of the signal relay unit are connected to the same terminal, and then serve as a common input terminal, that is, the target input terminal. Furthermore, the target output terminal is connected to the target input terminal, so that the signal bridge module forms an 8-input 8-output module, and each input has 8 output channels, so that the signal enters the corresponding test module.
[0046] It can be imagined that after the main controller outputs the third control signal to the GPIO test suite module, the signal bridging module in the GPIO test suite module can select one signal input corresponding to the control signal, and select one output corresponding to the control signal, and then pass the connected signal to the selected output channel, thereby connecting to the corresponding test module for functional testing.
[0047] Exemplarily, the test hardware module has 200 GPIOs, and accordingly, the signal matrix module is provided with 4 DB50 interfaces, 25 signal relay units and 1 DB8 interface. The signal matrix module is connected to the GPIOs of the test hardware module through the 4 DB50 interfaces, and the input ends of the 25 signal relay units are connected to the output ends of the DB50 interfaces, and the output ends of the signal relay units are connected to the DB8 interfaces. It can be imagined that the signal matrix module uses the signal relay units thereon to form multiple output channels, and then controls the conduction and closing of the output channels according to the received control signals, so as to transmit the tested signals connected from the corresponding GPIO to the GPIO test suite module.
[0048] The GPIO test suite module is connected to the pins of the DB8 interface through 8 detection interfaces, and the GPIO test suite module includes a signal bridge module and 8 test modules. The signal bridge module has 8 input terminals and 8 output terminals to connect the detection interfaces and the test modules. It can be understood that the signal bridge module is connected to the 8 detection interfaces respectively, and the 8 output terminals of the signal bridge module are connected to different test modules respectively. Then, the tested signals connected from each detection interface can be bridged to the corresponding test module through the bridge module accordingly for functional testing.
[0049] Therefore, the main controller can control the signal bridging module in the GPIO test suite module to form a corresponding path to bridge the tested signal to the target test module, thereby quickly completing the functional test of different test items.
[0050] Figure 2 The following is a schematic diagram of the steps of the GPIO driver test method provided in one embodiment of the present application. The method is applied to the main controller in the above-mentioned GPIO driver test system so that the main controller can control other modules. The main controller is provided with a GPIO driver and a test script. The GPIO driver is used to drive the test hardware module to output the corresponding test signal through GPIO, and the test script is used to assist the main controller to control each module to complete the test of the signal output by GPIO. The specific steps are as follows:
[0051] Step S210: compile the GPIO driver to generate firmware corresponding to the GPIO driver.
[0052] Step S220: Import the firmware into the test hardware module so that the test hardware module can load the firmware.
[0053] Step S230, running the test script to send corresponding control signals to the test hardware module, the signal matrix module and the GPIO test suite module respectively, and making the test hardware module or the GPIO test suite module output an output signal corresponding to the test result.
[0054] Step S240: When an output signal corresponding to a test result is received, a test report corresponding to the test result is generated based on a preset report template.
[0055] It is understandable that before the main controller burns the GPIO driver for testing into the test hardware module, the main controller first compiles the GPIO driver to obtain the corresponding GPIO driver firmware, and then burns the firmware into the test hardware module.
[0056] The main controller burns the firmware through the corresponding burning tool to import the firmware to the test hardware module through the firmware download port, so that the test hardware module loads the firmware and then runs the GPIO driver. The test hardware module can output the tested signal through the GPIO thereon.
[0057] The main controller runs the test script to start the corresponding test process. It is conceivable that the developer can set the time to send the control signal, the trigger condition for sending the signal, etc. in the test script, so that the main controller can appropriately send the corresponding control signal to the test hardware module, the signal matrix module and the GPIO test suite module respectively, thereby controlling the test hardware module, the signal matrix module and the GPIO test suite module to form a test branch to complete a functional test. It should be noted that in some functional tests, the output signal of the corresponding test result can also be provided by the test hardware module to the main controller. For example, in the interrupt response time test, the main controller can record the GPIO interrupt response time to complete the functional test.
[0058] For example, the test hardware module has 200 GPIOs, and accordingly, the signal matrix module is provided with 4 DB50 interfaces, 25 signal relay units and 1 DB8 interface. The signal matrix module is connected to the GPIOs of the test hardware module through the 4 DB50 interfaces, and the input ends of the 25 signal relay units are respectively connected to the output ends of the DB50 interfaces, and the output ends of each signal relay unit are connected to the DB8 interface.
[0059] The GPIO test suite module is connected to the pins of the DB8 interface through 8 detection interfaces, and the GPIO test suite module includes a signal bridge module and 8 test modules. The signal bridge module has 8 input terminals and 8 output terminals to connect the detection interface and each test module.
[0060] When the main controller runs the test script, the main controller can output a control signal to the test hardware module so that the test hardware module outputs the measured signal. Of course, the main controller can also send corresponding control signals to other modules such as the signal matrix module and the GPIO test suite module when outputting control signals to the test hardware module. As the functional test currently performed needs to adopt the test module I, accordingly, the main controller can output corresponding control signals to the signal matrix module so that each signal relay unit can be switched on and off, forming an output channel that the measured signal is transferred to the GPIO test suite module. And the main controller also controls the GPIO test suite module by the control signal to bridge the measured signal to the test module I through the signal bridge module to perform corresponding tests. The main controller is connected by the communication with the GPIO test suite module, and it can obtain the output signal of the corresponding test result to generate a test report according to the corresponding report template. It can be imagined that a plurality of items to be tested can also be provided in the tested script, and accordingly, when the main controller runs the tested script, it can output corresponding control signals so that the measured signal can be connected to the corresponding test module to perform tests.
[0061] The main controller can control other modules in the GPIO driver test system by running the set test script, and then provide an output channel from the GPIO to the test module for the tested signal to complete the functional test, and the main controller can also generate a test report of the corresponding test results based on the feedback signal for the tester to review. It can be seen that the test process is simple and does not require manual testing by the tester, thus effectively avoiding the differences caused by manual testing and helping to provide more accurate and effective test results.
[0062] Figure 3 A schematic diagram of controlling a GPIO driver test provided in an embodiment of the present application is shown in the figure. When the main controller outputs a control signal to each module, it needs to control each module according to the content defined in the test script. The specific steps are as follows:
[0063] Step S310: Send a first control signal to the test hardware module according to the GPIO output configuration defined in the test script, so that the test hardware module outputs the signal under test through the target GPIO.
[0064] Step S320: Send a second control signal to the signal matrix module, so that the signal matrix module transmits the tested signal output by the target GPIO to the GPIO test suite module.
[0065] Step S330: according to the target test function defined in the test script, send a third control signal to the GPIO test suite module to map the tested signal output by the target GPIO to the target test module, where the target test module is associated with the target test function.
[0066] It is understandable that the test script is edited by the tester for the GPIO driver test, and the corresponding GPIO output configuration is recorded on it, such as the port information of the target GPIO that needs to output the test signal under each test. Of course, the test script also defines the target test function used by the currently output test signal, such as the test module to which the test signal output by the target GPIO needs to be mapped.
[0067] Furthermore, the main controller outputs a first control signal to the test hardware module so that the test hardware module outputs the test signal through the target GPIO. For example, GPIO1 is currently required to perform a low-level input test, that is, GPIO1 is used as the target GPIO. The main controller outputs a first control signal to the test hardware module so that GPIO1 outputs the test signal for the low-level input test.
[0068] In addition, the main controller also outputs a second control signal to the signal matrix module to turn on the output channel corresponding to GPIO1, so as to transfer the measured signal output by GPIO1 to the GPIO test suite module. Of course, the main controller also outputs a third control signal to the GPIO test suite module. It can be imagined that the main controller needs to send the third control signal to the GPIO test suite module according to the target test function defined in the test script, so as to use the signal bridge module in the GPIO test suite module to map the measured signal output by GPIO1 to the target test module for low-level testing to perform low-level input testing.
[0069] Therefore, the main controller outputs corresponding control signals to each module according to the needs of different test items, so as to provide corresponding output channels for the tested signals, and then map the tested signals to the target test modules. The main controller can automatically complete the GPIO driver test according to the test script. No manual testing is required during the test process, which helps to reduce the differences caused by manual testing and effectively improve the accuracy of the test results.
[0070] Figure 4 This is a schematic diagram of the structure of a GPIO driver test device provided in an embodiment of the present application, which is applied to the main controller in the above-mentioned GPIO driver test system, is used to execute the above-mentioned GPIO driver test method, and has the functional modules and beneficial effects of the execution method. The device includes a program compilation module 401, a firmware import module 402, a script execution module 403 and a report output module 404.
[0071] Among them, the program compilation module 401 is configured to compile the GPIO driver to generate firmware corresponding to the GPIO driver; the firmware import module 402 is configured to import firmware into the test hardware module so that the test hardware module can load the firmware; the script running module 403 is configured to run the test script to send corresponding control signals to the test hardware module, the signal matrix module and the GPIO test suite module respectively; the report output module 404 is configured to generate a test report corresponding to the test result based on a preset report template when receiving the output signal of the corresponding test result.
[0072] Based on the above embodiment, the script execution module 403 is further configured as follows:
[0073] Sending a first control signal to the test hardware module according to the GPIO output configuration defined in the test script, so that the test hardware module outputs the signal under test through the target GPIO;
[0074] Sending a second control signal to the signal matrix module so that the signal matrix module transmits the signal under test output by the target GPIO to the GPIO test suite module;
[0075] According to the target test function defined in the test script, a third control signal is sent to the GPIO test suite module to map the tested signal output by the target GPIO to the target test module, and the target test module is associated with the target test function.
[0076] It is worth noting that in the embodiment of the above-mentioned GPIO driver test device, each module is divided only according to functional logic, but is not limited to the above-mentioned division, as long as the corresponding functions can be realized; in addition, the specific name of each module is only for the convenience of distinguishing each other, and is not used to limit the protection scope of this application.
[0077] Figure 5The structural diagram of the main controller provided in one embodiment of the present application is used to execute the GPIO drive test method provided in the above embodiment, and has the functional modules and beneficial effects corresponding to the execution method. As shown in the figure, the device includes a processor 501, a memory 502, an input device 503 and an output device 504. The number of processors 501 can be one or more, and one processor 501 is taken as an example in the figure; the processor 501, the memory 502, the input device 503 and the output device 504 can be connected by a bus or other means, and the figure takes the connection through a bus as an example. The memory 502, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as the program instructions / modules corresponding to the GPIO drive test method in the embodiment of the present application. The processor 501 executes the corresponding various functional applications and data processing by running the software programs, instructions and modules stored in the memory 502, that is, the above-mentioned GPIO drive test method is realized.
[0078] The memory 502 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data recorded or created during use, etc. In addition, the memory 502 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 502 may further include a memory remotely arranged relative to the processor 501, and these remotely arranged memories may be connected to the terminal device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0079] The input device 503 can be used to input corresponding digital or character information to the processor 501, and to generate key signal input related to the user settings and function control of the device; the output device 504 can be used to send or display key signal output related to the user settings and function control of the device.
[0080] An embodiment of the present application also provides a storage medium storing computer executable instructions, which, when executed by a processor, are used to perform relevant operations in the GPIO driver test method provided in any embodiment of the present application.
[0081] Computer-readable storage media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0082] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0083] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.
Claims
1. A GPIO driver test system, characterized in that: include: A main controller, the main controller is used to output signals through a communication interface thereon; A test hardware module, the test hardware module is connected to the main controller through a firmware download port to burn test firmware, and the test hardware module is also connected to the main controller for communication, and the test hardware module is used to output a tested signal through GPIO or feed back an output signal of a test result of a corresponding interrupt response time test to the main controller in the case of receiving a first control instruction output by the main controller, so that the main controller can record the GPIO interrupt response time; A signal matrix module, the signal matrix module is connected to the test hardware module, the signal matrix module is provided with a plurality of input interfaces to connect the GPIO of the test hardware module, and the signal matrix module is also communicatively connected to the main controller, and the signal matrix module is used to select an output channel according to a second control instruction output by the main controller; A GPIO test suite module, wherein the GPIO test suite module is connected to the signal matrix module, and the GPIO test suite module is provided with a plurality of detection interfaces to be connected one-to-one to the output end of the signal matrix module, and the GPIO test suite module is also communicatively connected to the main controller, and the GPIO test suite module is used for selecting a signal for detection according to a third control signal output by the main controller.
2. The GPIO driver test system according to claim 1, characterized in that: The test hardware module is provided with a plurality of GPIOs, and the signal matrix module includes a DB50 interface, a signal relay unit and a DB8 interface; Each of the DB50 interfaces is respectively connected to a different GPIO on the test hardware module, the number of the signal relay units is adapted to the number of output ends of all the DB50 interfaces, and the input end of each of the signal relay units is respectively connected to the output end of the corresponding DB50 interface, the output end of the signal relay unit is connected to the input end of the DB8 interface in a parallel cascade manner, and the output end of the DB8 interface is connected to the input end of the GPIO test suite module.
3. The GPIO driver test system according to claim 2, characterized in that: The signal relay unit includes 8 input terminals and 8 output terminals to form 8 output channels. The signal relay unit includes an MCU, a communication interface and a driving subunit. The MCU is communicatively connected to the main controller via the communication interface. The MCU is connected to the driving subunit. The driving subunit is used to adjust the on and off of the 8 output channels according to the control instructions output by the MCU.
4. The GPIO driver test system according to claim 1, characterized in that: The GPIO test suite module includes a signal bridge module and a plurality of test modules; The signal bridge module comprises a plurality of input terminals and a plurality of output terminals, the input terminal of the signal bridge module is connected to the output terminal of the signal matrix module through the detection interface, and the plurality of output terminals of the signal bridge module are respectively connected to different test modules, and the signal bridge module is used to select a signal path to be connected to a test module according to the third control signal; Each test module is used to perform different functional tests, and each of the test modules is connected to the main controller to feed back an output signal corresponding to the test result to the main controller.
5. The GPIO driver test system according to claim 4, characterized in that: The signal bridge module includes two signal relay units, each of which includes 8 input terminals and 8 output terminals to form 8 output channels; Among them, all the output ends of one of the signal relay units are integrated into one output as the target output end, and all the input ends of the other signal relay unit are integrated into one input as the target input end. The target output end is connected to the target input end, and the two signal relay units respectively select one output channel according to the third control signal output.
6. The GPIO driver test system according to any one of claims 1 to 5, characterized in that: The main controller establishes communication connections with the test hardware module, the signal matrix module and the GPIO test suite module respectively through the CAN bus.
7. A GPIO driver testing method, characterized in that: A main controller applied to a GPIO driver test system according to any one of claims 1 to 6, wherein a GPIO driver and a test script are provided in the main controller, and the GPIO driver test method comprises: Compiling the GPIO driver to generate firmware corresponding to the GPIO driver; Importing the firmware into a test hardware module so that the test hardware module loads the firmware; Run the test script to send corresponding control signals to the test hardware module, the signal matrix module and the GPIO test suite module respectively, and make the test hardware module or the GPIO test suite module output an output signal corresponding to the test result; When an output signal corresponding to a test result is received, a test report corresponding to the test result is generated based on a preset report template.
8. The GPIO driver testing method according to claim 7, characterized in that: The running of the test script to send corresponding control signals to the test hardware module, the signal matrix module and the GPIO test suite module respectively, and causing the test hardware module or the GPIO test suite module to output an output signal corresponding to the test result includes: Sending a first control signal to the test hardware module according to the GPIO output configuration defined by the test script, so that the test hardware module outputs the signal under test through the target GPIO; Sending a second control signal to the signal matrix module so that the signal matrix module transmits the signal under test output by the target GPIO to the GPIO test suite module; According to the target test function defined in the test script, a third control signal is sent to the GPIO test suite module to map the tested signal output by the target GPIO to a target test module associated with the target test function.
9. A GPIO driver test device, characterized in that: A main controller applied to a GPIO driver test system according to any one of claims 1 to 6, wherein a GPIO driver program and a test script are provided in the main controller, and the GPIO driver test device comprises: A program compiling module, configured to compile the GPIO driver to generate firmware corresponding to the GPIO driver; a firmware import module, configured to import the firmware into the test hardware module so that the test hardware module loads the firmware; A script running module, configured to run the test script to send corresponding control signals to the test hardware module, the signal matrix module and the GPIO test suite module respectively; The report output module is configured to generate a test report corresponding to the test result based on a preset report template when an output signal corresponding to the test result is received.
10. A storage medium storing computer executable instructions, characterized in that: The computer executable instructions are used to execute the GPIO driver testing method as described in any one of claims 7 to 8 when executed by a computer processor.
Citation Information
Patent Citations
Magnetic tape memory control board function test station
CN108874609A
GPIO testing method and apparatus
CN109032878A