Development and debugging system, handshaking method and device

文档序号:212344 发布日期:2021-11-05 浏览:15次 中文

阅读说明:本技术 一种开发调试系统、握手方法和装置 (Development and debugging system, handshaking method and device ) 是由 万瑞罡 于 2021-07-09 设计创作,主要内容包括:本申请实施例中提供了一种开发调试系统、握手方法和装置,开发调试系统包括主机和从机,主机与从机通信连接;主机向从机发送同步触发信号;从机依据同步触发信号向主机发送同步码;其中,同步码根据从机的时钟频率获得;主机依据同步码获取从机的通信频率;主机基于通信频率与从机进行初始化设置;若主机与从机初始化设置成功,则确认握手成功。通过主机同步从机通信速率的方式,可以使从机的调试接口设计简单,从机的调试部分占用面积可以下降,时序可以提升且验证可以更简单。(The embodiment of the application provides a development and debugging system, a handshake method and a device, wherein the development and debugging system comprises a host and a slave, and the host is in communication connection with the slave; the master machine sends a synchronous trigger signal to the slave machine; the slave machine sends a synchronous code to the host machine according to the synchronous trigger signal; wherein, the synchronous code is obtained according to the clock frequency of the slave; the host acquires the communication frequency of the slave according to the synchronous code; the host computer carries out initialization setting with the slave computer based on the communication frequency; and if the initialization setting of the host and the slave is successful, confirming that the handshake is successful. By means of synchronizing the communication speed of the slave computer by the host computer, the debugging interface of the slave computer can be designed simply, the occupied area of the debugging part of the slave computer can be reduced, the time sequence can be improved, and the verification can be simpler.)

1. The development and debugging system is characterized by comprising a host and a slave, wherein the host is in communication connection with the slave;

the master machine is used for sending a synchronous trigger signal to the slave machine;

the slave computer is used for sending a synchronous code to the host computer according to the synchronous trigger signal; wherein the synchronization code is obtained according to a clock frequency of the slave;

the master machine is also used for acquiring the communication frequency of the slave machine according to the synchronous code;

the master machine is also used for carrying out initialization setting with the slave machine based on the communication frequency;

and if the initialization setting of the host and the slave is successful, the handshake between the host and the slave is successful.

2. The development and debugging system of claim 1, wherein if the clock frequency of the slave is changed, the slave is further configured to send an updated synchronization code to the master;

and the host is also used for acquiring the updated communication frequency of the slave according to the updated synchronous code.

3. The development and debugging system of claim 2, wherein the slave is further configured to send a frequency change signal to the master;

the master machine is also used for stopping communication with the slave machine according to the frequency change signal.

4. The development and debugging system of any one of claims 1-3 wherein the host is further configured to measure a pulse width length of the synchronization code;

the master is further used for obtaining the communication frequency of the slave according to the pulse width length of the synchronous code.

5. The development and debugging system according to any one of claims 1-3, wherein the master is further configured to send an information acquisition instruction to the slave based on the communication frequency;

the slave machine is also used for feeding back characteristic information to the host machine according to the information acquisition instruction; the characteristic information comprises a chip model, a core model and function information of the slave;

the host is also used for carrying out initialization setting according to the characteristic information.

6. The development and debugging system of any one of claims 1-3 wherein the master is further configured to perform data interaction with the slave based on the communication frequency.

7. The development and debugging system of claim 6, wherein if the interaction data fed back from the slave to the master is overtime or incorrect, the master is further configured to determine that the clock frequency of the slave changes, and send the synchronization trigger signal to the slave;

the slave computer is also used for sending an updated synchronous code to the host computer according to the synchronous trigger signal;

and the host is also used for acquiring the updated communication frequency of the slave according to the updated synchronous code.

8. The development and debugging system according to claim 1, wherein if the master sends a synchronization trigger signal to a reset port of the slave, a pulse width length of the synchronization trigger signal is smaller than a pulse width length of a reset signal.

9. A handshake method, wherein the method is applied to a master, the master being communicatively connected to a slave, the method comprising:

sending a synchronization trigger signal to the slave;

receiving a synchronous code sent by the slave machine according to the synchronous trigger signal; wherein the synchronization code is obtained according to a clock frequency of the slave;

acquiring the communication frequency of the slave machine according to the synchronous code;

performing initialization setting with the slave machine based on the communication frequency;

and if the initialization setting of the host and the slave is successful, confirming that the handshake is successful.

10. The method of claim 9, wherein after the step of confirming that the handshake was successful, the method further comprises:

if the clock frequency of the slave machine is changed, receiving an updated synchronous code sent by the slave machine;

and acquiring the updated communication frequency of the slave according to the updated synchronization code.

11. The method of claim 10, wherein before the step of receiving the updated synchronization code sent by the slave if the clock frequency of the slave changes, the method further comprises:

receiving a frequency change signal sent by the slave;

and stopping communication with the slave machine according to the frequency change signal.

12. The method according to any of claims 9-11, wherein the step of obtaining the communication frequency of the slave device according to the synchronization code comprises:

measuring to obtain the pulse width length of the synchronous code;

and obtaining the communication frequency of the slave according to the pulse width length of the synchronous code.

13. The method according to any one of claims 9 to 11, wherein the step of performing initialization setting with the slave based on the communication frequency comprises:

sending an information acquisition instruction to the slave machine based on the communication frequency;

receiving characteristic information fed back by the slave machine according to the information obtaining instruction; the characteristic information comprises a chip model, a core model and function information of the slave;

and carrying out initialization setting according to the characteristic information.

14. A handshaking device, wherein the device is applied to a master, and wherein the master is communicatively coupled to a slave, the device comprising:

the sending module is used for sending a synchronous trigger signal to the slave;

the receiving module is used for receiving a synchronous code sent by the slave machine according to the synchronous trigger signal; wherein the synchronization code is obtained according to a clock frequency of the slave;

the acquisition module is used for acquiring the communication frequency of the slave machine according to the synchronous code;

the initialization setting module is used for carrying out initialization setting with the slave machine based on the communication frequency;

and the confirmation module is used for confirming that the handshake is successful if the initialization setting of the host and the slave is successful.

Technical Field

The present application relates to the field of communications technologies, and in particular, to a development and debugging system, a handshaking method, and an apparatus.

Background

At present, before the master and slave machines communicate, a handshake process needs to be performed first, and normal data interaction can be performed only after the handshake is successful.

Problems existing in the prior art:

the existing master-slave handshake flow is mostly a mode of synchronizing the master speed with the slave, so that the hardware design of the slave is complex, and the design area of the slave is overlarge.

Disclosure of Invention

The embodiment of the application provides a development and debugging system, a handshake method and a device, and the problems of complex hardware design and overlarge occupied area of a slave machine can be solved in a mode that a master machine synchronizes the communication frequency of the slave machine.

According to a first aspect of embodiments of the present application, a development and debugging system is provided, where the development and debugging system includes a master and a slave, and the master is communicatively connected to the slave;

the master machine is used for sending a synchronous trigger signal to the slave machine;

the slave computer is used for sending a synchronous code to the host computer according to the synchronous trigger signal; wherein the synchronization code is obtained according to a clock frequency of the slave;

the master machine is also used for acquiring the communication frequency of the slave machine according to the synchronous code;

the master machine is also used for carrying out initialization setting with the slave machine based on the communication frequency;

and if the initialization setting of the host and the slave is successful, the handshake between the host and the slave is successful.

According to a second aspect of the embodiments of the present application, there is provided a handshake method, where the method is applied to a master, and the master is communicatively connected to a slave, and the method includes:

sending a synchronization trigger signal to the slave;

receiving a synchronous code sent by the slave machine according to the synchronous trigger signal; wherein the synchronization code is obtained according to a clock frequency of the slave;

acquiring the communication frequency of the slave machine according to the synchronous code;

performing initialization setting with the slave machine based on the communication frequency;

and if the initialization setting of the host and the slave is successful, confirming that the handshake is successful.

According to a third aspect of the embodiments of the present application, there is provided a handshake apparatus, the apparatus being applied to a master, the master being communicatively connected to a slave, the apparatus including:

the sending module is used for sending a synchronous trigger signal to the slave;

the receiving module is used for receiving a synchronous code sent by the slave machine according to the synchronous trigger signal; wherein the synchronization code is obtained according to a clock frequency of the slave;

the acquisition module is used for acquiring the communication frequency of the slave machine according to the synchronous code;

the initialization setting module is used for carrying out initialization setting with the slave machine based on the communication frequency;

and the confirmation module is used for confirming that the handshake is successful if the initialization setting of the host and the slave is successful.

By adopting the development debugging system, the handshaking method and the device provided by the embodiment of the application, the host can communicate with the slave machine by using a relatively complex design, and the host synchronizes the communication rate of the slave machine, so that the debugging interface design of the slave machine is simple, the occupied area of the debugging part of the slave machine can be reduced, the time sequence can be improved, and the verification can be simpler.

Drawings

The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:

fig. 1 is a schematic structural diagram of a development and debugging system according to an embodiment of the present application;

fig. 2 is a schematic flowchart of a handshake method according to an embodiment of the present application;

fig. 3 is a schematic flowchart of another handshake method according to an embodiment of the present application;

fig. 4 is a flowchart illustrating another handshake method according to an embodiment of the present application

Fig. 5 is a flowchart illustrating another handshake method according to an embodiment of the present application;

fig. 6 is a block diagram of a handshaking device according to an embodiment of the present application.

Detailed Description

In the process of implementing the present application, the inventor finds that the current master-slave handshake flow is mostly a mode of synchronizing the master rate of the slave, so that the hardware design of the slave is complex, and the design area of the slave is too large.

In view of the above problems, embodiments of the present application provide a development debugging system, a handshake method, and an apparatus, where a host can communicate with a slave using a relatively complex design, and a mode of synchronizing a communication rate of the slave by the host may simplify a debugging interface design of the slave, reduce an occupied area of a debugging portion of the slave, improve a timing sequence, and simplify verification.

The scheme in the embodiment of the application can be implemented by adopting various computer languages, such as object-oriented programming language Java and transliterated scripting language JavaScript.

In order to make the technical solutions and advantages of the embodiments of the present application more apparent, the following further detailed description of the exemplary embodiments of the present application with reference to the accompanying drawings makes it clear that the described embodiments are only a part of the embodiments of the present application, and are not exhaustive of all embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.

Referring to fig. 1, a schematic structural diagram of a development and debugging system 100 according to an embodiment of the present disclosure is shown, where the development and debugging system 100 includes a host 110 and a slave 120, and the host 110 is in communication connection with the slave 120.

Before the master 110 and the slave 120 perform normal communication, a handshake process needs to be performed between the master 110 and the slave 120, and after the handshake is successful, the master 110 and the slave 120 can perform normal communication. The handshake process includes synchronization of communication frequency between the master 110 and the slave 120, and initialization setting between the master 110 and the slave 120.

The working principle of the handshake process may be: the master machine is used for sending a synchronous trigger signal to the slave machine; the slave computer is used for sending a synchronous code to the host computer according to the synchronous trigger signal; wherein, the synchronous code is obtained according to the clock frequency of the slave; the host is also used for acquiring the communication frequency of the slave according to the synchronous code; the master machine is also used for carrying out initialization setting with the slave machine based on the communication frequency; and if the initialization setting of the host and the slave is successful, the handshake between the host and the slave is successful.

It should be understood that the synchronous trigger signal may be a low level with a certain length, and may also be a PWM (Pulse Width Modulation) signal.

If the master 110 sends the synchronous trigger signal to the reset port of the slave 120, in order to avoid the false triggering of the reset function, the pulse width length of the synchronous trigger signal should be smaller than that of the reset signal. If the synchronous trigger signal is at low level, the pulse width length of the trigger signal is one tenth of that of the reset signal.

If the debug port and the reset port of the slave 120 are multiplexed, the reset port of the slave 120 can implement the reset function and also can implement the debug function.

The synchronization code is obtained from the clock frequency of the slave 120. It should be understood that after the slave 120 receives the synchronization trigger signal, the synchronization trigger signal is treated as an error frame, and the slave 120 sends an error code, i.e. a synchronization code, to the master 110 at the current communication frequency. The error code may be understood as an error prompt signal fed back by the slave 120 according to the synchronization trigger signal.

The communication frequency of the slave 120 is generated according to the clock frequency of the slave 120, and the communication frequency may be the clock frequency or obtained by dividing the clock frequency, and the communication frequency of the slave 120 may be set according to actual situations.

The host 110 measures the pulse width length of the synchronization code; the master 110 obtains the communication frequency of the slave 120 according to the pulse width length of the synchronization code. The host 110 includes a timer, wherein the timer starts to count time when the host 110 detects a rising edge of the synchronization code, and stops counting time when the host 110 detects a falling edge of the synchronization code. And obtaining the pulse width length of the synchronous code according to the time length counted by the timer between the adjacent rising edge and the falling edge of the synchronous code.

After obtaining the communication frequency of the slave 120, the master 110 may perform data transmission by using the communication frequency of the slave 120, so as to achieve the communication frequency consistency between the master 110 and the slave 120, that is, the master 110 and the slave 120 have achieved physical communication synchronization.

After the communication synchronization between the master 110 and the slave 120 is realized, data interaction may be performed between the master 110 and the slave 120 to realize the initialization setting. The principle of implementing the initialization setting between the master 110 and the slave 120 may be: the master 110 sends an information acquisition instruction to the slave 120 based on the communication frequency; the slave 120 feeds back the characteristic information to the host 110 according to the information acquisition instruction; the host 110 performs initialization setting according to the feature information.

The initialization setting may be that the master 110 determines the functions supported by the slaves 120 according to the feature information of the slaves 120, and the master 110 performs command transmission according to the functions supported by the slaves 120. The characteristic information includes a chip model, a core model, and function information of the slave 120.

It should be understood that the master 110 sends the obtaining information command to the slave 120 based on the communication frequency of the slave 120, because the master 110 sends the command communication frequency and the slave 120 communication frequency, the slave 120 can correctly receive the obtaining information command and feed back the characteristic information to the master 110 according to the obtaining information command. The feature information includes a chip model, a core model, and function information of the slave 120, the master 110 can determine the functions supported by the slave 120 based on the chip model, the core model, and the function information of the slave 120, and the master 110 sends a corresponding instruction according to the functions supported by the slave 120.

In an alternative embodiment, the master 110 may also send the feature information of the master 110 to the slave 120. The slave 120 can determine the functions supported by the master 110 based on the feature information of the master 110. The feature information of the host 110 includes a chip model, a core model, and function information of the host 110.

The handshake process includes communication frequency synchronization and initialization setting, and before the initialization setting, the communication frequency synchronization needs to be ensured. After the initialization setting is successful, the handshake flow ends.

In the embodiment, the synchronization function is implemented by moving the slave device 120 to the master device 110, so that the chip area of the slave device 120 can be reduced, the timing sequence can be improved, and the verification is simpler.

It should be understood that the host 110 may be a burner (e.g., a computer and a debugger) and an off-line programmer, etc., and the slave 120 may be a chip to be tested and a chip to be programmed.

In an alternative embodiment, since the clock frequency of the slave 120 may change, the communication frequency of the corresponding slave 120 may also change, and since the master 110 further communicates with the slave 120 based on the communication frequency before the change of the slave 120, the communication frequency between the master 110 and the slave 120 is in an unsynchronized state. In case of communication frequency change of the slave 120, synchronization between the master 110 and the slave 120 can be ensured. The application also provides a repeated handshake flow, and the working principle of the repeated handshake flow is as follows: if the clock frequency of the slave computer is changed, the slave computer is also used for sending the updated synchronous code to the host computer; the master computer is also used for acquiring the updated communication frequency of the slave computer according to the updated synchronization code.

It should be appreciated that as the clock frequency of the slave 120 changes, the communication frequency of the slave 120 will also change accordingly. When the communication frequency of the slave 120 is changed, if the master 110 performs data exchange with the slave 120 according to the communication frequency corresponding to the clock frequency of the slave 120 before the change, the master 110 and the slave 120 are not in a communication synchronization state due to the fact that the communication frequency of the master 110 is not consistent with the communication frequency of the slave 120, and normal communication between the master 110 and the slave 120 is not possible. Therefore, after the clock frequency of the slave 120 is changed, the slave 120 actively sends the updated synchronization code to the master 110.

The master 110 needs to obtain the updated communication frequency of the slave 120 according to the updated synchronization code, and the master 110 performs data interaction with the slave 120 through the updated communication frequency, so that the communication frequencies of the master 110 and the slave 120 are kept consistent again, and the master 110 and the slave 120 are continuously in a communication synchronization state.

As can be seen, through the above re-handshake process, when the clock frequency of the slave 120 changes, the slave 120 actively sends the updated synchronization code to the master 110, so that the communication frequency of the master 110 is updated correspondingly. It can be ensured that the synchronization between the master 110 and the slave 120 can be maintained in case of the communication frequency change of the slave 120.

Before the slave 120 sends the updated synchronization code to the master 110, the slave 120 is further configured to send a frequency change signal to the master 110; the master 110 is also configured to stop communicating with the slave 120 according to the frequency change signal.

It should be understood that the slave 120 may generate the frequency change signal in response to a clock frequency change command, the clock frequency change command being generated by the slave 120 in response to an external operation, and the external operation may be understood as a clock frequency change operation made by a worker.

When the slave 120 generates the frequency change signal, the clock frequency of the slave 120 is not changed, and the slave 120 determines that the clock frequency of the slave 120 is to be changed according to the clock frequency change command, and further transmits the frequency change signal to the master 110 before the clock frequency of the slave 120 is changed.

Since the clock frequency of the slave 120 will change, a communication failure due to the change of the clock frequency of the slave 120 during the data interaction between the master 110 and the slave 120 is avoided. Therefore, the master 110 stops communicating with the slave 120 before the clock frequency of the slave 120 is changed, and after the clock frequency of the slave 120 is changed and the master 110 and the slave 120 are synchronized, the master 110 continues to communicate with the slave 120.

After the handshake flow or the re-handshake flow is finished, the master 110 is further configured to perform data interaction with the slave 120 based on the communication frequency. The content of the data interaction may include that the master 110 sends a response instruction based on the function supported by the slave 120, and the instruction may be a corresponding function test instruction, or a function control instruction, and the like.

In this embodiment, after the handshake flow or the handshake flow between the master 110 and the slave 120 is ended, the normal communication flow between the master 110 and the slave 120 may be: if the debugging communication process is performed between the master 110 and the slave 120, the master 110 sends a debugging command to the slave 120; the debugging command comprises verification information and command information; the slave 120 checks whether the check information is correct or not, and if not, sends error prompt information to the host 110; if the verification information is correct, the slave 120 checks whether the command information is correct, and if not, sends error prompt information to the host 110; if the command information is correct, the slave 120 executes the command information, and if the command information is executed, the slave 120 sends multiframe information back to the master 110; after receiving the reply frame information, the master 110 checks whether the check information of the reply frame information is correct, if not, the master 110 sends a repeat uploading command to the slave 120, and the slave 120 sends the reply frame information to the master 110 again according to the repeat uploading command; the master 110 confirms whether the check information of the reply frame information is correct again according to the reply frame information sent again by the slave 120, if not, the master 110 continues to send the repeat upload command to the slave 120, and repeats the above operations until the number of times that the master 110 continuously sends the repeat upload command to the slave 120 reaches the preset number, or the check information of the reply frame information received by the master 110 is correct.

It should be understood that if the command information is executed, the slave 120 sends the multiframe information back to the master 110 in the following two ways. One of the methods is as follows: the reply frame information includes an acknowledgement, and if the command information is executed and the slave 120 does not need to return the data payload of the master 110, the slave 120 feeds back the acknowledgement to the master 110. The other mode is as follows: the reply frame information includes reply data, and if the command information is executed and the slave 120 needs to return the data payload of the master 110, the slave 120 sends the reply data to the master 110.

The debugging command can adopt an encoding data format, namely the debugging command format can comprise a 1 start bit, 8 data bits, a 1 odd check bit and a 1 stop bit, command information is set in the data bits, and check information is set in the odd check bits; if the bitwise XOR of the check information and the data bit is 1, the correct check information is shown, and if the bitwise XOR of the check information and the data bit is 0, the wrong check information is shown; the command information format may include a command word, the result of the bitwise negation of the command word, an optional data payload, and an accumulated checksum; the response data includes the command word in the command message and the data payload that needs to be returned to the host 110.

The command word contains the following contents: the method comprises the steps of controlling an instruction, setting an instruction, resetting a signal, acquiring an information instruction, safety information and a communication frequency setting instruction; the control instruction is used for controlling shutdown, break-point, memory writing, program running and the like of the control part of the slave 120; the setting instruction includes reading and writing data such as memory and register values of the data portion of the slave 120, so that the host 110 can perform functions such as programming and parameter setting on the slave 120; the reset signal is a reset signal of an optional reset domain range of a system reset controller of the slave 120, so that the slave 120 which may not work normally can be reset in a soft mode or a hard mode and return to a normal state; the acquired information instruction is an instruction for performing initialization setting and sending between the master 110 and the slave 120 in the handshake flow, and the master 110 can acquire the hardware model, the core model, the available revision and the like of the slave 120 by acquiring the information instruction; the security information may include a password, and the host 110 and the slave 120 may exchange respective preset passwords to realize an authentication function, that is, whether the host 110 has the authority to access the slave 120 may be verified, and the slave 120 may also deny a debug access for authorization; the host 110 can set the communication frequency of the slave 120 according to the communication frequency setting instruction, and can select different communication frequencies in different scenes to improve the stability and speed of communication; the data payload may be understood as specific data content stored at the slave 120; the accumulated checksum is used to characterize whether the command information is complete and correct.

In this embodiment, if the slave 120 does not know that the clock frequency of the slave 120 will change, that is, if the slave 120 does not actively send the frequency change signal, the master 110 may actively go through the handshake flow again to avoid unsynchronized communication between the master 110 and the slave 120.

The principle of the host 110 actively starting the re-handshake flow is: if the interactive data fed back from the slave 120 to the master 110 is overtime or wrong, the master 110 is further configured to determine that the clock frequency of the slave 120 changes, and send a synchronization trigger signal to the slave 120; the slave 120 is further configured to send an updated synchronization code to the master 110 according to the synchronization trigger signal; the master 110 is further configured to obtain the updated communication frequency of the slave 120 according to the updated synchronization code.

It should be understood that if the clock frequency of the slave 120 is changed, the communication frequency of the slave 120 is also changed correspondingly, and the master 110 further communicates with the slave 120 based on the corresponding communication frequency before the clock frequency of the slave 120 is changed, so that the communication frequency of the master 110 is not consistent with the communication frequency of the slave 120. The master 110 and the slave 120 are not in a communication synchronization state, and normal communication between the master 110 and the slave 120 is impossible.

Under the condition that the master 110 and the slave 120 are not in a communication synchronization state, the interaction data fed back from the slave 120 to the master 110 may have a timeout or error phenomenon; that is, if the master 110 does not receive the interactive data fed back from the slave 120 within the preset time, or receives the erroneous interactive data fed back from the slave 120 within the preset time; the master 110 may determine that the clock frequency of the slave 120 has changed, and resend the synchronization trigger signal to the slave 120, and go through the handshake process again to complete the synchronization between the master 110 and the slave 120.

The slave 120 sends the updated synchronization code to the master 110 again according to the synchronization trigger signal sent by the master 110, and the updated synchronization code is obtained according to the changed clock frequency of the slave 120. That is, since the communication frequency of the slave 120 is generated according to the clock frequency of the slave 120, and when the clock frequency of the slave 120 is changed, the communication frequency of the slave 120 is also changed accordingly, and thus the synchronization code transmitted from the slave 120 to the master 110 at the changed communication frequency is also changed accordingly.

Since the slave 120 sends the updated synchronization code to the master 110 at the changed communication frequency, the master 110 measures the pulse width length of the updated synchronization code, and obtains the updated communication frequency of the slave 120 according to the pulse width length of the updated synchronization code. The master 110 performs data interaction with the slave 120 based on the updated communication frequency of the slave 120, the communication frequencies of the master 110 and the slave 120 are kept consistent, and the master 110 and the slave 120 complete communication synchronization again.

Next, on the basis of the host 110 shown in fig. 1, the embodiment of the present application provides a handshake method, please refer to fig. 2, where fig. 2 is a handshake method provided by the embodiment of the present application, and the handshake method may include the following steps:

and S201, sending a synchronization trigger signal to the slave.

If the master 110 sends the synchronous trigger signal to the reset port of the slave 120, in order to avoid the false triggering of the reset function, the pulse width length of the synchronous trigger signal should be smaller than that of the reset signal. If the synchronous trigger signal is at low level, the pulse width length of the trigger signal is one tenth of that of the reset signal.

It should be understood that if the debug port and the reset port of the slave 120 are multiplexed, the reset port of the slave 120 can implement both the reset function and the debug function.

S202, receiving the synchronous code sent by the slave machine according to the synchronous trigger signal.

Wherein the synchronization code is obtained from the clock frequency of the slave 120.

S203, acquiring the communication frequency of the slave according to the synchronous code.

It should be appreciated that the host 110 measures the pulse width length of the synchronization code; the master 110 obtains the communication frequency of the slave 120 according to the pulse width length of the synchronization code.

And S204, performing initialization setting with the slave based on the communication frequency.

And S205, if the initialization setting of the host and the slave is successful, confirming that the handshake is successful.

It should be understood that the handshake procedure includes communication frequency synchronization and initialization setting, and the communication frequency synchronization needs to be ensured before the initialization setting is performed. After the initialization setting is successful, the handshake flow ends.

If the communication frequency is not synchronized or the initialization setting is not successful, it indicates that the handshake is failed, and the contents of steps S201-S204 are repeatedly executed. If the communication frequency synchronization and the initialization setting are successful within the preset execution times, the end of the handshake flow can be confirmed. And if the preset execution times are exceeded, the communication frequency is not synchronized or the initialization setting is not successful, confirming that the handshake flow fails.

To facilitate understanding how the initialization setting is implemented between the master 110 and the slave 120, please refer to fig. 3, where the above S204 includes the following sub-steps:

s204a, an information acquisition command is sent to the slave device based on the communication frequency.

And S204b, receiving the characteristic information fed back by the slave machine according to the acquired information command.

And S204c, performing initialization setting according to the characteristic information.

It should be understood that the master 110 sends the obtaining information command to the slave 120 based on the communication frequency of the slave 120, because the master 110 sends the command communication frequency and the slave 120 communication frequency, the slave 120 can correctly receive the obtaining information command and feed back the characteristic information to the master 110 according to the obtaining information command. The feature information includes a chip model, a core model, and function information of the slave 120, the master 110 can determine the functions supported by the slave 120 based on the chip model, the core model, and the function information of the slave 120, and the master 110 sends a corresponding instruction according to the functions supported by the slave 120.

In an alternative embodiment, since the clock frequency of the slave 120 may change, the communication frequency of the corresponding slave 120 may also change, and since the master 110 further communicates with the slave 120 based on the communication frequency before the change of the slave 120, the communication frequency between the master 110 and the slave 120 is in an unsynchronized state. In case of communication frequency change of the slave 120, synchronization between the master 110 and the slave 120 can be ensured. The present application also provides a re-handshake flow, please refer to fig. 4, where the handshake method further includes the following steps:

and S208, if the clock frequency of the slave is changed, receiving the updated synchronous code sent by the slave.

It should be appreciated that as the clock frequency of the slave 120 changes, the communication frequency of the slave 120 will also change accordingly. When the communication frequency of the slave 120 is changed, if the master 110 performs data exchange with the slave 120 according to the communication frequency corresponding to the clock frequency of the slave 120 before the change, the master 110 and the slave 120 are not in a communication synchronization state due to the fact that the communication frequency of the master 110 is not consistent with the communication frequency of the slave 120, and normal communication between the master 110 and the slave 120 is not possible. Therefore, after the clock frequency of the slave 120 is changed, the slave 120 actively sends the updated synchronization code to the master 110.

And S209, acquiring the updated communication frequency of the slave according to the updated synchronous code.

It should be understood that the master 110 needs to obtain the updated communication frequency of the slave 120 according to the updated synchronization code, and the master 110 performs data interaction with the slave 120 through the updated communication frequency, so that the communication frequencies of the master 110 and the slave 120 are kept consistent again, and the master 110 and the slave 120 are continuously in a communication synchronization state.

It can be seen that, according to the contents of S208 and S209, when the clock frequency of the slave 120 changes, the slave 120 actively transmits the updated synchronization code to the master 110, so that the communication frequency of the master 110 is updated correspondingly. It can be ensured that the synchronization between the master 110 and the slave 120 can be maintained in case of the communication frequency change of the slave 120.

Referring to fig. 4, before S208, the above handshake method further includes the following steps:

s206, receives the frequency change signal transmitted from the slave.

It should be understood that the slave 120 may generate the frequency change signal in response to a clock frequency change command, the clock frequency change command being generated by the slave 120 in response to an external operation, and the external operation may be understood as a clock frequency change operation made by a worker.

When the slave 120 generates the frequency change signal, the clock frequency of the slave 120 is not changed, and the slave 120 determines that the clock frequency of the slave 120 is to be changed according to the clock frequency change command, and further transmits the frequency change signal to the master 110 before the clock frequency of the slave 120 is changed.

And S207, stopping communication with the slave according to the frequency change signal.

It should be understood that, since the clock frequency of the slave 120 will change, a communication failure due to the change of the clock frequency of the slave 120 during the data interaction between the master 110 and the slave 120 is avoided. Therefore, the master 110 stops communicating with the slave 120 before the clock frequency of the slave 120 is changed, and after the clock frequency of the slave 120 is changed and the master 110 and the slave 120 are synchronized, the master 110 continues to communicate with the slave 120.

Referring to fig. 5, the above handshaking method further includes the following steps:

and S210, performing data interaction with the slave machine based on the communication frequency.

It should be understood that after the handshake process or the re-handshake process between the master 110 and the slave 120 is completed, that is, after the communication frequency synchronization and initialization setting between the master 110 and the slave 120 are successful, the master 110 may perform data interaction with the slave 120 based on the communication frequency.

The content of the data interaction may include that the master 110 sends a response instruction based on the function supported by the slave 120, and the instruction may be a corresponding function test instruction, or a function control instruction, and the like.

Referring to fig. 5, if the slave 120 does not know that the clock frequency of the slave 120 is changed, that is, if the slave 120 does not actively send the frequency change signal, the following steps may be performed to avoid unsynchronized communication between the master 110 and the slave 120.

And S211, if the interactive data fed back from the slave to the master is overtime or wrong, judging that the clock frequency of the slave is changed, and sending a synchronous trigger signal to the slave.

It should be understood that if the clock frequency of the slave 120 is changed, the communication frequency of the slave 120 is also changed correspondingly, and the master 110 further communicates with the slave 120 based on the corresponding communication frequency before the clock frequency of the slave 120 is changed, so that the communication frequency of the master 110 is not consistent with the communication frequency of the slave 120. The master 110 and the slave 120 are not in a communication synchronization state, and normal communication between the master 110 and the slave 120 is impossible.

Under the condition that the master 110 and the slave 120 are not in a communication synchronization state, the interaction data fed back from the slave 120 to the master 110 may have a timeout or error phenomenon; that is, if the master 110 does not receive the interactive data fed back from the slave 120 within the preset time, or receives the erroneous interactive data fed back from the slave 120 within the preset time; the master 110 may determine that the clock frequency of the slave 120 has changed, and resend the synchronization trigger signal to the slave 120, and go through the handshake process again to complete the synchronization between the master 110 and the slave 120.

S212, receiving the updated synchronization code sent by the slave machine according to the synchronization trigger signal.

It should be understood that the slave device 120 retransmits the updated synchronization code to the master device 110 according to the synchronization trigger signal transmitted by the master device 110, and the updated synchronization code is obtained according to the changed clock frequency of the slave device 120. That is, since the communication frequency of the slave 120 is generated according to the clock frequency of the slave 120, and when the clock frequency of the slave 120 is changed, the communication frequency of the slave 120 is also changed accordingly, and thus the synchronization code transmitted from the slave 120 to the master 110 at the changed communication frequency is also changed accordingly.

And S213, acquiring the updated communication frequency of the slave according to the updated synchronization code.

It should be understood that, since the slave 120 sends the updated synchronization code to the master 110 at the changed communication frequency, the master 110 measures the pulse width length of the updated synchronization code and obtains the updated communication frequency of the slave 120 according to the pulse width length of the updated synchronization code. The master 110 performs data interaction with the slave 120 based on the updated communication frequency of the slave 120, the communication frequencies of the master 110 and the slave 120 are kept consistent, and the master 110 and the slave 120 complete communication synchronization again.

In order to implement the above-mentioned handshaking methods corresponding to S201 to S213 and possible sub-steps thereof, an embodiment of the present application provides a handshaking apparatus, please refer to fig. 6, where fig. 6 is a block schematic diagram of a handshaking apparatus 300 provided in the embodiment of the present application, where the handshaking apparatus 300 includes: a sending module 310, a receiving module 320, an obtaining module 330, an initialization setting module 340, a confirming module 350, and a processing module 360.

The sending module 310 is configured to send a synchronization trigger signal to the slave 120.

The receiving module 320 is configured to receive a synchronization code sent by the slave 120 according to the synchronization trigger signal; wherein the synchronization code is obtained from the clock frequency of the slave 120.

The receiving module 320 is further configured to receive a frequency change signal sent from the slave 120.

The receiving module 320 is further configured to receive the updated synchronization code sent by the slave 120 if the clock frequency of the slave 120 changes.

The receiving module 320 is further configured to receive an updated synchronization code sent by the slave device 120 according to the synchronization trigger signal.

The obtaining module 330 is configured to obtain a communication frequency of the slave 120 according to the synchronization code.

The initialization setting module 340 is used for performing initialization setting with the slave 120 based on the communication frequency.

The confirmation module 350 is configured to confirm that the handshake is successful if the initialization setting of the master 110 and the slave 120 is successful.

The processing module 360 is configured to stop communicating with the slave 120 according to the frequency change signal.

The processing module 360 is further configured to obtain an updated communication frequency of the slave 120 according to the updated synchronization code.

The processing module 360 is further configured to perform data interaction with the slave 120 based on the communication frequency; if the interactive data fed back from the slave 120 to the master 110 is overtime or wrong, the clock frequency of the slave 120 is determined to be changed, and a synchronization trigger signal is sent to the slave 120.

It should be understood that the sending module 310, the receiving module 320, the obtaining module 330, the initialization setting module 340, the confirming module 350 and the processing module 360 may cooperatively implement the above-mentioned S201 to S213 and possible sub-steps thereof.

In summary, the present application provides a development and debugging system, a handshaking method and an apparatus, where the handshaking method includes: the master machine sends a synchronous trigger signal to the slave machine; the slave machine sends a synchronous code to the host machine according to the synchronous trigger signal; wherein, the synchronous code is obtained according to the clock frequency of the slave; the host acquires the communication frequency of the slave according to the synchronous code; the host computer carries out initialization setting with the slave computer based on the communication frequency; and if the initialization setting of the host and the slave is successful, confirming that the handshake is successful. Because the host can communicate with the slave by using a relatively complex design, the debugging interface of the slave can be designed simply by synchronizing the communication speed of the slave through the host, the occupied area of the debugging part of the slave can be reduced, the time sequence can be improved, and the verification can be simpler.

As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.

The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may 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 which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.

These computer program instructions may 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 such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.

It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种星载红外相机外同步响应方法及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!