CN113612565A - Development and debugging system, handshaking method and device - Google Patents

Development and debugging system, handshaking method and device Download PDF

Info

Publication number
CN113612565A
CN113612565A CN202110780385.8A CN202110780385A CN113612565A CN 113612565 A CN113612565 A CN 113612565A CN 202110780385 A CN202110780385 A CN 202110780385A CN 113612565 A CN113612565 A CN 113612565A
Authority
CN
China
Prior art keywords
slave
master
host
communication frequency
frequency
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110780385.8A
Other languages
Chinese (zh)
Other versions
CN113612565B (en
Inventor
万瑞罡
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shin Lai Zhirong Semiconductor Technology Shanghai Co ltd
Original Assignee
Shin Lai Zhirong Semiconductor Technology Shanghai Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shin Lai Zhirong Semiconductor Technology Shanghai Co ltd filed Critical Shin Lai Zhirong Semiconductor Technology Shanghai Co ltd
Priority to CN202110780385.8A priority Critical patent/CN113612565B/en
Publication of CN113612565A publication Critical patent/CN113612565A/en
Application granted granted Critical
Publication of CN113612565B publication Critical patent/CN113612565B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0602Systems characterised by the synchronising information used
    • H04J3/0617Systems characterised by the synchronising information used the synchronising signal being characterised by the frequency or phase
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0676Mutual

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Systems (AREA)

Abstract

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.

Description

Development and debugging system, handshaking method and device
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.

Claims (14)

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.
CN202110780385.8A 2021-07-09 2021-07-09 Development and debugging system, handshake method and device Active CN113612565B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110780385.8A CN113612565B (en) 2021-07-09 2021-07-09 Development and debugging system, handshake method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110780385.8A CN113612565B (en) 2021-07-09 2021-07-09 Development and debugging system, handshake method and device

Publications (2)

Publication Number Publication Date
CN113612565A true CN113612565A (en) 2021-11-05
CN113612565B CN113612565B (en) 2024-03-15

Family

ID=78304352

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110780385.8A Active CN113612565B (en) 2021-07-09 2021-07-09 Development and debugging system, handshake method and device

Country Status (1)

Country Link
CN (1) CN113612565B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114793202A (en) * 2022-04-25 2022-07-26 珠海格力电器股份有限公司 Communication method, device, equipment and system

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
ATA7852000A (en) * 2000-05-04 2001-03-15 Fts Computertechnik Gmbh METHOD AND COMMUNICATION CONTROL UNIT FOR THE MULTIMASTER WATCH SYNCHRONIZATION IN A DISTRIBUTED REAL-TIME COMPUTER SYSTEM
CN102624382A (en) * 2012-03-29 2012-08-01 广州市广晟微电子有限公司 Clock synchronization method, device and radio frequency chip circuit with same device
CN102780553A (en) * 2011-05-10 2012-11-14 北京联拓恒芯科技发展有限公司 Method, system and equipment for transmitting synchronous code sequence and synchronizing
CN102916921A (en) * 2012-09-19 2013-02-06 华为技术有限公司 Method, device and system for carrier synchronization
JP2014057179A (en) * 2012-09-12 2014-03-27 Hitachi Ltd Network device
CN106055497A (en) * 2016-06-02 2016-10-26 广东盈科电子有限公司 Communication method of circuit board and circuit board
CN106254023A (en) * 2016-08-09 2016-12-21 珠海优特电力科技股份有限公司 Method and system for communication of master device and slave device
CN106646443A (en) * 2017-01-23 2017-05-10 河海大学 Ultrasonic ranging system and method based on ZigBee communications
CN107959537A (en) * 2016-10-17 2018-04-24 ***通信有限公司研究院 A kind of state synchronization method and device
CN112738259A (en) * 2020-12-31 2021-04-30 广州航天海特***工程有限公司 Ethernet data transmission method, device, equipment and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
ATA7852000A (en) * 2000-05-04 2001-03-15 Fts Computertechnik Gmbh METHOD AND COMMUNICATION CONTROL UNIT FOR THE MULTIMASTER WATCH SYNCHRONIZATION IN A DISTRIBUTED REAL-TIME COMPUTER SYSTEM
CN102780553A (en) * 2011-05-10 2012-11-14 北京联拓恒芯科技发展有限公司 Method, system and equipment for transmitting synchronous code sequence and synchronizing
CN102624382A (en) * 2012-03-29 2012-08-01 广州市广晟微电子有限公司 Clock synchronization method, device and radio frequency chip circuit with same device
JP2014057179A (en) * 2012-09-12 2014-03-27 Hitachi Ltd Network device
CN102916921A (en) * 2012-09-19 2013-02-06 华为技术有限公司 Method, device and system for carrier synchronization
CN106055497A (en) * 2016-06-02 2016-10-26 广东盈科电子有限公司 Communication method of circuit board and circuit board
CN106254023A (en) * 2016-08-09 2016-12-21 珠海优特电力科技股份有限公司 Method and system for communication of master device and slave device
CN107959537A (en) * 2016-10-17 2018-04-24 ***通信有限公司研究院 A kind of state synchronization method and device
CN106646443A (en) * 2017-01-23 2017-05-10 河海大学 Ultrasonic ranging system and method based on ZigBee communications
CN112738259A (en) * 2020-12-31 2021-04-30 广州航天海特***工程有限公司 Ethernet data transmission method, device, equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
陈梅;汪月乾;张永贤;郭凯;: "二乘二取二***的同步表决安全机制研究", 单片机与嵌入式***应用, no. 03 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114793202A (en) * 2022-04-25 2022-07-26 珠海格力电器股份有限公司 Communication method, device, equipment and system
CN114793202B (en) * 2022-04-25 2023-11-24 珠海格力电器股份有限公司 Communication method, device, equipment and system

Also Published As

Publication number Publication date
CN113612565B (en) 2024-03-15

Similar Documents

Publication Publication Date Title
CN108279910B (en) Program code programming method and device, computer equipment and storage medium
CN105786753A (en) Method and device for data transmission between master and slave devices on I2C bus
CN112579509B (en) Single-wire communication method, single-wire communication device, electronic equipment and readable storage medium
CN101167341A (en) Address assignment for safe users of a field bus
CN111104139A (en) Firmware upgrading method, device, equipment and storage medium
CN109074294B (en) Communication device and communication system
CN113612565B (en) Development and debugging system, handshake method and device
CN112069008A (en) Equipment debugging information acquisition method and device and equipment debugging information generation method
EP3458967B1 (en) Communication apparatus, communication method, program, and communication system
CN108028767B (en) Method for upgrading adapter, mobile terminal and adapter
CN113626310B (en) Development and debugging system, equipment to be tested and debugging method
CN107819562B (en) Data transmitting/receiving device and data transmitting/receiving method
CN117632166A (en) File burning method, device, equipment and storage medium
US20190146939A1 (en) Communication device, communication method, program, and communication system
CN116647300A (en) SPI-based dynamic length data communication method and data communication system
CN113645093B (en) Equipment to be tested, development and debugging system and communication method
CN108197062B (en) Method, system, equipment and medium for realizing communication between single chip microcomputer and terminal equipment
EP3459189B1 (en) Communication apparatus, communication method, program, and communication system
CN114594973A (en) Chip firmware burning method, device and system and storage medium
KR20190008198A (en) COMMUNICATION DEVICE, COMMUNICATION METHOD, PROGRAM, AND COMMUNICATION SYSTEM
CN115878534A (en) Serial Peripheral Interface (SPI) communication method
CN110492979B (en) Incremental data transmission method and device, slave and storage medium
US11012195B2 (en) Method, sensor, and controller for transmitting a data packet from a sensor to a controller
CN111371799A (en) Method, device and equipment for controlling data transmission and reception of MCTP (Multi-channel media processing protocol) controller
CN104038309A (en) Simulation system communication method and simulation system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant