CN113612565B - Development and debugging system, handshake method and device - Google Patents

Development and debugging system, handshake method and device Download PDF

Info

Publication number
CN113612565B
CN113612565B CN202110780385.8A CN202110780385A CN113612565B CN 113612565 B CN113612565 B CN 113612565B CN 202110780385 A CN202110780385 A CN 202110780385A CN 113612565 B CN113612565 B CN 113612565B
Authority
CN
China
Prior art keywords
slave
host
master
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.)
Active
Application number
CN202110780385.8A
Other languages
Chinese (zh)
Other versions
CN113612565A (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

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

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 computer and a slave computer, and the host computer is in communication connection with the slave computer; the master sends a synchronous trigger signal to the slave; the slave machine sends a synchronous code to the host machine according to the synchronous trigger signal; the synchronous code is obtained according to the clock frequency of the slave; the master obtains the communication frequency of the slave according to the synchronous code; the host computer carries out initialization setting based on the communication frequency and the slave computer; if the initialization setting of the host and the slave is successful, the handshake is confirmed to be successful. The slave computer communication rate is synchronized by the master computer, so that the design of a debugging interface of the slave computer is simple, the occupied area of a 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, handshake 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 handshake method, and an apparatus.
Background
At present, before the master-slave machine communicates, a handshake process is needed, and normal data interaction can be performed after the handshake is successful.
Problems in the prior art:
the existing master-slave handshake flow is mostly a mode of synchronizing the master rate by 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, which can solve the problems of complex hardware design and overlarge occupied area of a slave machine by synchronizing the communication frequency of the slave machine by a host machine.
According to a first aspect of embodiments of the present application, there is provided a development and debugging system, the development and debugging system including a master computer and a slave computer, the master computer being communicatively connected with the slave computer;
the master machine is used for sending a synchronous trigger signal to the slave machine;
the slave is used for sending a synchronous code to the host according to the synchronous trigger signal; 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 host is also used for carrying out initialization setting on the basis of the communication frequency and the slave;
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 embodiments of the present application, there is provided a handshake method applied to a master, the master being communicatively connected to a slave, the method comprising:
sending a synchronous trigger signal to the slave;
receiving a synchronous code sent by the slave according to the synchronous trigger signal; the synchronous code is obtained according to the clock frequency of the slave;
acquiring the communication frequency of the slave according to the synchronous code;
initializing and setting based on the communication frequency and the slave;
if the initialization setting of the host and the slave is successful, the handshake is confirmed to be successful.
According to a third aspect of embodiments of the present application, there is provided a handshake apparatus for application to a master, the master being communicatively connected to a slave, the apparatus comprising:
the sending module is used for sending a synchronous trigger signal to the slave;
the receiving module is used for receiving the synchronous code sent by the slave machine according to the synchronous trigger signal; the synchronous code is obtained according to the 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 performing initialization setting based on the communication frequency and the slave;
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 and debugging system, the handshake method and the device provided by the embodiment of the application, as the host can use a relatively complex design to communicate with the slave, the design of a debugging interface of the slave can be simple by synchronizing the communication rate of the slave by the host, the occupied area of the debugging part of the slave can be reduced, and 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 embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to 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 flow chart of a handshake method according to an embodiment of the present application;
fig. 3 is a flow chart of another handshake method according to an embodiment of the present application;
fig. 4 is a flow chart illustrating a handshake method according to an embodiment of the present application
Fig. 5 is a flow chart of yet another handshake method according to an embodiment of the present application;
fig. 6 is a block diagram of a handshake apparatus according to an embodiment of the present application.
Detailed Description
In the process of realizing the application, the inventor finds that the current master-slave handshake flow is mostly the mode of synchronizing the master rate by the slave, so that the hardware design of the slave is complex, and the design area of the slave is overlarge.
In view of the above problems, in the embodiments of the present application, a development and debugging system, a handshake method and an apparatus are provided, because a host computer can use a relatively complex design to communicate with a slave computer, a debugging interface of the slave computer can be designed simply by synchronizing a communication rate of the slave computer by the host computer, a occupied area of a debugging portion of the slave computer can be reduced, a time sequence can be improved, and verification can be simpler.
The solutions in the embodiments of the present application may be implemented in various computer languages, for example, object-oriented programming language Java, and an transliterated scripting language JavaScript, etc.
In order to make the technical solutions and advantages of the embodiments of the present application more apparent, the following detailed description of exemplary embodiments of the present application is given with reference to the accompanying drawings, and it is apparent that the described embodiments are only some of the embodiments of the present application and not exhaustive of all the embodiments. It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other.
Referring to fig. 1, in order to provide a schematic structural diagram of a development and debugging system 100 according to an embodiment of the present application, the development and debugging system 100 includes a master computer 110 and a slave computer 120, where the master computer 110 is communicatively connected to the slave computer 120.
Before the normal communication between the master 110 and the slave 120, a handshake process is required between the master 110 and the slave 120, and after the handshake is successful, the normal communication between the master 110 and the slave 120 is not performed. The handshake procedure includes synchronization of communication frequencies between the master 110 and the slave 120, and initialization settings between the master 110 and the slave 120.
The working principle of the handshake flow can be as follows: the master machine is used for sending a synchronous trigger signal to the slave machine; the slave is used for sending a synchronous code to the host according to the synchronous trigger signal; the synchronous code is obtained according to the clock frequency of the slave; the host computer is also used for acquiring the communication frequency of the slave computer according to the synchronous code; the host computer is also used for carrying out initialization setting based on the communication frequency and the slave computer; 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 appreciated that the synchronization trigger signal may be a low level of a certain length, or may be a PWM (Pulse Width Modulation ) signal.
If the master 110 sends a synchronization trigger signal to the reset port of the slave 120, in order to avoid false triggering of the reset function, the pulse width length of the synchronization trigger signal should be smaller than that of the reset signal. If the synchronous trigger signal is at a low level, the pulse width length of the trigger signal is one tenth of the pulse width length of the reset signal.
If the debug port of the slave 120 is multiplexed with the reset port, the reset port of the slave 120 can realize the reset function and also realize 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 communication frequency where it is currently located. 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 may be obtained by dividing the frequency according to the clock frequency, and the communication frequency of the slave 120 may be set according to the actual situation.
The host 110 measures the pulse width length of the synchronous 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, which starts counting when the host 110 detects a rising edge of the synchronization code, and stops counting 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 of the timer between the adjacent rising edge and the adjacent falling edge of the synchronous code.
After obtaining the communication frequency of the slave 120, the master 110 may use the communication frequency of the slave 120 to perform data transmission, so as to achieve the consistency of the communication frequency between the master 110 and the slave 120, that is, the master 110 and the slave 120 have achieved physical communication synchronization.
After communication synchronization is achieved between the master 110 and the slave 120, data interaction can be performed between the master 110 and the slave 120 to achieve initialization setting. The principle of implementing initialization setting between the master 110 and the slave 120 may be: the master 110 transmits an information acquisition instruction to the slave 120 based on the communication frequency; the slave 120 feeds back 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 host 110 determines functions supported by the slave 120 according to the feature information of the slave 120, and the host 110 sends instructions according to the functions supported by the slave 120. The feature information includes chip model, core model, and function information of the slave 120.
It should be understood that the master 110 transmits the get information instruction to the slave 120 based on the communication frequency of the slave 120, because the communication frequency of the master 110 transmitting the instruction and the communication frequency of the slave 120, the slave 120 can correctly receive the get information instruction and feed back the characteristic information to the master 110 according to the get information instruction. The feature information includes chip model, core model and function information of the slave 120, and the master 110 can determine functions supported by the slave 120 based on the chip model, core model and function information of the slave 120, and the master 110 transmits corresponding instructions according to the functions supported by the slave 120.
In an alternative embodiment, the master 110 may also send the slave 120 the characteristic information of the master 110. The slave 120 can determine 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 number, a core model number, and function information of the host 110.
The handshake process includes communication frequency synchronization and initialization setting, and before the initialization setting is performed, the communication frequency synchronization needs to be ensured. After the initialization setting is successful, the handshake flow ends.
In the present embodiment, the synchronization function is moved to the host 110 to be implemented, so that the chip area of the slave 120 can be reduced, the timing can be improved, and the verification is simpler.
It should be appreciated that the master 110 may be a burner (e.g., a computer and a debugger), an offline 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 is changed, the communication frequency of the corresponding slave 120 is also changed, and since the master 110 also 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 the case where the communication frequency of the slave 120 is changed, synchronization is maintained between the master 110 and the slave 120. The application also provides a heavy handshake process, and the working principle of the heavy handshake process is as follows: if the clock frequency of the slave machine is changed, the slave machine is also used for sending the updated synchronous code to the host machine; the host computer is also used for acquiring the communication frequency updated by the slave computer according to the updated synchronous code.
It should be appreciated that as the clock frequency of the slave 120 changes, the communication frequency of the slave 120 correspondingly changes. If the communication frequency of the slave 120 is changed, the master 110 performs data interaction with the slave 120 at the communication frequency corresponding to the communication frequency before the clock frequency of the slave 120 is changed, and the communication frequency of the master 110 and the communication frequency of the slave 120 are not consistent, so that the master 110 and the slave 120 are not in a communication synchronization state, and normal communication is not possible between the master 110 and the slave 120. So that after the clock frequency of the slave 120 is changed, the slave 120 actively transmits the updated synchronization code to the master 110.
The host 110 may obtain the updated communication frequency of the slave 120 according to the updated synchronization code, and the host 110 performs data interaction with the slave 120 through the updated communication frequency, so that the communication frequency of the host 110 and the communication frequency of the slave 120 are kept consistent again, and the host 110 and the slave 120 are continuously in a communication synchronization state.
It can be seen that, through the above-mentioned heavy handshake procedure, 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 correspondingly updated. It is ensured that synchronization can be continued between the master 110 and the slave 120 in the case where the communication frequency of the slave 120 is changed.
The slave 120 is further configured to send a frequency change signal to the master 110 before the slave 120 sends the updated synchronization code to the master 110; the master 110 is further configured to stop communication with the slave 120 according to the frequency change signal.
It should be appreciated that the slave 120 may generate the frequency change signal in response to a clock frequency change instruction that the slave 120 generates in response to an external operation, which may be understood as a clock frequency change operation by a worker.
When the slave 120 generates the frequency change signal, the clock frequency of the slave 120 is not changed yet, 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 then sends 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, in order to avoid 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. 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 is newly synchronized with the slave 120, the master 110 resumes communicating with the slave 120.
After the handshake process or the heavy handshake process is finished, the master 110 is further configured to interact data with the slave 120 based on the communication frequency. The content of the data interaction may include an instruction that the host 110 sends a response based on the function supported by the slave 120, where the instruction may be a corresponding function test instruction, a function control instruction, or the like.
In this embodiment, after the handshake process or the heavy handshake process between the master 110 and the slave 120 is finished, the normal communication process between the master 110 and the slave 120 may be: if the debug communication flow is performed between the master 110 and the slave 120, the master 110 sends a debug command to the slave 120; the debugging command comprises verification information and command information; the slave 120 checks whether the check information is correct, 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 reply frame information to the host 110; after receiving the reply frame information, the host 110 checks whether the check information of the reply frame information is correct, if not, the host 110 sends a repeat uploading command to the slave 120, and the slave 120 sends the reply frame information to the host 110 again according to the repeat uploading command; the host 110 again confirms whether the check information of the reply frame information is correct according to the reply frame information sent again by the slave 120, and if not, the host 110 continues to send the repeat uploading command to the slave 120, and repeats the above operation until the number of times that the host 110 continuously sends the repeat uploading command to the slave 120 reaches the preset number of times, or the check information of the reply frame information received by the host 110 is correct.
It should be understood that, if the execution of the command information is completed, the slave 120 may send the reply frame information to the host 110 in the following two ways. One of the modes is as follows: the reply frame information includes acknowledgement information, and if the execution command information is completed and the slave 120 does not need to return the data payload of the host 110, the slave 120 feeds back the acknowledgement information to the host 110. Another way is: the reply frame information includes reply data, and if the execution command information is completed and the slave 120 needs to return to the data payload of the host 110, the slave 120 sends the reply data to the host 110.
The debug command can adopt a coded data format, namely the debug command format can comprise a 1 start bit, an 8 data bit, a 1 odd check bit and a 1 stop bit, command information is arranged in the data bit, and check information is arranged in the odd check bit; if the exclusive OR of the check information and the data bit is 1, the correct check information is represented, and if the exclusive OR of the check information and the data bit is 0, the wrong check information is represented; the command information format may include a command word, a result of a bit-wise reversal of the command word, an optional data payload, and an accumulated checksum; the reply data includes the command word in the command information and the data payload that needs to be returned to the host 110.
The command word contains the following contents: control instructions, setting instructions, reset signals, information acquisition instructions, safety information and communication frequency setting instructions; the control instruction is used for controlling the shutdown, breaking point, writing memory, running program and the like of the control part of the slave 120; the setting instruction includes data such as memory and register values of the data portion of the slave computer 120, so that the master computer 110 can perform functions such as programming and parameter setting on the slave computer 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 work abnormally can be reset in a soft or hard mode and returns to a normal state; the information acquisition instruction is an instruction sent by initializing setting between the host 110 and the slave 120 in the handshake flow, and the host 110 can acquire the hardware model, the core model, the capability and the revision 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 implement an authentication function by exchanging respective preset passwords, that is, may verify whether the host 110 has the right to access the slave 120, and the slave 120 may reject the debug access authorized; 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 under different scenes, so that the stability and the speed of communication are improved; data payload may be understood as the 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 will change, that is, if the slave 120 does not actively send the frequency change signal, the master 110 may actively walk through the handshake process again, so as to avoid an 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 is changed, and send a synchronization trigger signal to the slave 120; the slave 120 is further configured to send an updated synchronization code to the host 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 correspondingly changed, and the master 110 communicates with the slave 120 based on the communication frequency corresponding to the clock frequency of the slave 120 before the change, so that the communication frequency of the master 110 is inconsistent 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 not possible.
In the case that the host 110 and the slave 120 are not in a communication synchronization state, the interaction data fed back from the slave 120 to the host 110 may have a phenomenon of timeout or error; that is, if the master 110 does not receive the interaction data fed back by the slave 120 within the preset time, or receives the wrong interaction data fed back by the slave 120 within the preset time; the master 110 determines that the clock frequency of the slave 120 has changed, and resends the synchronization trigger signal to the slave 120 to resume the handshake process, so as to complete synchronization between the master 110 and the slave 120.
The slave 120 re-transmits the updated synchronization code to the master 110 according to the synchronization trigger signal transmitted from the master 110, and the updated synchronization code is obtained according to the clock frequency changed by the slave 120. That is, since the communication frequency of the slave 120 is generated according to the clock frequency of the slave 120, when the clock frequency of the slave 120 is changed, the communication frequency of the slave 120 is also changed, and thus the synchronization code transmitted from the slave 120 to the master 110 at the changed communication frequency is also changed.
Since the slave 120 transmits 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 frequency of the master 110 and the slave 120 are kept consistent, and the communication synchronization between the master 110 and the slave 120 is completed again.
Referring to fig. 2, fig. 2 is a handshake method according to the embodiment of the present application, which is based on the host 110 shown in fig. 1, and the handshake method may include the following steps:
s201, sending a synchronous trigger signal to the slave.
If the master 110 sends a synchronization trigger signal to the reset port of the slave 120, in order to avoid false triggering of the reset function, the pulse width length of the synchronization trigger signal should be smaller than that of the reset signal. If the synchronous trigger signal is at a low level, the pulse width length of the trigger signal is one tenth of the pulse width length of the reset signal.
It should be understood that if the debug port of the slave 120 is multiplexed with the reset port, the reset port of the slave 120 can implement the reset function as well as the debug function.
S202, the receiving slave receives the synchronous code sent by the synchronous trigger signal.
Wherein the synchronization code is obtained from the clock frequency of the slave 120.
S203, the communication frequency of the slave is acquired according to the synchronous code.
It should be appreciated that the host 110 measures the pulse width length of the resulting synchronization code; the master 110 obtains the communication frequency of the slave 120 according to the pulse width length of the synchronization code.
S204, carrying out initialization setting based on the communication frequency and the slave.
S205, if the initialization setting of the host and the slave is successful, the handshake is confirmed to be successful.
It should be appreciated that the handshake procedure includes communication frequency synchronization and initialization settings, where communication frequency synchronization is guaranteed prior to the initialization settings. After the initialization setting is successful, the handshake flow ends.
If the communication frequency is not synchronized or the initialization setting is unsuccessful, indicating that the handshake is failed, 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 handshake flow can be confirmed to be ended. If the communication frequency is not synchronized or the initialization setting is unsuccessful after the preset execution times are exceeded, the handshake flow is confirmed to be failed.
To facilitate understanding how the initialization setting is implemented between the master 110 and the slave 120, please refer to fig. 3, the step S204 includes the following sub-steps:
and S204a, sending an information acquisition instruction to the slave machine based on the communication frequency.
S204b, the receiving slave receives the characteristic information fed back by the information acquisition instruction.
S204c, carrying out initialization setting according to the characteristic information.
It should be understood that the master 110 transmits the get information instruction to the slave 120 based on the communication frequency of the slave 120, because the communication frequency of the master 110 transmitting the instruction and the communication frequency of the slave 120, the slave 120 can correctly receive the get information instruction and feed back the characteristic information to the master 110 according to the get information instruction. The feature information includes chip model, core model and function information of the slave 120, and the master 110 can determine functions supported by the slave 120 based on the chip model, core model and function information of the slave 120, and the master 110 transmits corresponding instructions according to the functions supported by the slave 120.
In an alternative embodiment, since the clock frequency of the slave 120 is changed, the communication frequency of the corresponding slave 120 is also changed, and since the master 110 also 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 the case where the communication frequency of the slave 120 is changed, synchronization is maintained between the master 110 and the slave 120. The application further proposes a heavy handshake process, referring to fig. 4, the handshake method further includes the following steps:
s208, if the clock frequency of the slave is changed, the updated synchronous code sent by the slave is received.
It should be appreciated that as the clock frequency of the slave 120 changes, the communication frequency of the slave 120 correspondingly changes. If the communication frequency of the slave 120 is changed, the master 110 performs data interaction with the slave 120 at the communication frequency corresponding to the communication frequency before the clock frequency of the slave 120 is changed, and the communication frequency of the master 110 and the communication frequency of the slave 120 are not consistent, so that the master 110 and the slave 120 are not in a communication synchronization state, and normal communication is not possible between the master 110 and the slave 120. So that after the clock frequency of the slave 120 is changed, the slave 120 actively transmits the updated synchronization code to the master 110.
S209, the communication frequency updated by the slave is obtained according to the updated synchronous code.
It should be understood that, the host 110 may obtain the updated communication frequency of the slave 120 according to the updated synchronization code, and the host 110 performs data interaction with the slave 120 through the updated communication frequency, so that the communication frequency of the host 110 and the communication frequency of the slave 120 are kept consistent again, and the host 110 and the slave 120 are continuously in a communication synchronization state.
It can be seen that, with the contents of S208 and S209 described above, when the clock frequency of the slave 120 is changed, 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 is ensured that synchronization can be continued between the master 110 and the slave 120 in the case where the communication frequency of the slave 120 is changed.
With continued reference to fig. 4, before S208, the handshake method further includes the following steps:
s206, receiving the frequency change signal sent by the slave.
It should be appreciated that the slave 120 may generate the frequency change signal in response to a clock frequency change instruction that the slave 120 generates in response to an external operation, which may be understood as a clock frequency change operation by a worker.
When the slave 120 generates the frequency change signal, the clock frequency of the slave 120 is not changed yet, 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 then sends the frequency change signal to the master 110 before the clock frequency of the slave 120 is changed.
S207, stopping communication with the slave according to the frequency change signal.
It should be appreciated that since the clock frequency of the slave 120 will change, communication failures occur due to the change in the clock frequency of the slave 120 in order to avoid data interaction between the master 110 and the slave 120. 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 is newly synchronized with the slave 120, the master 110 resumes communicating with the slave 120.
Referring to fig. 5, the handshake method further includes the following steps:
s210, carrying out data interaction with the slave machine based on the communication frequency.
It should be appreciated that after the handshake process or the re-handshake process of the master 110 and the slave 120 is completed, that is, after the communication frequency synchronization and initialization of 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 an instruction that the host 110 sends a response based on the function supported by the slave 120, where the instruction may be a corresponding function test instruction, a function control instruction, or the like.
With reference to fig. 5, if the slave 120 does not know that the clock frequency will change, that is, if the slave 120 does not actively transmit the frequency change signal, the following steps can be adopted to avoid the phenomenon that the communication between the master 110 and the slave 120 is not synchronized.
S211, if the interaction data fed back from the slave machine to the host machine is overtime or wrong, judging that the clock frequency of the slave machine is changed, and sending a synchronous trigger signal to the slave machine.
It should be understood that if the clock frequency of the slave 120 is changed, the communication frequency of the slave 120 is correspondingly changed, and the master 110 communicates with the slave 120 based on the communication frequency corresponding to the clock frequency of the slave 120 before the change, so that the communication frequency of the master 110 is inconsistent 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 not possible.
In the case that the host 110 and the slave 120 are not in a communication synchronization state, the interaction data fed back from the slave 120 to the host 110 may have a phenomenon of timeout or error; that is, if the master 110 does not receive the interaction data fed back by the slave 120 within the preset time, or receives the wrong interaction data fed back by the slave 120 within the preset time; the master 110 determines that the clock frequency of the slave 120 has changed, and resends the synchronization trigger signal to the slave 120 to resume the handshake process, so as to complete synchronization between the master 110 and the slave 120.
S212, the receiving slave receives the updated synchronous code sent by the synchronous trigger signal.
It should be appreciated that the slave 120 re-transmits the updated synchronization code to the master 110 according to the synchronization trigger signal transmitted from 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, when the clock frequency of the slave 120 is changed, the communication frequency of the slave 120 is also changed, and thus the synchronization code transmitted from the slave 120 to the master 110 at the changed communication frequency is also changed.
S213, the communication frequency updated by the slave is obtained according to the updated synchronous code.
It should be appreciated that since the slave 120 transmits 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 frequency of the master 110 and the slave 120 are kept consistent, and the communication synchronization between the master 110 and the slave 120 is completed again.
In order to implement the above-mentioned handshaking methods corresponding to S201 to S213 and possible substeps thereof, the embodiment of the present application provides a handshaking device, please refer to fig. 6, fig. 6 is a block schematic diagram of a handshaking device 300 provided in the embodiment of the present application, and the handshaking device 300 includes: a transmitting 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 the frequency change signal sent by 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 120 according to the synchronization trigger signal.
The acquisition module 330 is configured to acquire the communication frequency of the slave 120 according to the synchronization code.
The initialization setting module 340 is configured to perform initialization setting based on the communication frequency and the slave 120.
The confirmation module 350 is configured to confirm that the handshake is successful if the initialization settings of the master 110 and the slave 120 are successful.
The processing module 360 is configured to stop communication 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 interact 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 judged to be changed, and a synchronous trigger signal is sent to the slave 120.
It should be appreciated that the sending module 310, the receiving module 320, the obtaining module 330, the initialization setting module 340, the confirmation module 350 and the processing module 360 may cooperatively implement the above-described S201 to S213 and possible sub-steps thereof.
In summary, the present application provides a development and debugging system, a handshake method and an apparatus, where the handshake method includes: the master sends a synchronous trigger signal to the slave; the slave machine sends a synchronous code to the host machine according to the synchronous trigger signal; the synchronous code is obtained according to the clock frequency of the slave; the master obtains the communication frequency of the slave according to the synchronous code; the host computer carries out initialization setting based on the communication frequency and the slave computer; if the initialization setting of the host and the slave is successful, the handshake is confirmed to be successful. Because the host computer can use the relatively complex design to communicate with the slave computer, the design of the debugging interface of the slave computer can be simplified by synchronizing the communication rate of the slave computer by the host computer, the occupied area of the debugging part of the slave computer can be reduced, and the time sequence can be improved and the verification can be simpler.
It will be appreciated by those skilled in the art that 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 flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations 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 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. It is therefore intended that the following claims be interpreted as including the preferred embodiments and all such alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present application without departing from the spirit or scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to cover such modifications and variations.

Claims (14)

1. The development and debugging system is characterized by comprising a host computer and a slave computer, wherein the host computer is in communication connection with the slave computer;
the master machine is used for sending a synchronous trigger signal to the slave machine;
the slave is used for sending a synchronous code to the host according to the synchronous trigger signal; 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 host is also used for carrying out initialization setting on the basis of the communication frequency and the slave;
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 the slave is further configured to send an updated synchronization code to the master if the clock frequency of the slave changes;
the host is also used for acquiring the communication frequency updated by 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 is also used for stopping communication with the slave according to the frequency change signal.
4. A development and debugging system according to any one of claims 1-3, wherein the host is further configured to measure the pulse width length of the synchronization code;
the master is also used for obtaining the communication frequency of the slave according to the pulse width length of the synchronous code.
5. A development and debug system according to any of claims 1-3, wherein said host is further configured to send an instruction to obtain information to said slave based on said communication frequency;
the slave is also used for feeding back characteristic information to the host according to the information acquisition instruction; the characteristic information comprises the chip model, the core model and the function information of the slave;
the host is also used for carrying out initialization setting according to the characteristic information.
6. A development and debug system according to any of claims 1-3, wherein said master is further configured to interact with said slaves based on said communication frequency.
7. The development and debugging system of claim 6, wherein if the interaction data fed back by the slave to the master is overtime or wrong, 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 is also used for sending updated synchronous codes to the host according to the synchronous trigger signal;
the host is also used for acquiring the communication frequency updated by the slave according to the updated synchronous code.
8. The development and debugging system of claim 1, wherein if the master sends a synchronization trigger signal to the reset port of the slave, the pulse width length of the synchronization trigger signal is smaller than the pulse width length of the reset signal.
9. A method of handshaking, the method being applied to a host, the host being communicatively coupled to a slave, the method comprising:
sending a synchronous trigger signal to the slave;
receiving a synchronous code sent by the slave according to the synchronous trigger signal; the synchronous code is obtained according to the clock frequency of the slave;
acquiring the communication frequency of the slave according to the synchronous code;
initializing and setting based on the communication frequency and the slave;
if the initialization setting of the host and the slave is successful, the handshake is confirmed to be 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 the updated synchronous code sent by the slave machine;
and acquiring the communication frequency updated by the slave according to the updated synchronous code.
11. The method of claim 10, wherein prior to the step of receiving the updated synchronization code transmitted 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 according to the frequency change signal.
12. The method according to any one of claims 9-11, wherein the step of obtaining the communication frequency of the slave according to the synchronization code comprises:
measuring and obtaining 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-11, wherein the step of initializing the setting with the slave based on the communication frequency comprises:
transmitting an information acquisition instruction to the slave machine based on the communication frequency;
receiving characteristic information fed back by the slave according to the information acquisition instruction; the characteristic information comprises the chip model, the core model and the function information of the slave;
and carrying out initialization setting according to the characteristic information.
14. A handshaking device, the device being for use with a host, the host being 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 the synchronous code sent by the slave machine according to the synchronous trigger signal; the synchronous code is obtained according to the 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 performing initialization setting based on the communication frequency and the slave;
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 CN113612565A (en) 2021-11-05
CN113612565B true 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)

Families Citing this family (1)

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

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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 珠海优特电力科技股份有限公司 A kind of method and system of master-slave equipment communication
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AT408383B (en) * 2000-05-04 2001-11-26 Fts Computertechnik Gmbh METHOD AND COMMUNICATION CONTROL UNIT FOR THE MULTIMASTER WATCH SYNCHRONIZATION IN A DISTRIBUTED REAL-TIME COMPUTER SYSTEM

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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 珠海优特电力科技股份有限公司 A kind of method and system of master-slave equipment communication
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
二乘二取二系统的同步表决安全机制研究;陈梅;汪月乾;张永贤;郭凯;;单片机与嵌入式系统应用(第03期);全文 *

Also Published As

Publication number Publication date
CN113612565A (en) 2021-11-05

Similar Documents

Publication Publication Date Title
US20100095159A1 (en) Apparatus and method for automatic testing of software or digital devices
CN104155972B (en) Mechanical engineering electronic controller parameter debugging method
CN108279910B (en) Program code programming method and device, computer equipment and storage medium
CN111930406B (en) Vehicle-mounted terminal micro control unit software upgrading method, electronic equipment and storage medium
CN113612565B (en) Development and debugging system, handshake method and device
CN105511929A (en) Remote wireless upgrading method for equipment
CN105786753A (en) Method and device for data transmission between master and slave devices on I2C bus
CN107690759B (en) Optical module, optical module system and monitoring method of optical module
CN110780909A (en) Distributed embedded system upgrading method and device
CN111104139A (en) Firmware upgrading method, device, equipment and storage medium
CN114860279B (en) Rapid empty-chip upgrading method
EP3458967B1 (en) Communication apparatus, communication method, program, and communication system
CN112069008A (en) Equipment debugging information acquisition method and device and equipment debugging information generation method
CN108028767B (en) Method for upgrading adapter, mobile terminal and adapter
CN113626310B (en) Development and debugging system, equipment to be tested and debugging method
KR20150004232A (en) Watchdog apparatus and the controlling method thereof
US20190146939A1 (en) Communication device, communication method, program, and communication system
KR20190113772A (en) Communication device, communication method, program and communication system
CN113645093B (en) Equipment to be tested, development and debugging system and communication method
EP3459189B1 (en) Communication apparatus, communication method, program, and communication system
CN107870776B (en) IPMC online upgrading method and device
CN112181461B (en) Upgrading method, network module, equipment, server and upgrading system
KR20190008198A (en) COMMUNICATION DEVICE, COMMUNICATION METHOD, PROGRAM, AND COMMUNICATION SYSTEM
CN104038309A (en) Simulation system communication method and simulation system
CN113556210A (en) Upper computer and method for establishing communication connection

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