CN115599408B - Data burning method, equipment and storage medium of processor - Google Patents

Data burning method, equipment and storage medium of processor Download PDF

Info

Publication number
CN115599408B
CN115599408B CN202211507876.6A CN202211507876A CN115599408B CN 115599408 B CN115599408 B CN 115599408B CN 202211507876 A CN202211507876 A CN 202211507876A CN 115599408 B CN115599408 B CN 115599408B
Authority
CN
China
Prior art keywords
data
processor
burning
serial port
byte
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
CN202211507876.6A
Other languages
Chinese (zh)
Other versions
CN115599408A (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.)
Shenzhen Kaihong Digital Industry Development Co Ltd
Original Assignee
Shenzhen Kaihong Digital Industry Development 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 Shenzhen Kaihong Digital Industry Development Co Ltd filed Critical Shenzhen Kaihong Digital Industry Development Co Ltd
Priority to CN202211507876.6A priority Critical patent/CN115599408B/en
Publication of CN115599408A publication Critical patent/CN115599408A/en
Application granted granted Critical
Publication of CN115599408B publication Critical patent/CN115599408B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • G06F8/63Image based installation; Cloning; Build to order
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/24Resetting means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application relates to the technical field of computers and provides a data burning method, equipment and a computer storage medium of a processor, wherein the method comprises the steps of obtaining first byte data in a serial port receiving buffer area; acquiring burning signal data; checking the first byte data according to the burning signal data; based on the verification result, judging whether the data in the serial port receiving buffer area is the burning signal data or not; and if the data in the serial port receiving buffer area is the burning signal data, controlling the processor to reset and executing data burning. The programming request signal is identified by using the algorithm, so that the processor is automatically reset, the switching between the bootstrap program and the application program is realized, the programming operation flow is simplified, the programming efficiency is improved, and the user experience is improved.

Description

Data burning method, equipment and storage medium of processor
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a data burning method, apparatus, and storage medium for a processor.
Background
Currently, electronic devices are generally controlled by a processor, such as an MCU (Micro Controller Unit, micro control unit), which is also called a single-chip microcomputer or a single-chip microcomputer, and is a chip-level processor. The MCU product is burnt with a guide program and an application program, the guide program is responsible for starting and refreshing the application program, the application program is responsible for realizing the actual function of the product, and the application program needs to be burnt again after the application program is debugged and upgraded for a plurality of times in the development period of the MCU product.
Because the application program needs to be re-burned, if the running program is the application program during burning, a developer is required to operate a RESET button on the development board, so that the running program on the development board is switched from the application program to the guide program, the burning efficiency is reduced, the operation complexity of the developer is increased, and the large-scale burning test of the developer is not facilitated.
Disclosure of Invention
The main purpose of the present application is to provide a data recording method, device and storage medium for a processor, which aims to identify a recording request signal by using an algorithm, and then automatically reset the processor, so as to realize the switching between a bootstrap program and an application program, simplify the recording operation flow, improve the recording efficiency, and improve the user experience.
In a first aspect, the present application provides a data writing method of a processor, where the data writing method of the processor includes the following steps:
acquiring first byte data in a serial port receiving buffer area;
acquiring burning signal data;
checking the first byte data according to the burning signal data;
based on the verification result, judging whether the data in the serial port receiving buffer area is the burning signal data or not;
and if the data in the serial port receiving buffer area is the burning signal data, controlling the processor to reset and executing data burning.
In a second aspect, the present application also provides a computer device comprising a memory and a processor;
the memory is used for storing a computer program;
the processor is configured to execute the computer program and implement the data burning method of the processor provided by any one of the embodiments of the present application when the computer program is executed.
In a third aspect, the present application further provides a computer readable storage medium, where a computer program is stored, where the computer program when executed by a processor causes the processor to implement a data burning method of the processor provided in any one of the embodiments of the present application.
The application provides a data burning method, equipment and a computer readable storage medium of a processor, wherein the method comprises the steps of obtaining first byte data in a serial port receiving buffer area; acquiring burning signal data; checking the first byte data according to the burning signal data; based on the verification result, judging whether the data in the serial port receiving buffer area is the burning signal data or not; and if the data in the serial port receiving buffer area is the burning signal data, controlling the processor to reset and executing data burning. The programming request signal is identified by using the algorithm, so that the processor is automatically reset, the switching between the bootstrap program and the application program is realized, the programming operation flow is simplified, the programming efficiency is improved, and the user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a data burning method of a processor according to an embodiment of the present application;
FIG. 2 is a flowchart of a data recording method of a processor according to another embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a recording signal of a processor according to an embodiment of the present disclosure;
FIG. 4 is a flowchart illustrating another data recording method of a processor according to an embodiment of the present disclosure;
fig. 5 is a schematic block diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The flow diagrams depicted in the figures are merely illustrative and not necessarily all of the elements and operations/steps are included or performed in the order described. For example, some operations/steps may be further divided, combined, or partially combined, so that the order of actual execution may be changed according to actual situations.
The term "and/or" as used in this specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
Some embodiments of the present application are described in detail below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a schematic flowchart of a data burning method of a processor according to an embodiment of the present application.
When a user sends a command for calling the development board of the burning tool, the burning tool can transmit a signal for preparing burning to the development board through a serial port. If the program operated by the development board is a guide program, the guide program sends a signal ready for recording to the recording tool through the serial port after receiving the signal, and the recording tool sends an application program data packet to the development board after receiving the signal to perform data recording work.
If the program operated by the development board is an application program, the application program can not execute data burning work after receiving the signal, and the operation authority is required to be given to the guide program; when the signal ready for burning is not received by the burning tool within the preset time, the signal ready for burning is transmitted to the development board again through the serial port, at this time, the program operated by the development board is switched to the guiding program, after the guiding program receives the signal, the signal ready for burning is sent to the burning tool through the serial port, and after the signal is received by the burning tool, an application program data packet is sent to the development board to perform data burning work.
Referring to fig. 2, fig. 2 is a schematic flowchart of a data burning method of another processor according to an embodiment of the present application. The data burning method of the processor can be used for receiving the first byte data in the buffer area through the acquired serial port; acquiring burning signal data; checking the first byte data according to the burning signal data; based on the verification result, judging whether the data in the serial port receiving buffer area is the burning signal data or not; and if the data in the serial port receiving buffer area is the burning signal data, controlling the processor to reset and executing data burning. The programming request signal is identified by using the algorithm, so that the processor is automatically reset, the switching between the bootstrap program and the application program is realized, the programming operation flow is simplified, the programming efficiency is improved, and the user experience is improved.
As shown in fig. 2, the data burning method of the processor includes steps S101 to S105.
S101, acquiring first byte data in a serial port receiving buffer area.
The serial port receiving buffer area is a buffer space for receiving data in the serial port.
It should be noted that, the serial port is a serial interface, also called a serial communication interface or a serial communication interface, and refers to a serial communication interface that sequentially transmits data bit by bit, and is characterized in that the serial port transmits and receives bytes according to bits (bits). When used in serial ports, the serial port generally includes two buffers, namely a transmit buffer and a receive buffer. When transmitting data, the data is stored in a transmission buffer area and then transmitted through a serial port; when receiving data, the received data is stored in a receiving buffer area, and then is read. Due to the limitation of the serial communication mode, a buffer space is needed for buffering the data to ensure the integrity of the data.
The first byte of data is one byte of data in the serial port receive buffer, and it is understood that the data location of the first byte of data is at the first bit of the sequential transfer in the serial port receive buffer.
Specifically, one byte of data in the serial port receiving buffer is obtained as first byte data for verification with the recording signal data.
In some embodiments, the acquiring the first byte of data in the serial port receiving buffer includes: receiving signals of the serial port receiving buffer area through an interrupt receiving function; if the interrupt receiving function receives an interrupt signal sent by the serial port receiving buffer zone, calling an interrupt processing function, wherein the interrupt signal is a signal generated when the serial port receiving buffer zone is not empty; and accessing the serial port receiving buffer area through the interrupt processing function to acquire the first byte data.
Specifically, when data exists in the serial port receiving buffer, an interrupt signal is generated, and when the interrupt receiving function receives the interrupt signal, the interrupt processing function is mobilized to access the serial port receiving buffer, so that first byte data in the serial port receiving buffer is obtained.
It should be appreciated that since the interrupt handling function only obtains one byte of data at a time, the serial receive buffer remains non-empty until the data in the serial receive buffer is completely obtained by the interrupt handling function, and an interrupt signal is generated every time a period of time.
In some embodiments, the burning method of the processor further includes: the first byte data is stored in a first variable.
Specifically, after the interrupt function obtains the first byte data, the data is temporarily stored in the first variable, so as to prepare for the subsequent identification of whether the first byte data is the recording signal data.
S102, acquiring burning signal data.
Specifically, in order to check whether the data in the serial port receiving buffer is the recording signal data, it is necessary to obtain the data corresponding to the recording signal sent by the recording tool, as the recording signal data, the data may be fixed and composed of 8 bytes of data, as shown in fig. 3, and the data is the recording signal data, specifically including "0×05, 0×0A, 0×01, 0×00, 0×08, 0×27".
S103, checking the first byte data according to the burning signal data.
Specifically, in order to identify the recording signal, the processor is further reset, and the first byte data is verified according to the data of the recording signal data.
In some embodiments, in order to obtain an accurate verification result, before the verifying the first byte data according to the recording signal data, the method further includes: acquiring a second variable, wherein the second variable is used for recording the number of continuous pass of byte verification; and determining second byte data in the burning signal data based on the second variable, wherein the second byte data is used for checking the first byte data.
The second byte data is one byte data in the burning signal data.
It should be understood that, since the recording signal data is composed of 8 byte data, and the interrupt processing function only obtains one byte data at a time, and only 8 consecutive passes of the check can confirm that the data in the serial port receiving buffer is the recording signal data, the second variable is required to record the number of times of the check passing continuously, thereby resetting the control process when 8 consecutive passes of the check are passed. Wherein the second byte data used to check the first byte data may also be different depending on the number of consecutive passes of the check. Therefore, the second byte data corresponding to the first byte data to be checked currently needs to be determined according to the value of the second variable, so as to obtain an accurate checking result.
For example, when the check is performed twice, the second variable is 2, as shown in fig. 3, and the corresponding second byte data is "0×0a", and if the first byte data matches the second byte data, the check is performed three times, and the value of the second variable is 3, as shown in fig. 3, the corresponding second byte data is "0×0a", and at this time, the second byte data used for checking the first byte data in the two checks is the same. For another example, when the check is performed three times in succession, the second variable is 3, as shown in fig. 3, the corresponding second byte data is "0×0a", and if the first byte data matches the second byte data, the check is performed four times in succession, the value of the second variable is 4, as shown in fig. 3, the corresponding second byte data is "0×01", and at this time, the second byte data used for checking the first byte data in the two checks are not identical.
In some embodiments, to accurately verify the first byte data, the determining the second byte data within the burn signal data based on the second variable includes: acquiring the value of the second variable; increasing the value of the second variable by 1 to obtain sequential numbers; and acquiring byte data at a corresponding position in the burning signal based on the sequence number to serve as the second byte data.
Specifically, the value of the second variable represents the number of continuous byte verification passing, and as the value of the second variable increases, the position of the second byte data used for verifying the first byte data in the recording signal data also changes, and the value increase 1 of the second variable is the sequential number of the bytes of the second byte data in the recording signal data, and the byte data in the corresponding position in the recording signal is searched according to the sequential number and is used as the second byte data.
For example, when the value of the second variable is 1, the second verification is performed after the first verification, and the value of the second variable is increased by 1, so as to obtain that the sequential number of the bytes of the second byte data in the recording signal data is 2, as shown in fig. 3, the byte data with the sequential number of 2 in the recording signal data is "0×05", and the second byte data is "0×05".
In some embodiments, the verifying the first byte data according to the programming signal data includes: if the first byte data is matched with the second byte data, checking is passed, and the value of the second variable is increased by 1; if the first byte data is not matched with the second byte data, checking is failed, and the value of the second variable is reset to 0.
Specifically, if the first byte data is the same as the second byte data, the matching is performed, the verification is passed, the value of the second variable is increased by 1, if the first byte data is different from the second byte data, the matching is not performed, the verification is not passed, and the value of the second variable is reset to 0.
It should be appreciated that since the second variable is used to record the number of consecutive passes of the check, when the first byte data does not match the second byte data, i.e., the requirement for consecutive passes of the check is no longer met, the value of the second variable is reset to 0.
For example, when the second variable is 1, the second check is performed now after the first check, and the second byte data is "0×05", and if the first byte data is also "0×05", the first byte data is identical to the second byte data, and the first byte data matches the second byte data, the check is passed, the value of the second variable is increased by 1, and the value of the second variable becomes 2.
For another example, when the second variable is 1, the second check is performed now after the first check, and the second byte data is "0×05", and if the first byte data is "0×0A" and is different from the second byte data, the first byte data and the second byte data do not match, the check is failed, and the value of the second variable is reset to 0.
And S104, judging whether the data in the serial port receiving buffer area is the burning signal data or not based on the verification result.
Specifically, the first byte data is checked according to the recording signal data, when the first byte data is matched with the recording signal data, the bytes are matched with the recording signal, and the numerical value of the second variable meets the preset condition, the data in the serial port receiving buffer area is the recording signal data; otherwise, the data in the serial port receiving buffer area is not the burning signal data.
In some embodiments, the determining whether the data in the serial port receiving buffer is the recording signal data based on the verification result includes: when the value of the second variable is equal to 8, the data in the serial port receiving buffer area is the burning signal data.
Specifically, the data in the serial port receiving buffer area is checked with the burning signal data for multiple times, and only when the data passes the check for 8 times continuously, the data in the serial port receiving buffer area can be confirmed to be the burning signal data. Because the second variable is used for recording the continuous passing times of the verification, if the value of the second variable is equal to 8, the continuous 8 times of the verification are passed, and the data in the serial port receiving buffer area can be determined to be the burning signal data; if the value of the second variable is less than 8 and the serial port receiving buffer area does not generate the interrupt signal any more, the data in the serial port receiving buffer area is not the burning signal data. If the value of the second variable is smaller than 8 and the serial port receiving buffer area continues to generate the interrupt signal, the recording signal data is not checked at present, and the checking is continued.
It should be understood that, the preset condition that the verification result meets may be determined according to the accuracy requirement of the user on the verification, and when the value of the second variable is equal to 8, determining that the data in the serial port receiving buffer area is the recording signal data is only one embodiment. Because the burning tool does not receive the signal ready for burning within the preset time, the signal ready for burning is transmitted to the development board again through the serial port, and in order to improve the accuracy of verification, the preset condition can be set to be that the value of the second variable is equal to 8 for a plurality of times within the preset time period, which is not limited herein.
S105, if the data in the serial port receiving buffer area is the burning signal data, the processor is controlled to reset, and data burning is executed.
Specifically, if the data in the serial port receiving buffer area is the recording signal data, it is determined that the recording tool sends the recording signal, and the processor is controlled to reset. At this time, the guiding program operated by the development board can receive the recording signal sent by the recording tool, and send the signal ready for recording to the recording tool through the serial port, after the recording tool receives the signal, the application program data packet is sent to the development board, and the guiding program starts to perform data recording work.
In some embodiments, the controlling the processor reset comprises: calling a reset function to reset the processor; and switching the running program from the application program to the bootstrap program based on the reset operation.
Specifically, the RESET function is called to RESET the processor, so that the RESET button on the development board is manually touched by a user to RESET the processor is replaced, the burning operation flow is simplified, the burning efficiency is improved, and meanwhile, the user experience is improved. After the reset operation, the application program gives the operation permission to the guide program, and the guide program sends a signal ready for recording to the recording tool through the serial port, so that the recording work can be started.
Referring to fig. 4, fig. 4 is a flowchart of another data recording method of a processor according to an embodiment of the present disclosure.
In some embodiments, since the interrupt processing function can only acquire one byte of data at a time, the identification of the recording signal data requires checking the data in the serial port receiving buffer with the recording signal data multiple times, and the multiple checking flow is shown in fig. 4.
The method comprises the steps that firstly, an interrupt processing function is called to obtain first byte data based on an interrupt signal sent by a serial port receiving buffer area; step two, judging whether the first byte data is matched with the corresponding second byte data, and returning to the step one if the first byte data is not matched with the corresponding second byte data; and thirdly, if the values are matched, judging the values of the second variables, if the values of the second variables are equal to 8, resetting the processor, and if the values of the second variables are not equal to 8, returning to the first step.
For example, based on an interrupt signal sent by a serial port receiving buffer, calling an interrupt processing function to acquire first byte data; judging whether the first byte data is matched with the corresponding second byte data, if the first byte data is not matched with the corresponding second byte data, resetting the value of the second variable to 0; returning to the first step, waiting to receive the interrupt signal sent by the serial port receiving buffer again; when the serial port receiving buffer area is received again and an interrupt signal is sent out, an interrupt processing function is called to acquire new first byte data; and judging whether the new first byte data is matched with the corresponding second byte data.
It should be understood that, after the new first byte data is obtained, since the second variable is reset to 0 at this time, the sequence data of the new first byte data and the corresponding second byte data is 1, and at this time, the first byte of the recording signal data is recognized again, as shown in fig. 3, and at this time, the corresponding second byte data is "0×05".
For example, based on an interrupt signal sent by a serial port receiving buffer, calling an interrupt processing function to acquire first byte data; judging whether the first byte data is matched with the corresponding second byte data, and if the first byte data is matched with the corresponding second byte data, adding 1 to the value of the second variable; judging whether the value of the second variable is equal to 8; if the value of the second variable is not equal to 8, returning to the first step, and waiting for the serial port receiving buffer area to send out an interrupt signal again; when the serial port receiving buffer area is received again and an interrupt signal is sent out, an interrupt processing function is called to acquire new first byte data; and judging whether the new first byte data is matched with the corresponding second byte data.
It should be appreciated that as the value of the second variable increases by 1, the progress of verification of the recording signal data increases. For example, when the value of the second variable is 3, as shown in fig. 3, the corresponding second byte data is "0×0a", and if the first byte data matches the second byte data, the value of the second variable is increased by 1, and the value of the second variable is 4, as shown in fig. 3, the corresponding second byte data is "0×01".
In some embodiments, the first byte data is obtained, it is determined whether the first byte data matches the corresponding second byte data, if the first byte data matches the corresponding second byte data, the value of the second variable is added with 1, at this time, it is determined whether the value of the second variable is equal to 8, if the value of the second variable is equal to 8, the verification is continuously passed for 8 times, it is determined that the data in the serial port receiving buffer is the recording signal data, and the processor is reset.
It should be understood that this process is repeated until the value of the second variable is equal to 8, and the first byte data in the serial port receiving buffer is acquired and checked multiple times, until the value of the second variable is equal to 8, the processor is reset, and the switching between the boot program and the application program is implemented. The accuracy of the burning signal identification is improved, the burning operation flow is simplified, the burning efficiency is improved, and the user experience is improved.
By way of example, the above-described method may be implemented in the form of a computer program that is executable on a computer device as shown in fig. 5.
Referring to fig. 5, fig. 5 is a schematic diagram of a computer device according to an embodiment of the present application. The computer device may be a terminal device, such as a cell phone, tablet computer, or wearable device, etc.
As shown in fig. 5, the computer device includes a processor, a memory, and a network interface connected by a system bus, wherein the memory may include a volatile storage medium, a non-volatile storage medium, and an internal memory.
The non-volatile storage medium may store an operating system and a computer program. The computer program comprises program instructions which, when executed, cause the processor to perform any of the methods of data burning for the processor.
The processor is used to provide computing and control capabilities to support the operation of the entire computer device.
The internal memory provides an environment for the execution of a computer program in a non-volatile storage medium, which when executed by a processor, causes the processor to perform any of the data burning methods of the processor.
The network interface is used for network communication such as transmitting assigned tasks and the like. It will be appreciated by those skilled in the art that the structure of the computer device is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or less components than those shown, or may combine some of the components, or have a different arrangement of components.
It should be appreciated that the processor may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Wherein in some embodiments the processor is configured to run a computer program stored in the memory to implement the steps of:
acquiring first byte data in a serial port receiving buffer area;
acquiring burning signal data;
checking the first byte data according to the burning signal data;
based on the verification result, judging whether the data in the serial port receiving buffer area is the burning signal data or not;
and if the data in the serial port receiving buffer area is the burning signal data, controlling the processor to reset and executing data burning.
In some embodiments, the processor is further configured to: receiving signals of the serial port receiving buffer area through an interrupt receiving function; if the interrupt receiving function receives an interrupt signal sent by the serial port receiving buffer zone, calling an interrupt processing function, wherein the interrupt signal is a signal generated when the serial port receiving buffer zone is not empty; and accessing the serial port receiving buffer area through the interrupt processing function to acquire the first byte data.
In some embodiments, the processor is further configured to: the first byte data is stored in a first variable.
In some embodiments, the processor is further configured to: acquiring a second variable, wherein the second variable is used for recording the number of continuous pass of byte verification; and determining second byte data in the burning signal data based on the second variable, wherein the second byte data is used for checking the first byte data.
In some embodiments, the processor is further configured to: acquiring the value of the second variable; increasing the value of the second variable by 1 to obtain sequential numbers; and acquiring byte data at a corresponding position in the burning signal based on the sequence number to serve as the second byte data.
In some embodiments, the processor is further configured to: if the first byte data is matched with the second byte data, checking is passed, and the value of the second variable is increased by 1; if the first byte data is not matched with the second byte data, checking is failed, and the value of the second variable is reset to 0.
In some embodiments, the processor is further configured to: when the value of the second variable is equal to 8, the data in the serial port receiving buffer area is the burning signal data.
In some embodiments, the processor is further configured to: calling a reset function to reset the processor; and switching the running program from the application program to the bootstrap program based on the reset operation.
The embodiment of the application also provides a computer readable storage medium, and a computer program is stored on the computer readable storage medium, wherein the computer program comprises program instructions, and the program instructions realize the data burning method of any one of the processors provided by the embodiment of the application when being executed.
The computer readable storage medium may be an internal storage unit of the computer device according to the foregoing embodiment, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, which are provided on the computer device.
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created from the use of blockchain nodes, and the like.
While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (9)

1. A data burning method of a processor, applied to a development board, the method comprising:
acquiring first byte data in a serial port receiving buffer area;
acquiring burning signal data;
acquiring a second variable, wherein the second variable is used for recording the number of continuous pass of byte verification;
acquiring the value of the second variable;
increasing the value of the second variable by 1 to obtain sequential numbers;
based on the sequence numbers, byte data at corresponding positions in the burning signal data are obtained and used as second byte data;
verifying the first byte data according to the second byte data;
based on the verification result, judging whether the data in the serial port receiving buffer area is the burning signal data or not;
and if the data in the serial port receiving buffer area is the burning signal data, controlling the processor to reset so as to switch the program running on the development board from the application program to the guide program, and executing the data burning.
2. The method of claim 1, wherein the acquiring the first byte of data in the serial port receive buffer comprises:
receiving signals of the serial port receiving buffer area through an interrupt receiving function;
if the interrupt receiving function receives an interrupt signal sent by the serial port receiving buffer zone, calling an interrupt processing function, wherein the interrupt signal is a signal generated when the serial port receiving buffer zone is not empty;
and accessing the serial port receiving buffer area through the interrupt processing function to acquire the first byte data.
3. The method according to claim 2, wherein the method further comprises:
the first byte data is stored in a first variable.
4. The method of claim 1, wherein the burn signal data consists of 8 bytes of data.
5. The method of claim 4, wherein said verifying said first byte of data from said second byte of data comprises:
if the first byte data is matched with the second byte data, checking is passed, and the value of the second variable is increased by 1;
if the first byte data is not matched with the second byte data, checking is failed, and the value of the second variable is reset to 0.
6. The method of claim 5, wherein determining whether the data in the serial port receive buffer is burn signal data based on the verification result comprises:
when the value of the second variable is equal to 8, the data in the serial port receiving buffer area is the burning signal data.
7. The method of claim 1, wherein the controlling the processor reset comprises:
calling a reset function to reset the processor;
and switching the running program from the application program to the bootstrap program based on the reset operation.
8. A computer device, the computer device comprising a memory and a processor;
the memory is used for storing a computer program;
the processor is configured to execute the computer program and implement the data burning method of the processor according to any one of claims 1 to 7 when the computer program is executed.
9. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program which, when executed by a processor, causes the processor to implement the data burning method of the processor according to any one of claims 1 to 7.
CN202211507876.6A 2022-11-29 2022-11-29 Data burning method, equipment and storage medium of processor Active CN115599408B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211507876.6A CN115599408B (en) 2022-11-29 2022-11-29 Data burning method, equipment and storage medium of processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211507876.6A CN115599408B (en) 2022-11-29 2022-11-29 Data burning method, equipment and storage medium of processor

Publications (2)

Publication Number Publication Date
CN115599408A CN115599408A (en) 2023-01-13
CN115599408B true CN115599408B (en) 2023-05-12

Family

ID=84853597

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211507876.6A Active CN115599408B (en) 2022-11-29 2022-11-29 Data burning method, equipment and storage medium of processor

Country Status (1)

Country Link
CN (1) CN115599408B (en)

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040049617A1 (en) * 2002-09-05 2004-03-11 Integrated Circuit Solution Inc. Method of firmware update by USB interface
CN102629240B (en) * 2012-02-13 2015-04-22 上海创远仪器技术股份有限公司 Method and device for serial communication
CN103336700B (en) * 2013-06-09 2016-08-10 深圳市汇川技术股份有限公司 The serial ports programming circuitry of a kind of digital signal processor and system
CN107885510B (en) * 2017-11-03 2021-04-09 黄骅市交大思诺科技有限公司 Burning tool and burning method capable of simultaneously burning double DSPs
CN110413298A (en) * 2019-07-16 2019-11-05 南京邮电大学 The method that single-chip microcontroller serially upgrades and debugs is carried out based on Labwindows platform
CN111752589A (en) * 2020-06-24 2020-10-09 研祥智能科技股份有限公司 Method and device for upgrading burning codes of microcontroller on line
CN112805186B (en) * 2020-11-30 2024-01-12 深圳市锐明技术股份有限公司 CPU mode control circuit, in-vehicle host device, and vehicle
CN114675847A (en) * 2022-01-27 2022-06-28 添可智能科技有限公司 Cleaning device, program burning system, method, burning device and control module

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李光学 等.基于STM32的高可靠IAP在线烧写设计.电子测量技术.2018,41(17),第105-109页. *

Also Published As

Publication number Publication date
CN115599408A (en) 2023-01-13

Similar Documents

Publication Publication Date Title
US4809217A (en) Remote I/O port for transfer of I/O data in a programmable controller
EP2460086B1 (en) Device identifier selection
CN109726163B (en) SPI-based communication system, method, equipment and storage medium
US8171192B2 (en) Hardware-assisted device configuration detection
CN109902053A (en) A kind of SPI communication method, terminal device and storage medium based on dual controller
US20180225065A1 (en) Method and system for handling an asynchronous event request command in a solid-state drive
CN115599408B (en) Data burning method, equipment and storage medium of processor
US20050060690A1 (en) Microprocessor system with software emulation processed by auxiliary hardware
US8291270B2 (en) Request processing device, request processing system, and access testing method
WO2023240941A1 (en) Method and apparatus for downloading data, and secure element
CN109684152B (en) RISC-V processor instruction downloading method and device
KR20170117326A (en) Direct memory access control device for at least one processing unit having a random access memory
CN105335670A (en) Real-time integrity checking method and checking circuit as well as security chip
CN111371799B (en) Method, device and equipment for controlling data receiving and transmitting of MCTP (Multi-channel media Port) controller
US9400758B2 (en) Reset method and network device
CN116802635A (en) BIOS update for electronic device
JP4793798B2 (en) Microcomputer
JP5917325B2 (en) Bridge circuit
CN112788141B (en) File downloading method, device, equipment and computer readable storage medium
US20210373766A1 (en) Method facilitating data transmission, apparatus, and storage medium thereof
JP3630350B2 (en) Memory data comparison method
CN113364564A (en) Data transmission method, microprocessor, data transmission device and storage medium
RU1815643C (en) Device for debugging programs for microcomputer
CN115967622A (en) Port configuration method and device, storage medium and electronic equipment
JPS5965354A (en) Priority control system for reception of processing request

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