A program debugging method and device
By using the GPIO signals dbg_clk and dbg_data of Bluetooth baseband integrated circuit to indicate the program location, combining the data reception and transmission status signals, analyzing the program running time, the problem of insufficient number of GPIOs in Bluetooth controllers is solved, and the accurate debugging of Bluetooth controller programs and accurate control of data transmission and reception status is achieved.
Patent Information
- Application Number
- CN202011330110.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-24
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2040-11-24
AI Technical Summary
The few pins of components in Bluetooth controllers lead to insufficient GPIOs, unable to accurately track the running location of all program codes, and unable to accurately debug the program to control the sending and receiving status of data.
By using two GPIO output signals dbg_clk and dbg_data of the Bluetooth baseband integrated circuit to indicate the start and end positions of the program, combining the data reception status signal rx_data, the data transmission status signal tx_data and the radio frequency control signal GIO status signal, the running time of the program is analyzed to debug the program.
It realizes accurate debugging of Bluetooth controller programs, ensures accurate control of data transmission and reception status, and is suitable for debugging of interrupt programs and other programs with high real-time requirements.
Smart Images

Figure CN114546813B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technologies, and in particular, to a program debugging method and apparatus. Background Art
[0002] With the development of Bluetooth wireless communication technology, the operation of a device can be controlled by a Bluetooth controller. The Bluetooth controller contains an integrated circuit (IC) inside. When debugging the Bluetooth controller, generally, signals output by multiple general-purpose input / output ports (GPIO) of the integrated circuit are used to track the execution of a program. For example, a GPIO is used to mark the running position of a piece of program code. However, some ICs have fewer pins of components, and the number of GPIOs available for debugging is insufficient to track the running positions of all program codes, thus unable to accurately debug the program to control the data reception and transmission status. Summary of the Invention
[0003] Embodiments of this application provide a program debugging method and apparatus to implement program debugging.
[0004] In a first aspect, embodiments of this application provide a program debugging method, including:
[0005] Obtain a first debugging signal and a second debugging signal; the first debugging signal and the second debugging signal are used to indicate the start position and the end position of a program;
[0006] Determine the running time length of the program according to the start position and the end position of the program indicated by the first debugging signal and the second debugging signal;
[0007] Debug the program according to the running time length of the program.
[0008] In some embodiments of this application, it further includes:
[0009] Obtain a data reception status signal, a data transmission status signal, and a radio frequency control signal;
[0010] Determine the type of the program according to the data reception status signal, the data transmission status signal, and the radio frequency control signal;
[0011] Determine the data reception and transmission status according to the type of the program and the running time length;
[0012] Debug the program according to the data reception and transmission status.
[0013] In some embodiments of this application, it further includes:
[0014] Obtain the number of pulse signals in the pulse signal sequence at the first position in the first debug signal;
[0015] Obtain the level values corresponding to each pulse signal in the pulse signal sequence at the first position in the second debug signal;
[0016] If the number of pulse signals in the pulse sequence at the first position and the level values corresponding to each pulse signal in the pulse signal sequence at the first position match the number of pulse signals and the level values corresponding to the set start position, then determine that the first position is the start position of the program; if the number of pulse signals in the pulse sequence at the first position and the level values corresponding to each pulse signal in the pulse signal sequence at the first position match the number of pulse signals and the level values corresponding to the set end position, then determine that the first position is the end position of the program.
[0017] In some embodiments of the present application, obtaining the level values corresponding to each pulse signal in the pulse signal sequence at the first position in the second debug signal includes:
[0018] Obtain the level value of the second debug signal at the rising edge or falling edge of the pulse signal in the pulse signal sequence of the first debug signal at the first position; or
[0019] Obtain the level value within the pulse signal width at the position corresponding to the pulse signal on the second debug signal according to the width of the pulse signal in the pulse signal sequence of the first debug signal at the first position.
[0020] In some embodiments of the present application, the first debug signal and the second debug signal are also used to indicate the embedded program during the program operation;
[0021] The method further includes:
[0022] Obtain the number of pulse signals in the pulse signal sequence of the first debug signal and the level values corresponding to each pulse signal in the pulse signal sequence of the second debug signal between the start position and the end position of the program;
[0023] If the number of pulse signals in the pulse signal sequence of the first debug signal and the level values corresponding to each pulse signal in the pulse signal sequence of the second debug signal match the number of pulse signals and the level values of the pulse signals corresponding to the set embedded program, then determine that the embedded program has been run during the program operation.
[0024] In a second aspect, an embodiment of the present application provides a program debugging device, including:
[0025] An acquisition module, configured to acquire a first debug signal and a second debug signal; the first debug signal and the second debug signal are used to indicate the start position and the end position of the program;
[0026] A running time length determination module, configured to determine the running time length of a program according to the start position and end position of the program indicated by the first debug signal and the second debug signal;
[0027] A debug module, configured to debug the program according to the data transceiver status.
[0028] In some embodiments of the present application, the acquisition module is further configured to acquire a data reception status signal, a data transmission status signal, and a radio frequency control signal;
[0029] The device further includes a type determination module, configured to determine the type of the program according to the data reception status signal, the data transmission status signal, and the radio frequency control signal;
[0030] The device further includes a status determination module, configured to determine the data transceiver status according to the type of the program and the running time length;
[0031] The debug module is further configured to debug the program according to the data transceiver status.
[0032] In some embodiments of the present application, the acquisition module is further configured to acquire the number of pulse signals in the pulse signal sequence at the first position in the first debug signal; acquire the level values corresponding to the pulse signals in the pulse signal sequence at the first position in the second debug signal;
[0033] The device further includes a position determination module, configured to determine that the first position is the start position of the program if the number of pulse signals in the pulse sequence at the first position and the level values corresponding to the pulse signals in the pulse signal sequence at the first position match the number of pulse signals and the level values corresponding to the set start position; determine that the first position is the end position of the program if the number of pulse signals in the pulse sequence at the first position and the level values corresponding to the pulse signals in the pulse signal sequence at the first position match the number of pulse signals and the level values corresponding to the set end position.
[0034] In some embodiments of the present application, the acquisition module is specifically configured to:
[0035] At the rising edge or falling edge of the pulse signal in the pulse signal sequence of the first debug signal at the first position, acquire the level value of the second debug signal; or
[0036] According to the width of the pulse signal in the pulse signal sequence of the first debug signal at the first position, acquire the level values within the pulse signal width at the position corresponding to the pulse signal on the second debug signal.
[0037] In some embodiments of the present application, the first debug signal and the second debug signal are further used to indicate the embedded program during the program operation;
[0038] The acquisition module is further configured to acquire the number of pulse signals in the pulse signal sequence of the first debugging signal and the level values corresponding to the pulse signals in the pulse signal sequence of the second debugging signal between the start position and the end position of the program.
[0039] The apparatus further includes an embedded program determination module, configured to determine that the embedded program has run during the program operation if the number of pulse signals in the pulse signal sequence of the first debugging signal and the level values corresponding to the pulse signals in the pulse signal sequence of the second debugging signal match the number of pulse signals and the level values of the pulse signals corresponding to the set embedded program.
[0040] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium storing computer-executable instructions for causing a computer to execute the data transceiver status determination method.
[0041] In the above embodiments of the present application, the first debugging signal and the second debugging signal are acquired, where the first debugging signal and the second debugging signal are used to indicate the start position and the end position of the program. The running time length of the program can be determined according to the start position and the end position of the program. Since when the Bluetooth baseband integrated circuit transceives data is controlled by the program, and different running time lengths of different programs correspond to different data transceiver statuses, the program can be debugged according to the running time length of the program to control the data transceiver status. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0043] Figure 1 Exemplarily shows the signal waveform diagram output by the pins of the Bluetooth baseband integrated circuit;
[0044] Figure 2 Exemplarily outputs a flowchart of a program debugging method provided by an embodiment of the present application;
[0045] Figure 3a Exemplarily shows the schematic diagram of the start position and the end position of the PKA interrupt program provided by an embodiment of the present application;
[0046] Figure 3b Exemplarily shows the schematic diagram of the start position and the end position of the NO_PKT_RCVD interrupt program provided by an embodiment of the present application;
[0047] Figure 3c Exemplarily shows a schematic diagram of the start position and end position of the timer interrupt program provided by an embodiment of the present application;
[0048] Figure 3d Exemplarily shows a schematic diagram of the position of the embedded program in the interrupt program provided by an embodiment of the present application;
[0049] Figure 4 Exemplarily shows a flowchart of the data transmission and reception status determination method provided by an embodiment of the present application;
[0050] Figure 5 Exemplarily shows a functional structure diagram of the data transmission and reception status determination device provided by an embodiment of the present application. Detailed implementation manners
[0051] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without making creative efforts shall fall within the protection scope of the present application.
[0052] Based on the exemplary embodiments shown in the present application, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present application. In addition, although the disclosure in the present application is introduced according to one or several exemplary instances, it should be understood that each aspect of these disclosures can also constitute a complete technical solution alone.
[0053] It should be understood that the terms "first", "second", etc. in the description and claims of the present application and the above drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances, for example, can be implemented in an order other than those given in the illustration or description of the embodiments of the present application.
[0054] In addition, the terms "comprising" and "having" and any variations thereof are intended to cover but not exclude inclusion. For example, a product or device including a series of components does not necessarily have to be limited to those components clearly listed, but may include other components not clearly listed or inherent to these products or devices.
[0055] The term "module" used in the present application refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic or a combination of hardware or / and software code that can perform functions related to this element.
[0056] At present, the pins of a Bluetooth baseband integrated circuit (such as the integrated circuit of a Bluetooth controller) can output a data reception status signal rx_data, a data transmission status signal tx_data, and a radio frequency control signal. Among them, in the integrated circuit, the General-Purpose Input / Output (GPIO) interface is used to output various signals. GIO (abbreviation for General Input / Output Ports) is more powerful than GPIO and can precisely control at which microsecond the pulse signal is pulled high and at which microsecond it is pulled low. GIO is used to output the radio frequency control signal.
[0057] Figure 1 An exemplary signal waveform diagram output by the pins of the Bluetooth baseband integrated circuit is shown. As Figure 1 shown, the data reception status signal rx_data, the data transmission status signal tx_data, and the radio frequency control signal (also known as the GIO status signal) output by the pins of the integrated circuit are square wave signals composed of a high level 1 and a low level 0. According to the above three signals, it is convenient to know whether the Bluetooth baseband integrated circuit is receiving and transmitting data. For example, when the data reception status signal rx_data is at a high level 1, it means that the Bluetooth baseband integrated circuit has received a data packet; when the data transmission status signal tx_data is at a high level 1, it means that the Bluetooth baseband integrated circuit has sent a data packet; when the GIO status signal is at a high level 1, it means that the radio frequency module in the Bluetooth baseband integrated circuit is working.
[0058] It should be noted that Figure 1 this is only an example. The data reception status signal rx_data, the data transmission status signal tx_data, and the GIO status signal can also be signals of other waveforms, such as sine signals, cosine signals, triangular wave signals, etc. However, based on Figure 1 the output data reception status signal rx_data, data transmission status signal tx_data, and GIO status signal, the execution position of the program cannot be determined.
[0059] The Bluetooth baseband integrated circuit only provides the function of data reception and transmission. As for which method to use for data reception and transmission at which time and on which physical channel, it is controlled by the program of the Bluetooth baseband integrated circuit. The coordinated operation among circuit modules such as the Bluetooth baseband module, Bluetooth radio frequency module, and Bluetooth modem is also controlled by the program. A program running error may cause an error in the data reception and transmission time of the Bluetooth baseband integrated circuit, and ultimately it cannot work. Therefore, it is necessary to determine the running position of the program.
[0060] One current solution is to determine the running position of the program by the print information output by the application console. Generally, for the debugging of programs with low or no real-time requirements, some simple print information can be added to track the running position of the program. However, devices such as Bluetooth controllers have high requirements for the real-time performance of the program. Since the speed of print information is slow and a large amount of print information takes a long time, the program cannot run to completion within the specified time due to the addition of more print information, ultimately resulting in errors in the data transmission and reception time of the Bluetooth baseband integrated circuit. On the other hand, the print information only indicates the execution status of the code in the program and cannot indicate the running time length of the program.
[0061] To solve the above problems, embodiments of the present application provide a program debugging method and device. In some embodiments of the present application, the start position and end position of the program are indicated by using two GPIO of the Bluetooth baseband integrated circuit to output the first debugging signal dbg_clk and the second debugging signal dbg_data. Similar to the data reception status signal rx_data, the data transmission status signal tx_data, and the GIO status signal, the signal lines of the first debugging signal dbg_clk and the second debugging signal dbg_data are connected to a logic analyzer, and the waveforms of the first debugging signal dbg_clk and the second debugging signal dbg_data are analyzed to determine the running time length of the program, so as to debug the program according to the running time length of the program to accurately control the data transmission and reception status of the Bluetooth controller.
[0062] Figure 2 An exemplary flowchart of a program debugging method provided by an embodiment of the present application is output. As Figure 2 shown, this method can be executed in software or in a combination of software and hardware, and mainly includes the following steps:
[0063] S201: Obtain the first debugging signal and the second debugging signal.
[0064] In this step, the first debugging signal dbg_clk and the second debugging signal dbg_data are used to indicate the start position and the end position of the program. The start position and the end position of the program can be determined according to the first debugging signal and the second debugging signal. Specifically, the number of pulse signals in the pulse signal sequence at the first position in the first debugging signal is obtained, and the level values corresponding to the respective pulse signals in the pulse signal sequence at the first position in the second debugging signal are obtained. If the number of pulse signals in the pulse sequence at the first position and the level values corresponding to the respective pulse signals in the pulse signal sequence at the first position match the number of pulse signals and the level values corresponding to the start position set for a specific program, then the first position is determined as the start position of the program. If the number of pulse signals in the pulse sequence at the first position and the level values corresponding to the respective pulse signals in the pulse signal sequence at the first position match the number of pulse signals and the level values corresponding to the end position set for a specific program, then the first position is determined as the end position of the program.
[0065] Among them, the number of pulse signals at the first position can be the number of rising edges, the number of falling edges, or the width of high-level pulse signals in the pulse signal sequence at the first position in the first debugging signal. The level values corresponding to the respective pulse signals in the pulse signal sequence at the first position in the second debugging signal can be the level values of the pulse signals on the second debugging signal during the rising edge, the falling edge, or the width of the high-level pulse signal of the pulse signal on the first debugging signal.
[0066] S202: Determine the running time length of the program according to the start position and the end position of the program indicated by the first debugging signal and the second debugging signal.
[0067] In this step, the running time length of the program is obtained by subtracting the time corresponding to the start position from the time corresponding to the end position.
[0068] S203: Debug the program according to the running time length of the program.
[0069] In some embodiments of the present application, the first debugging signal and the second debugging signal are further used to indicate the embedded program during the program operation. According to the pulse signal sequence of the first debugging signal included between the start position and the end position of the program, the embedded program during the program operation can be determined according to the first debugging signal and the second debugging signal.
[0070] In specific implementation, after determining the start position and end position of the program according to the first debugging signal and the second debugging signal, the number of pulse signals in the pulse signal sequence of the first debugging signal and the level values corresponding to the respective pulse signals in the pulse signal sequence of the second debugging signal between the start position and the end position of the program can be obtained; it is determined whether the number of pulse signals in the pulse signal sequence of the first debugging signal and the level values corresponding to the respective pulse signals in the pulse signal sequence of the second debugging signal between the start position and the end position match the number of pulse signals and the level values of the pulse signals corresponding to the set embedded program. If so, it is determined that the embedded program has run during the program operation.
[0071] In the above embodiments of the present application, by determining the embedded program executed during the program operation, the operation situation of the program can be further understood, and thus the state of data transmission and reception of the Bluetooth baseband integrated circuit can be further understood.
[0072] In some embodiments of the present application, the first debugging signal and the second debugging signal are further used to indicate the embedded program during the program operation. According to the pulse signal sequence of the first debugging signal included between the start position and the end position of the program, the embedded program during the program operation can be determined according to the first debugging signal and the second debugging signal.
[0073] In specific implementation, after determining the start position and end position of the program according to the first debugging signal and the second debugging signal, the number of pulse signals in the pulse signal sequence of the first debugging signal and the level values corresponding to the respective pulse signals in the pulse signal sequence of the second debugging signal between the start position and the end position of the program can be obtained; it is determined whether the number of pulse signals in the pulse signal sequence of the first debugging signal and the level values corresponding to the respective pulse signals in the pulse signal sequence of the second debugging signal between the start position and the end position match the number of pulse signals and the level values of the pulse signals corresponding to the set embedded program. If so, it is determined that the embedded program has run during the program operation, as Figure 3d shown.
[0074] In the above embodiments of the present application, by determining the embedded program executed during the program operation, the operation situation of the program can be further understood, and thus the state of data transmission and reception of the Bluetooth baseband integrated circuit can be further understood.
[0075] In some embodiments of the present application, the type of the program that cannot be determined according to the characteristics of the Bluetooth baseband integrated circuit can also be determined according to the first debugging signal and the second debugging signal.
[0076] In specific implementation, after determining the start position and end position of the program according to the first debugging signal and the second debugging signal, it is determined whether a pulse signal sequence is further included on the first debugging signal between the start position and end position of the program indicated by the first debugging signal and the second debugging signal. If so, the number of pulse signals in the pulse signal sequence of the first debugging signal between the start position and end position is obtained, and the level values corresponding to the respective pulse signals in the pulse signal sequence of the second debugging signal between the start position and end position are obtained; it is determined whether the number of pulse signals in the pulse signal sequence of the first debugging signal between the start position and end position and the level values corresponding to the respective pulse signals in the pulse signal sequence of the second debugging signal match the number of pulse signals and the level values of the pulse signals of the set timer program. If so, the program is determined to be a timer program, as Figure 3c shown.
[0077] In the above embodiments of the present application, according to the pulse signal sequence between the start position and end position of the program indicated by the first debugging signal and the second debugging signal, the type of the program that cannot be determined based on the characteristics of the Bluetooth baseband integrated circuit can be solved, so as to further understand the data reception and transmission status of the Bluetooth baseband integrated circuit.
[0078] The program debugging method provided by the embodiments of the present application will be described in detail below by taking an interrupt program as an example. It should be noted that the program debugging method provided by the embodiments of the present application is applicable to interrupt programs with high timing requirements, and is also applicable to the debugging of other programs.
[0079] In some embodiments of the present application, the first debugging signal dbg_clk and the second debugging signal dbg_data are set to respectively define waveform characteristics for characterizing the start position and end position of the interrupt program. When the interrupt program starts to execute, the waveforms of the first debugging signal dbg_clk and the second debugging signal dbg_data change, and the waveform characteristics are the same as the waveform characteristics of the start position of the pre-defined interrupt program. When the interrupt program ends, the waveforms of the first debugging signal dbg_clk and the second debugging signal dbg_data change, and the waveform characteristics are the same as the waveform characteristics of the end position of the pre-defined interrupt program. The first debugging signal dbg_clk and the second debugging signal dbg_data are respectively output by two GPIOs of the Bluetooth baseband integrated circuit. In this way, by detecting the first debugging signal dbg_clk and the second debugging signal dbg_data output by the Bluetooth baseband integrated circuit and extracting and analyzing the waveform characteristics of these two signals, the start position and end position of the interrupt program can be determined.
[0080] Among them, the pulse width of the second debugging signal dbg_data can be set according to the pulse width of the first debugging signal dbg_clk, specifically including any of the following situations:
[0081] Case 1: The pulse width of the second debug signal dbg_data is equal to the number of rising edges of the first debug signal dbg_clk.
[0082] Case 2: The pulse width of the second debug signal dbg_data is equal to the number of falling edges of the first debug signal dbg_clk.
[0083] Case 3: The pulse width of the second debug signal dbg_data is equal to the high-level pulse width of the first debug signal dbg_clk.
[0084] It should be noted that the waveform characteristics used to characterize the start position of the interrupt program are different from those used to characterize the end position of the interrupt program, so as to partition the start position and the end position of the interrupt program.
[0085] In some embodiments, the waveform characteristics used to characterize the start position and the end position of the interrupt program may include: at the start position and the end position of the interrupt program, the first debug signal dbg_clk outputs a set number of pulses, and the second debug signal dbg_data is in a set state (such as a high-level state or a low-level state) at the rising edge and / or falling edge of one or more of the set pulses. That is, the number of pulses of the first debug signal dbg_clk, and the level value of the second debug signal dbg_data at the rising edge or falling edge of the pulses of the first debug signal dbg_clk can be used to identify the start position and the end position of the interrupt program. Specifically, when implemented, the waveform characteristics used to characterize the start position and the end position of the interrupt program can be represented by coordinates (X, Y), where X represents the number of pulses of the first debug signal dbg_clk, and Y represents the level value of the second debug signal dbg_data at the set position, and specifically may include any of the following cases:
[0086] Case 1: X is the number of rising edges of the first debug signal dbg_clk, and Y is the level value of the second debug signal dbg_data at the rising edge position of the first debug signal dbg_clk.
[0087] Case 2: X is the number of falling edges of the first debug signal dbg_clk, and Y is the level value of the second debug signal dbg_data at the falling edge position of the first debug signal dbg_clk.
[0088] Among them, the waveform characteristics used to characterize the start position of the interrupt program are different from those used to characterize the end position of the interrupt program, and specifically may include the following cases:
[0089] Case 1: At the start position and the end position of the interrupt signal, the number of pulses of the first debug signal dbg_clk is different;
[0090] Case 2: At the start position and the end position of the interrupt signal, the level value of the second debug signal dbg_data is different at the rising edge or the falling edge of the first debug signal dbg_clk;
[0091] Case 3: At the start position and the end position of the interrupt signal, the number of pulses of the first debug signal dbg_clk and the level value of the second debug signal dbg_data are different at the rising edge or the falling edge of the first debug signal dbg_clk.
[0092] In some other embodiments, the pulse width of the first debug signal dbg_clk and the level value of the second debug signal dbg_data within this pulse width range can also be used to identify the start position and the end position of the interrupt program. Specifically, when implemented, the waveform characteristics representing the start position and the end position of the interrupt program can be represented by coordinates (X, Y), where X represents the pulse width of the first debug signal dbg_clk, and Y represents the level value of the second debug signal dbg_data within the pulse width range of the first debug signal dbg_clk. The specific situations are as follows:
[0093] Case Three: X is the high-level pulse width of the first debug signal dbg_clk, and Y is the level value of the second debug signal dbg_data within the high-level pulse width of the first debug signal dbg_clk.
[0094] It should be noted that the pulse width of the first debug signal dbg_clk can be represented by bits.
[0095] In some embodiments of the present application, according to the characteristics of the integrated circuit, the type of a specific interrupt program in the Bluetooth baseband integrated circuit can be determined based on the data reception status signal rx_data, the data transmission status signal tx_data, and the GIO status signal output by the pins of the Bluetooth baseband integrated circuit. For example, the end position of tx_data is the Packet Assembler (PKA) interrupt, the position where rx_data starts to have data is the synchronization (SYNC) interrupt, the position where rx_data finishes receiving data is the Packet Disassambler (PKD) interrupt, and the position where rx_data does not receive data and the GIO status signal ends is the no packet received (NO_PKT_RCVD) interrupt.
[0096] Taking the determination method of Case Three with the values of X and Y as an example, Figures 3a to 3cThe waveform diagram showing the start position and end position of the interrupt program provided by the embodiments of the present application is exemplarily shown.
[0097] Figure 3a The waveform diagram showing the start position and interrupt position of the PKA interrupt program provided by the embodiments of the present application is as Figure 3a shown. There are high-level bit positions in tx_data, while all bit positions of rx_data are low-level, indicating that the Bluetooth baseband integrated circuit is transmitting data. According to the characteristics of the integrated circuit, the PKA interrupt program will be executed at the end position of tx_data. It can be predicted that the arrow indicates the end position of tx_data, and the positions circled by the dotted line after the arrow are successively the start position and end position of the PKA interrupt program. Among them, at the start position, there is one high-level bit in dbg_clk, X is denoted as 1, the high-level of dbg_data corresponding to the high-level bit of dbg_clk, Y is denoted as 1, and the start position can be expressed as (1, 1); at the end position, there is one high-level bit in dbg_clk, X is denoted as 1, the low-level of dbg_data corresponding to the high-level bit of dbg_clk, Y is denoted as 0, and the end position can be expressed as (1, 0).
[0098] Figure 3b The waveform diagram showing the start position and interrupt position of the NO_PKT_RCVD interrupt program provided by the embodiments of the present application is as Figure 3b shown. All bit positions of tx_data are low-level, indicating that the Bluetooth baseband integrated circuit is not transmitting data. All bit positions of rx_data are low-level, but the GIO status signal is pulled high, indicating that the radio frequency module of the Bluetooth baseband integrated circuit is working, and the current Bluetooth baseband integrated circuit is in the data receiving state, but no data is received. According to the characteristics of the integrated circuit, the NO_PKT_RCVD interrupt is executed at the position where the GIO status signal is pulled from high level to low level (marked by the arrow), and the positions circled by the dotted line after the arrow are successively the start position and end position of the NO_PKT_RCVD interrupt program. Among them, at the start position, there is one high-level bit in dbg_clk, X is denoted as 1, the high-level of dbg_data corresponding to the high-level bit of dbg_clk, Y is denoted as 1, and the start position can be expressed as (1, 1); at the end position, there is one high-level bit in dbg_clk, X is denoted as 1, the low-level of dbg_data corresponding to the high-level bit of dbg_clk, Y is denoted as 0, and the end position can be expressed as (1, 0).
[0099] It should be noted that the timer interrupt program cannot be determined based on the data reception status signal rx_data, data transmission status signal tx_data, and GIO status signal output by the Bluetooth baseband integrated circuit. In some embodiments of the present application, in addition to determining the start position and end position of the interrupt program according to the first debug signal dbg_clk and the second debug signal dbg_data, the timer interrupt program can also be determined according to the pulse signal sequence of the first debug signal between the start position and end position of the interrupt program indicated by the first debug signal dbg_clk and the second debug signal dbg_data.
[0100] Figure 3c This is the waveform diagram of the start position and interrupt position of the timer interrupt program provided by the embodiments of the present application. As Figure 3c shown, all bit positions of rx_data are at low level, there are high level bit positions in tx_data, and when the GIO status signal is pulled high, there are high levels in dbg_clk and dbg_data. At position A circled by a dotted line, there is one bit position of dbg_clk at high level, X is recorded as 1, the high level of dbg_data corresponding to the high level bit position of dbg_clk, Y is recorded as 1, and position A can be represented as (1, 1); at position B circled by a dotted line, there are two bit positions of dbg_clk at high level, X is recorded as 2, the high level 1 of dbg_data corresponding to the first high level in dbg_clk, the high level 1 of dbg_data corresponding to the second high level in dbg_clk, Y is recorded as "01", and position B can be represented as (2, 1); at position C circled by a dotted line, there is one bit position of dbg_clk at high level, X is recorded as 1, the low level of dbg_data corresponding to the high level bit position of dbg_clk, Y is recorded as 0, and position C can be represented as (1, 0). Since positions A and C occupy fewer bit numbers and the time spent running the timer interrupt program is less, position A is used as the start position of the timer interrupt program, position C is used as the end position of the timer interrupt program, and position B can be used to represent the end position of the interrupt function in the timer interrupt program.
[0101] It should be noted that when there are multiple bit positions of dbg_clk at high level at the same position, the order of the level values of dbg_data corresponding to each high level bit position can be from the low bit position to the high bit position. For example, at position B, Y is recorded as "01", or from the high bit position to the low bit position. For example, at position B, Y is recorded as "10".
[0102] To track the running positions of more programs, the positions of the embedded programs during the interruption of the program running can be indicated according to the first debug signal and the second debug signal, so as to obtain more coordinates. Among them, the position coordinates of different types of embedded programs are different. The position marked by the coordinates (X, Y) in the interrupted program is unique. For example, in the NO_PKT_RCVD interrupted program, (1, 1) represents the starting position, and (1, 1) cannot be used to represent the positions of other embedded programs in the NO_PKT_RCVD interrupted program.
[0103] Figure 3d This is the waveform diagram of the embedded program executed between the starting position and the interruption position of the NO_PKT_RCVD interrupted program provided by the embodiment of the present application. As Figure 3d shown, taking the NO_PKT_RCVDD interrupted program as an example, the data reception status signal rx_data, the data transmission status signal tx_data, and the GIO status signal are Figure 3c consistent, and Figure 3c different. Between the starting position and the ending position of the NO_PKT_RCVD interrupted program, there is a high level in the first debug signal dbg_clk. As shown by the dotted circle, it means that an embedded program is executed during the running of the NO_PKT_RCVD interrupted program. As Figure 3d shown, there are three bits of dbg_clk at high level. X is recorded as 3. The low level 0 of dbg_data corresponding to the first high level in dbg_clk, the high level 1 of dbg_data corresponding to the second high level, and the low level 0 of dbg_data corresponding to the third high level. Y is recorded as "010". The position of this embedded program can be expressed as (3, 2), which is used to indicate that an embedded program for reducing the priority of the ACL link is executed during the running of the NO_PKT_RCVD interrupted program.
[0104] Based on the manner in which the first debug signal dbg_clk and the second debug signal dbg_data indicate the starting position and the ending position of the interrupted program, the embodiment of the present application provides a method and device for determining the data reception and transmission status.
[0105] Figure 4 The flowchart of the interrupted program debugging method provided by the embodiment of the present application is exemplarily given. This process mainly includes the following steps:
[0106] S401: Obtain the first debug signal and the second debug signal used to indicate the starting position and the ending position of the interrupted program.
[0107] In this step, the starting position and the ending position of the interrupted program can be determined according to the first debug signal and the second debug signal. For the specific description, refer to Figure S202 and will not be repeated here.
[0108] In S401, the level value of the second debug signal can be obtained at the rising or falling edge of the pulse signal in the pulse signal sequence of the first debug signal at the first position. For example, in Figure 3c In the timer interrupt program shown, at position A (starting position), there is 1 rising edge in the pulse signal sequence of the first debug signal. The pulse signal in the pulse signal sequence of the second debug signal corresponding to this rising edge is at high level 1, and the coordinates of the first position (1, 1) are obtained. Or, according to the width of the high-level pulse signal in the pulse signal sequence of the first debug signal at the first position, the level value within the width of the high-level pulse signal at the position corresponding to the high-level pulse signal on the second debug signal is obtained. For example, in Figure 3c In the timer interrupt program shown, at position A (starting position), there is a high level with a width of 1 bit in the pulse signal sequence of the first debug signal. The pulse signal in the pulse signal sequence of the second debug signal corresponding to this high-level bit is at high level 1, and the coordinates of the first position (1, 1) are obtained.
[0109] S402: Determine the running time length of the interrupt program according to the starting position and ending position of the interrupt program indicated by the first debug signal and the second debug signal.
[0110] In this step, the running time length of the interrupt program is obtained by subtracting the time corresponding to the start position from the time corresponding to the end position. Taking Figure 3c the timer interrupt program shown as an example, the time A1 corresponding to the starting position (1, 1) is 3.507292426 seconds, and the time A2 corresponding to the ending position (1, 0) is 3.507301824 seconds. The running time length A of the timer interrupt program is 9.398 microseconds (μs).
[0111] S403: Debug the interrupt program according to the running time length of the interrupt program.
[0112] In this step, since the interrupt program controls what data the Bluetooth baseband integrated circuit sends at what time, different running time lengths of the interrupt program correspond to different data transceiver states. According to the running time length of the interrupt program, the data transceiver state (such as the time of data transceiver, data type, etc.) can be determined. According to the data transceiver state specified in the communication protocol, the debugger can understand the running situation of the interrupt program, which is convenient for debugging.
[0113] For example, taking Figure 3c the timer interrupt program shown as an example, the running time length of the timer interrupt program is 9.398 μs. By comparing the running time length of the timer interrupt program with the corresponding data transceiver time in the protocol, the interrupt program is debugged according to the comparison result, thereby improving the time accuracy of the Bluetooth baseband integrated circuit for transceiving data.
[0114] In some embodiments of the present application, a specific type of program can be determined according to the characteristics of the data reception status signal, data transmission status signal, and GIO status signal output by the integrated circuit. Taking the interruption program as an example, for instance, the position where tx_data ends is the PKA interruption, the position where there is data at the start of rx_data is the SYNC interruption, the position where rx_data completes data reception is the PKD interruption, and the position where no data is received for rx_data and the GIO status signal ends is the NO_PKT_RCVD interruption. For specific descriptions, refer to Figures 3a to 3c . During specific implementation, obtain the data reception status signal, data transmission status signal, and video control signal output by the Bluetooth baseband integrated circuit, and determine the type of the program according to the data reception status signal, data transmission status signal, and GIO status signal; determine the data transceiver status according to the type and running time length of the program, and debug the program according to the data transceiver status.
[0115] Based on the same technical concept, an embodiment of the present application provides a program debugging device, which can implement the program debugging method in the above embodiments.
[0116] Refer to Figure 5 , this device includes an acquisition module 501, a running time length determination module 502, and a debugging module 503.
[0117] The acquisition module 501 is used to acquire a first debugging signal and a second debugging signal; the first debugging signal and the second debugging signal are used to indicate the start position and end position of the program;
[0118] The running time length determination module 502 is used to determine the running time length of the program according to the start position and end position of the program indicated by the first debugging signal and the second debugging signal;
[0119] The debugging module 503 is used to debug the program according to the running time length of the program.
[0120] In some embodiments of the present application, the acquisition module is further used for the data reception status signal, data transmission status signal, and video control signal;
[0121] This device further includes a type determination module, which is used to determine the type of the program according to the data reception status signal, data transmission status signal, and GIO status signal;
[0122] This device further includes a status determination module, which is used to determine the data transceiver status according to the type and running time length of the program;
[0123] The debugging module is further used to debug the program according to the data transceiver status.
[0124] In some embodiments of the present application, the acquisition module is further configured to acquire the number of pulse signals in the pulse signal sequence at the first position in the first debug signal; acquire the level values corresponding to the respective pulse signals in the pulse signal sequence at the first position in the second debug signal;
[0125] The apparatus further includes a position determination module, configured to determine that the first position is the starting position of the program if the number of pulse signals in the pulse sequence at the first position and the level values corresponding to the respective pulse signals in the pulse signal sequence at the first position match the number of pulse signals and the level values corresponding to the pulse signals at the set starting position; determine that the first position is the ending position of the program if the number of pulse signals in the pulse sequence at the first position and the level values corresponding to the respective pulse signals in the pulse signal sequence at the first position match the number of pulse signals and the level values corresponding to the pulse signals at the set ending position.
[0126] In some embodiments of the present application, the acquisition module is specifically configured to:
[0127] acquire the level value of the second debug signal at the rising edge or falling edge of the pulse signal in the pulse signal sequence of the first debug signal at the first position; or
[0128] acquire the level value within the pulse signal width at the position corresponding to the pulse signal on the second debug signal according to the width of the pulse signal in the pulse signal sequence of the first debug signal at the first position.
[0129] In some embodiments of the present application, if there is also a pulse signal sequence on the first debug signal between the starting position and the ending position of the program indicated by the first debug signal and the second debug signal;
[0130] the acquisition module is further configured to acquire the number of pulse signals in the pulse signal sequence of the first debug signal between the starting position and the ending position, and the level values corresponding to the respective pulse signals in the pulse signal sequence of the second debug signal between the starting position and the ending position;
[0131] The type determination module is further configured to determine that the program is a timer program if the number of pulse signals in the pulse signal sequence of the first debug signal between the starting position and the ending position and the level values corresponding to the respective pulse signals in the pulse signal sequence of the second debug signal match the number of pulse signals and the level values of the pulse signals of the set timer program.
[0132] In some embodiments of the present application, the first debug signal and the second debug signal are further used to indicate the embedded program during the program operation;
[0133] The acquisition module is further configured to acquire the number of pulse signals in the pulse signal sequence of the first debug signal and the level values corresponding to the pulse signals in the pulse signal sequence of the second debug signal between the starting position and the ending position of the program.
[0134] The apparatus further includes an embedded program determination module, configured to determine that the embedded program has run during the program execution if the number of pulse signals in the pulse signal sequence of the first debug signal and the level values corresponding to the pulse signals in the pulse signal sequence of the second debug signal match the number of pulse signals and the level values of the pulse signals corresponding to the set embedded program.
[0135] It should be noted here that the above data transceiver status determination apparatus provided by the embodiments of the present application can implement the steps of the data transceiver status determination method implemented by the above method embodiments, and can achieve the same technical effects. The same parts and beneficial effects as those in the method embodiments are not specifically described herein again.
[0136] The embodiments of the present application further provide a computer-readable storage medium, which stores computer-executable instructions for causing a computer to execute the method in the above embodiments.
[0137] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0138] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one or more of the flows and / or multiple flows and / or blocks Figure 1 one or more of the blocks and / or multiple blocks.
[0139] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means embodying the function specified in the flowchart Figure 1 one or more flowcharts and / or boxes Figure 1 specified in the box or boxes.
[0140] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, so that the instructions executed on the computer or other programmable apparatus provide steps for implementing the function specified in the flowchart Figure 1 one or more flowcharts and / or boxes Figure 1 specified in the box or boxes.
[0141] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.
Claims
1. A program debugging method, characterized in that, Including: Obtain a first debug signal and a second debug signal; the first debug signal and the second debug signal are used to indicate the start position and the end position of a program; Determine the running time length of the program according to the start position and the end position of the program indicated by the first debug signal and the second debug signal; Debug the program according to the running time length of the program to control the data sending and receiving status; Wherein, the method further includes: Obtain the number of pulse signals in the pulse signal sequence at the first position in the first debug signal; Obtain the level values corresponding to the respective pulse signals in the pulse signal sequence at the first position in the second debug signal; If the number of pulse signals in the pulse sequence at the first position and the level values corresponding to the respective pulse signals in the pulse signal sequence at the first position match the number of pulse signals and the level values corresponding to the set start position, determine that the first position is the start position of the program; If the number of pulse signals in the pulse sequence at the first position and the level values corresponding to the respective pulse signals in the pulse signal sequence at the first position match the number of pulse signals and the level values corresponding to the set end position, determine that the first position is the end position of the program.
2. The method according to claim 1, characterized in that, Also including: Obtain a data reception status signal, a data transmission status signal, and a radio frequency control signal; Determine the type of the program according to the data reception status signal, the data transmission status signal, and the radio frequency control signal; Determine the data sending and receiving status according to the type and running time length of the program; Debug the program according to the data sending and receiving status.
3. The method according to claim 1, wherein The obtaining the level values corresponding to the respective pulse signals in the pulse signal sequence at the first position in the second debug signal includes: Obtain the level value of the second debug signal at the rising edge or falling edge of the pulse signal in the pulse signal sequence of the first debug signal at the first position; or Obtain the level value within the pulse signal width at the position corresponding to the pulse signal on the second debug signal according to the width of the pulse signal in the pulse signal sequence of the first debug signal at the first position.
4. The method according to claim 1, characterized in that The first debug signal and the second debug signal are further used to indicate the embedded program during the program operation; The method further includes: Obtain the number of pulse signals in the pulse signal sequence of the first debug signal and the level values corresponding to the respective pulse signals in the pulse signal sequence of the second debug signal between the start position and the end position of the program; If the number of pulse signals in the pulse signal sequence of the first debug signal and the level values corresponding to the respective pulse signals in the pulse signal sequence of the second debug signal match the number of pulse signals and the level values of the pulse signals corresponding to the set embedded program, determine that the embedded program is run during the program operation.
5. A program debugging device, characterized in that, Including: An obtaining module, configured to obtain a first debug signal and a second debug signal; the first debug signal and the second debug signal are used to indicate the start position and the end position of a program; A running time length determination module, configured to determine the running time length of a program according to the start position and end position of the program indicated by the first debugging signal and the second debugging signal; A debugging module, configured to debug the program according to the running time length of the program to control the data sending and receiving states; Wherein, the obtaining module is further configured to obtain the number of pulse signals in the pulse signal sequence at the first position in the first debugging signal; obtain the level values corresponding to the pulse signals in the pulse signal sequence at the first position in the second debugging signal; The apparatus further includes a position determination module, configured to determine that the first position is the start position of the program if the number of pulse signals in the pulse sequence at the first position and the level values corresponding to the pulse signals in the pulse signal sequence at the first position match the number of pulse signals and the level values corresponding to the set start position; determine that the first position is the end position of the program if the number of pulse signals in the pulse sequence at the first position and the level values corresponding to the pulse signals in the pulse signal sequence at the first position match the number of pulse signals and the level values corresponding to the set end position.
6. The device according to claim 5, characterized in that, The obtaining module is specifically configured to: Obtain the level value of the second debugging signal at the rising edge or falling edge of the pulse signal in the pulse signal sequence of the first debugging signal at the first position; Or Obtain the level value within the pulse signal width at the position corresponding to the pulse signal on the second debugging signal according to the width of the pulse signal in the pulse signal sequence of the first debugging signal at the first position.
7. The device according to claim 5, characterized in that, The first debugging signal and the second debugging signal are further configured to indicate an embedded program during program operation; The obtaining module is further configured to obtain the number of pulse signals in the pulse signal sequence of the first debugging signal and the level values corresponding to the pulse signals in the pulse signal sequence of the second debugging signal between the start position and the end position of the program; The apparatus further includes an embedded program determination module, configured to determine that the embedded program is run during the program operation if the number of pulse signals in the pulse signal sequence of the first debugging signal and the level values corresponding to the pulse signals in the pulse signal sequence of the second debugging signal match the number of pulse signals and the level values of the pulse signals corresponding to the set embedded program.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to cause a computer to execute the method according to any one of claims 1-4.
Citation Information
Patent Citations
Testing trimming circuit and integrated circuit
CN105445648A
Time statistical system and time statistical method
CN109283833A