A debugging method, device and equipment of an embedded system and a medium
Patent Information
- Application Number
- CN202311075227.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-24
- Publication Date
- 2026-09-29
- Estimated Expiration
- 2043-08-24
AI Technical Summary
在嵌入式系统的开发过程中,调试是一项关键的工作,传统的调试方法主要依靠硬件调试器和软件仿真器,但这些方法不仅成本高昂,而且存在一定的缺陷
[0032]可见,本申请中通过目标上位机获取预设总线分析工具发送的XCP调试命令;基于从所述XCP调试命令中提取出的调试信息编写脚本文件,并调用Lauterbach执行所述脚本文件以对被测嵌入式系统进行调试以得到调试结果;将所述Lauterbach发送的调试结果封装为第一XCP帧数据,并将所述第一XCP帧数据发送至所述预设总线分析工具,以便所述预设总线分析工具对所述第一XCP帧数据表征的调试结果进行数据分析。由此可见,本申请中首先由预设总线分析工具向目标上位机发送XCP调试命令,目标上位机收到XCP调试命令后,则从XCP调试命令中提取出调试信息,并根据调试信息编写脚本文件,编写完成后再调用Lauterbach执行该脚本文件,以对被测嵌入式系统进行调试得到调试结果。Lauterbach得到调试结果后,再将调试结果发送给目标上位机,并由目标上位机将调试结果封装为第一XCP帧数据,再将第一XCP帧数据发送至预设总线分析工具,最后由预设总线分析工具进一步对第一XCP帧数据表征的调试结果进行数据分析。上述过程中,通过利用Lauterbach的多平台适应性的特点能够实现调试方式的通用性,并且通过XCP帧数据进行通信,通信速度更快,提高了调试效率,以及通过预设总线分析工具提供对调试结果进行数据分析的功能。此外,本申请中的目标上位机只需要具备数据转换和通信连接等功能即可,学习成本较低,也降低了调试难度和复杂度。
Smart Images

Figure CN117093492B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a debugging method, apparatus, device, and medium for embedded systems. Background Technology
[0002] Embedded systems are a widely used type of computer system, consisting of two main parts: hardware and software. Embedded systems are characterized by limited resources, high integration, and strong real-time performance. Debugging is a crucial task in the development of embedded systems. Traditional debugging methods mainly rely on hardware debuggers and software emulators, but these methods are not only costly but also have certain limitations.
[0003] Currently, Lauterbach is often used for debugging mainstream embedded systems. While a hardware-assisted debugging tool with multi-platform compatibility, Lauterbach has relatively weak data analysis capabilities and its results are not intuitive. Furthermore, Lauterbach has a high learning curve. Common bus analysis tools such as CANoe (CAN open environment) and ZLG (Zhou Ligong) offer convenient data analysis and powerful visualization features like curve analysis. However, when debugging embedded systems using XCP (Universal Calibration Protocol), they are typically limited by the CPU (Central Processing Unit) platform, making it difficult to analyze different embedded systems, and their debugging functions are relatively simple and limited.
[0004] In summary, how to provide a debugging solution suitable for multi-platform embedded systems and offer data analysis capabilities for debugging results, thereby improving debugging efficiency and reducing debugging difficulty, is a problem that needs to be solved. Summary of the Invention
[0005] In view of this, the purpose of this invention is to provide a debugging method, apparatus, device, and medium for embedded systems, which can provide a debugging scheme suitable for multi-platform embedded systems and provide data analysis functions for debugging results, thereby improving debugging efficiency and reducing debugging difficulty. The specific scheme is as follows:
[0006] In a first aspect, this application discloses a debugging method for an embedded system, applied to a target host computer, comprising:
[0007] Obtain XCP debugging commands sent by the preset bus analysis tool;
[0008] A script file is written based on the debugging information extracted from the XCP debugging command, and Lauterbach is called to execute the script file to debug the embedded system under test and obtain the debugging results.
[0009] The debugging results sent by Lauterbach are encapsulated into first XCP frame data, and the first XCP frame data is sent to the preset bus analysis tool so that the preset bus analysis tool can perform data analysis on the debugging results represented by the first XCP frame data.
[0010] Optionally, before obtaining the XCP debug command sent by the preset bus analysis tool, the method further includes:
[0011] The host computer of the preset bus analysis tool sends a second XCP frame data, which is used to characterize debugging information, to the preset bus analysis tool so that the preset bus analysis tool can encapsulate the second XCP frame data into an Ethernet frame based on the transmission control protocol and the Internet Protocol.
[0012] Accordingly, obtaining the XCP debugging command sent by the preset bus analysis tool includes:
[0013] Obtain the XCP debugging command sent by the preset bus analysis tool, which carries the Ethernet frame.
[0014] Optionally, the step of writing a script file based on the debugging information extracted from the XCP debugging command includes:
[0015] The Ethernet frames in the XCP debug command are parsed based on the Transmission Control Protocol and the Internet Protocol to obtain parsed data, and the parsed data is then parsed based on the XCP protocol to obtain debug information.
[0016] The CMM script file is obtained by automatically editing based on the debugging information.
[0017] Optionally, the debugging information includes the variable debugging method, variable name, and variable memory address.
[0018] Optionally, the step of calling Lauterbach to execute the script file to debug the embedded system under test and obtain debugging results includes:
[0019] The script file is sent to Lauterbach, and Lauterbach is invoked to execute the script file in order to debug the embedded system under test and obtain the debugging results through the joint test working group interface.
[0020] Optionally, after sending the first XCP frame data to the preset bus analysis tool, the method further includes:
[0021] The debugging results represented by the first XCP frame data are analyzed using the preset bus analysis tool, and the analysis results are visualized on the preset interface.
[0022] Optionally, the debugging method for the embedded system further includes:
[0023] The local parameters are pre-configured based on preset parameter configuration rules, and a communication connection is established with a preset bus analysis tool via an Ethernet interface, as well as with Lauterbach via a universal serial bus interface.
[0024] Secondly, this application discloses a debugging device for an embedded system, applied to a target host computer, comprising:
[0025] The instruction acquisition module is used to acquire XCP debugging commands sent by the preset bus analysis tool;
[0026] The debugging module is used to write a CMM script file based on the debugging information extracted from the XCP debugging command, and call Lauterbach to execute the script file to debug the embedded system under test and obtain the debugging results.
[0027] The data analysis module is used to encapsulate the debugging results sent by Lauterbach into first XCP frame data and send the first XCP frame data to the preset bus analysis tool so that the preset bus analysis tool can perform data analysis on the debugging results represented by the first XCP frame data.
[0028] Thirdly, this application discloses an electronic device, including:
[0029] Memory, used to store computer programs;
[0030] A processor for executing the computer program to implement the steps of the aforementioned disclosed debugging method for embedded systems.
[0031] Fourthly, this application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the steps of the aforementioned disclosed debugging method for embedded systems.
[0032] As can be seen, in this application, the target host computer obtains the XCP debugging command sent by the preset bus analysis tool; based on the debugging information extracted from the XCP debugging command, a script file is written, and Lauterbach is called to execute the script file to debug the embedded system under test and obtain the debugging result; the debugging result sent by Lauterbach is encapsulated into first XCP frame data, and the first XCP frame data is sent to the preset bus analysis tool so that the preset bus analysis tool can perform data analysis on the debugging result represented by the first XCP frame data. Thus, in this application, the preset bus analysis tool first sends the XCP debugging command to the target host computer. After receiving the XCP debugging command, the target host computer extracts the debugging information from the XCP debugging command, writes a script file based on the debugging information, and then calls Lauterbach to execute the script file to debug the embedded system under test and obtain the debugging result. After Lauterbach obtains the debugging results, it sends them to the target host computer. The target host computer then encapsulates the debugging results into a first XCP frame data, which is then sent to a preset bus analysis tool. Finally, the preset bus analysis tool further analyzes the debugging results represented by the first XCP frame data. In this process, Lauterbach's multi-platform adaptability enables the universality of the debugging method. Furthermore, communication via XCP frame data results in faster communication speeds, improving debugging efficiency. The preset bus analysis tool also provides the function of analyzing the debugging results. In addition, the target host computer in this application only needs to have data conversion and communication connection functions, resulting in a lower learning cost and reduced debugging difficulty and complexity. Attached Figure Description
[0033] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0034] Figure 1 This is a flowchart of a debugging method for an embedded system disclosed in this application;
[0035] Figure 2 This is a schematic diagram illustrating the connection between Lauterbach, the target host computer, and the preset bus analysis tool disclosed in this application.
[0036] Figure 3 This is a flowchart of a specific debugging method for an embedded system disclosed in this application;
[0037] Figure 4 This is a schematic diagram of data conversion in a target host computer disclosed in this application;
[0038] Figure 5 This is a schematic diagram of the structure of a debugging device for an embedded system disclosed in this application;
[0039] Figure 6 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0040] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0041] This application discloses a debugging scheme applicable to multi-platform embedded systems and provides a function for data analysis of debugging results, thereby improving debugging efficiency and reducing debugging difficulty.
[0042] See Figure 1 As shown in the figure, this application discloses a debugging method for an embedded system, applied to a target host computer. The method includes:
[0043] Step S11: Obtain the XCP debugging command sent by the preset bus analysis tool.
[0044] In this embodiment, a preset bus analysis tool first sends an XCP debugging command to the target host computer. It should be noted that the target host computer in this embodiment is pre-built; it only needs to have basic functions such as data conversion and communication connection, and is named XCP on Lauterbach.
[0045] Furthermore, after the host computer is constructed, the process also includes: configuring local parameters in advance based on preset parameter configuration rules, establishing a communication connection with a preset bus analysis tool via an Ethernet interface, and establishing a communication connection with Lauterbach via a Universal Serial Bus interface. That is, in this embodiment, the local parameters of the target host computer need to be configured according to preset parameter configuration rules, and the APIs (Application Programming Interfaces) provided by the preset bus analysis tool and Lauterbach need to be called respectively. Communication with the preset bus analysis tool is established via Eth (Ethernet interface), and communication with Lauterbach is established via USB (Universal Serial Bus). Figure 2 A schematic diagram of the connection between Lauterbach, the target host computer, and a preset bus analysis tool is disclosed.
[0046] It should be noted that the aforementioned preset bus analysis tools can be bus analysis tools such as CANoe and ZLG; this embodiment uses CANoe as an example. The aforementioned preset parameter configuration rules specifically involve configuring the communication interface and API calls. On one hand, since the target host computer establishes communication connections with CANoe and Lauterbach via Ethernet and Universal Serial Bus interfaces respectively, it is necessary to configure the Ethernet communication interface connected to CANoe, including IP address and port number, and the Universal Serial Bus interface connected to Lauterbach, including a suitable USB port. On the other hand, regarding API calls, it is necessary to import the relevant API library according to the CANoe documentation and configure the relevant parameters, such as initializing the CANoe connection, sending and receiving data, etc.; and import the corresponding API library according to the Lauterbach documentation and configure the relevant parameters, such as initializing the Lauterbach connection, sending and receiving data, etc.
[0047] Step S12: Based on the debugging information extracted from the XCP debugging command, write a script file and call Lauterbach to execute the script file to debug the embedded system under test and obtain the debugging results.
[0048] In this embodiment, after receiving the XCP debugging command, the target host computer extracts debugging information from the command and writes a script file based on this information. Specifically, the script file is a CMM (Command Macro) script file. After completion, the Lauterbach API is called to execute the debugging information in the CMM script file, thereby debugging the embedded system under test and obtaining the debugging results. It should be noted that standard Practice scripts have the extension .cmm, hence they are also called CMM scripts. Practice scripts are a scripting language provided by Lauterbach and used in Lauterbach's Trace32 software.
[0049] Step S13: Encapsulate the debugging results sent by Lauterbach into first XCP frame data, and send the first XCP frame data to the preset bus analysis tool so that the preset bus analysis tool can perform data analysis on the debugging results represented by the first XCP frame data.
[0050] In this embodiment, after Lauterbach obtains the debugging results, it sends the results to the target host computer via a USB interface. Simultaneously, Lauterbach also stores a log file containing the debugging results locally. Upon receiving the debugging results, the target host computer encapsulates them into a first XCP frame data, which is then sent to a preset bus analysis tool via an Ethernet interface. Finally, the preset bus analysis tool further analyzes the debugging results represented by the first XCP frame data.
[0051] Furthermore, after sending the first XCP frame data to the preset bus analysis tool, the process further includes: performing data analysis on the debugging results represented by the first XCP frame data using the preset bus analysis tool, and visually displaying the analysis results on a preset interface. That is, ultimately, the preset bus analysis tool is used to perform data analysis on the debugging results represented by the first XCP frame data, and the analysis results are visualized on a preset interface for subsequent further analysis and graphical processing.
[0052] As can be seen, in this application, the target host computer obtains the XCP debugging command sent by the preset bus analysis tool; based on the debugging information extracted from the XCP debugging command, a script file is written, and Lauterbach is called to execute the script file to debug the embedded system under test and obtain the debugging result; the debugging result sent by Lauterbach is encapsulated into first XCP frame data, and the first XCP frame data is sent to the preset bus analysis tool so that the preset bus analysis tool can perform data analysis on the debugging result represented by the first XCP frame data. Thus, in this application, the preset bus analysis tool first sends the XCP debugging command to the target host computer. After receiving the XCP debugging command, the target host computer extracts the debugging information from the XCP debugging command, writes a script file based on the debugging information, and then calls Lauterbach to execute the script file to debug the embedded system under test and obtain the debugging result. After Lauterbach obtains the debugging results, it sends them to the target host computer. The target host computer then encapsulates the debugging results into a first XCP frame data, which is then sent to a preset bus analysis tool. Finally, the preset bus analysis tool further analyzes the debugging results represented by the first XCP frame data. In this process, Lauterbach's multi-platform adaptability enables the universality of the debugging method. Furthermore, communication via XCP frame data results in faster communication speeds, improving debugging efficiency. The preset bus analysis tool also provides the function of analyzing the debugging results. In addition, the target host computer in this application only needs to have data conversion and communication connection functions, resulting in a lower learning cost and reduced debugging difficulty and complexity.
[0053] See Figure 3 As shown, this application discloses a specific debugging method for an embedded system. Compared to the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically, it includes:
[0054] Step S21: The host computer of the preset bus analysis tool sends a second XCP frame data, which is used to characterize debugging information, to the preset bus analysis tool so that the preset bus analysis tool can encapsulate the second XCP frame data into an Ethernet frame based on the transmission control protocol and the Internet Protocol, and obtain the XCP debugging command carrying the Ethernet frame sent by the preset bus analysis tool.
[0055] In this embodiment, the specific process of sending XCP debugging commands to the target host computer using a preset bus analysis tool is as follows: Taking CANoe as an example, first, open CANoe, select or create a simulation environment with an XCP module, and add a configuration file .A2L in the simulation environment to obtain the internal image and attribute information of the ECU (Electronic Control Unit). It should be noted that the A2L file is based on the ASAP2 (The working group for the standardization of application systems) standard and is written in a descriptive language specified by ASAP2, similar to XML (Extensible Markup Language). It describes the ECU's communication-related parameters, calibration, addresses of observed variables, and physical value calculation formulas, etc., in text format. It guides the communication interaction process between the host computer and the ECU, enabling the host computer to accurately present the information from the ECU to the user. Furthermore, the host computer of CANoe sends a second XCP frame data, representing debugging information, to CANoe. CANoe then encapsulates the second XCP frame data into an Ethernet frame based on the Transmission Control Protocol (TCP) and the Internet Protocol (IP). Specifically, the second XCP frame data is first encapsulated into a TCP packet with a TCP header added. Then, an IP header and the target MAC address are added to the resulting TCP packet to form an Ethernet frame. Therefore, CANoe ultimately sends the XCP debugging command carrying this Ethernet frame to the target host computer.
[0056] It should be noted that since the CANoe host computer does not directly provide an external data interface, the target host computer cannot directly obtain data from the CANoe host computer. Instead, the CANoe host computer first sends the second XCP frame data, which represents debugging information, to CANoe. Then, CANoe encapsulates the second XCP frame data into Ethernet frame data. Finally, CANoe sends the XCP debugging command carrying the Ethernet frame to the target host computer.
[0057] In addition, the above debugging information may include, but is not limited to, variable debugging method, variable name and variable memory address, where the variable corresponds to the embedded system under test.
[0058] Step S22: Parse the Ethernet frames in the XCP debugging command based on the Transmission Control Protocol and Internet Protocol to obtain parsed data, and parse the parsed data based on the XCP protocol to obtain debugging information.
[0059] In this embodiment, after receiving the XCP debugging command, the target host computer first parses the Ethernet frame in the XCP debugging command based on the Transmission Control Protocol and the Internet Protocol to obtain the parsed data, and then parses the parsed data based on the XCP protocol to obtain debugging information, namely, information such as variable debugging method, variable name and variable memory address.
[0060] Step S23: Automatically edit the debugging information to obtain a CMM script file, send the CMM script file to Lauterbach, and call Lauterbach to execute the CMM script file to debug the embedded system under test through the joint test working group interface to obtain debugging results.
[0061] In this embodiment, the target host computer automatically edits the parsed debugging information to create a CMM script file. After completion, the CMM script file is sent to Lauterbach, and Lauterbach executes the CMM script file to interactively debug the embedded system under test via the JTAG (Joint Test Action Group) interface and obtain the debugging results. Figure 4 As shown, the target host computer's role here is to convert the XCP frame data sent by the preset bus analysis tool into a CMM script.
[0062] Step S24: Encapsulate the debugging results sent by Lauterbach into first XCP frame data, and send the first XCP frame data to the preset bus analysis tool so that the preset bus analysis tool can perform data analysis on the debugging results represented by the first XCP frame data.
[0063] In this embodiment, as Figure 4 As shown, the target host computer also needs to convert the debugging results sent by Lauterbach into XCP frame data format before sending them to the preset bus analysis tool.
[0064] As can be seen, in this embodiment, the preset bus analysis tool sends an XCP debugging command carrying the Ethernet frame to the target host computer. Upon receiving the XCP debugging command, the target host computer first parses the Ethernet frame in the XCP debugging command based on the Transmission Control Protocol (TCP) to obtain the parsed data. Then, it parses the parsed data based on the XCP protocol to obtain debugging information, such as variable debugging methods, variable names, and variable memory addresses. The target host computer automatically edits the parsed debugging information to create a CMM script file. After completion, it sends the CMM script file to Lauterbach and calls Lauterbach to execute the CMM script file, enabling interactive debugging with the embedded system under test through the joint test group interface to obtain debugging results. Finally, the target host computer encapsulates the debugging results into the first XCP frame data and sends it to the preset bus analysis tool for subsequent data analysis. This solution, by combining Lauterbach and the XCP protocol for debugging embedded systems, has multi-platform applicability, improves debugging efficiency, and reduces debugging difficulty and complexity.
[0065] See Figure 5 As shown in the figure, this application discloses a debugging device for an embedded system, applied to a target host computer. The device includes:
[0066] The instruction acquisition module 11 is used to acquire XCP debugging commands sent by a preset bus analysis tool;
[0067] The debugging module 12 is used to write a script file based on the debugging information extracted from the XCP debugging command, and call Lauterbach to execute the script file to debug the embedded system under test and obtain the debugging results.
[0068] The data analysis module 13 is used to encapsulate the debugging results sent by Lauterbach into first XCP frame data and send the first XCP frame data to the preset bus analysis tool so that the preset bus analysis tool can perform data analysis on the debugging results represented by the first XCP frame data.
[0069] As can be seen, in this application, the target host computer obtains the XCP debugging command sent by the preset bus analysis tool; based on the debugging information extracted from the XCP debugging command, a script file is written, and Lauterbach is called to execute the script file to debug the embedded system under test and obtain the debugging result; the debugging result sent by Lauterbach is encapsulated into first XCP frame data, and the first XCP frame data is sent to the preset bus analysis tool so that the preset bus analysis tool can perform data analysis on the debugging result represented by the first XCP frame data. Thus, in this application, the preset bus analysis tool first sends the XCP debugging command to the target host computer. After receiving the XCP debugging command, the target host computer extracts the debugging information from the XCP debugging command, writes a script file based on the debugging information, and then calls Lauterbach to execute the script file to debug the embedded system under test and obtain the debugging result. After Lauterbach obtains the debugging results, it sends them to the target host computer. The target host computer then encapsulates the debugging results into a first XCP frame data, which is then sent to a preset bus analysis tool. Finally, the preset bus analysis tool further analyzes the debugging results represented by the first XCP frame data. In this process, Lauterbach's multi-platform adaptability enables the universality of the debugging method. Furthermore, communication via XCP frame data results in faster communication speeds, improving debugging efficiency. The preset bus analysis tool also provides the function of analyzing the debugging results. In addition, the target host computer in this application only needs to have data conversion and communication connection functions, resulting in a lower learning cost and reduced debugging difficulty and complexity.
[0070] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the debugging method of the embedded system executed by the electronic device disclosed in any of the foregoing embodiments.
[0071] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0072] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0073] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored on it include operating system 221, computer program 222 and data 223, etc., and the storage method can be temporary storage or permanent storage.
[0074] The operating system 221 manages and controls the various hardware devices on the electronic device 20 and the computer program 222 to enable the processor 21 to perform calculations and processing on the massive amount of data 223 in the memory 22. The operating system 221 can be Windows, Unix, Linux, etc. The computer program 222, in addition to including a computer program capable of performing the debugging method of the embedded system executed by the electronic device 20 as disclosed in any of the foregoing embodiments, may further include computer programs capable of performing other specific tasks. The data 223 may include data received by the electronic device from external devices, as well as data collected by its own input / output interface 25.
[0075] Furthermore, embodiments of this application also disclose a computer-readable storage medium storing a computer program, which, when loaded and executed by a processor, implements the debugging method steps of the embedded system disclosed in any of the foregoing embodiments.
[0076] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0077] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0078] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0079] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0080] The above provides a detailed description of the debugging method, apparatus, device, and storage medium for an embedded system provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A debugging method for an embedded system, characterized in that, Applied to the target host computer, including: Obtain XCP debugging commands sent by the preset bus analysis tool; A script file is written based on the debugging information extracted from the XCP debugging command, and Lauterbach is called to execute the script file to debug the embedded system under test and obtain the debugging results. The debugging results sent by Lauterbach are encapsulated into first XCP frame data, and the first XCP frame data is sent to the preset bus analysis tool so that the preset bus analysis tool can perform data analysis on the debugging results represented by the first XCP frame data. Before obtaining the XCP debugging command sent by the preset bus analysis tool, the method further includes: The host computer of the preset bus analysis tool sends a second XCP frame data, which is used to characterize debugging information, to the preset bus analysis tool so that the preset bus analysis tool can encapsulate the second XCP frame data into an Ethernet frame based on the transmission control protocol and the Internet Protocol. Accordingly, obtaining the XCP debugging command sent by the preset bus analysis tool includes: Obtain the XCP debugging command carrying the Ethernet frame sent by the preset bus analysis tool; The method further includes: The local parameters are pre-configured based on preset parameter configuration rules, and a communication connection is established with the preset bus analysis tool via the Ethernet interface, and a communication connection is established with Lauterbach via the universal serial bus interface; After sending the first XCP frame data to the preset bus analysis tool, the method further includes: The debugging results represented by the first XCP frame data are analyzed using the preset bus analysis tool, and the analysis results are visualized on the preset interface.
2. The debugging method for an embedded system according to claim 1, characterized in that, The process of writing a script file based on the debugging information extracted from the XCP debugging command includes: The Ethernet frames in the XCP debug command are parsed based on the Transmission Control Protocol and the Internet Protocol to obtain parsed data, and the parsed data is then parsed based on the XCP protocol to obtain debug information. The CMM script file is obtained by automatically editing based on the debugging information.
3. The debugging method for an embedded system according to claim 2, characterized in that, The debugging information includes the variable debugging method, variable name, and variable memory address.
4. The debugging method for an embedded system according to claim 1, characterized in that, The step of calling Lauterbach to execute the script file to debug the embedded system under test and obtain debugging results includes: The script file is sent to Lauterbach, and Lauterbach is invoked to execute the script file in order to debug the embedded system under test and obtain the debugging results through the joint test working group interface.
5. A debugging device for an embedded system, characterized in that, Applied to the target host computer, including: The instruction acquisition module is used to acquire XCP debugging commands sent by the preset bus analysis tool; The debugging module is used to write a script file based on the debugging information extracted from the XCP debugging command, and call Lauterbach to execute the script file to debug the embedded system under test and obtain the debugging results. The data analysis module is used to encapsulate the debugging results sent by Lauterbach into first XCP frame data and send the first XCP frame data to the preset bus analysis tool so that the preset bus analysis tool can perform data analysis on the debugging results represented by the first XCP frame data. Before acquiring the XCP debugging command sent by the preset bus analysis tool, the device is further configured to send a second XCP frame data representing debugging information to the preset bus analysis tool through the host computer of the preset bus analysis tool, so that the preset bus analysis tool can encapsulate the second XCP frame data into an Ethernet frame based on the transmission control protocol and the Internet Protocol. Correspondingly, the instruction acquisition module is specifically used to acquire the XCP debugging command carrying the Ethernet frame sent by the preset bus analysis tool; The device is also used to configure local parameters in advance based on preset parameter configuration rules, establish a communication connection with a preset bus analysis tool through an Ethernet interface, and establish a communication connection with Lauterbach through a universal serial bus interface. After sending the first XCP frame data to the preset bus analysis tool, the device is further used to perform data analysis on the debugging results represented by the first XCP frame data through the preset bus analysis tool, and to visualize the analysis results on a preset interface.
6. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the debugging method for an embedded system as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, Used to store computer programs; wherein, when the computer programs are executed by a processor, they implement the steps of the debugging method for the embedded system as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Control method based on CCP or XCP protocol
CN111781909A
Universal JTAG (Joint Test Action Group) debugging method and system with extensible interface
CN114064458A