[go: up one dir, main page]

CN110990044B - Method for programming in application and computer-readable storage medium - Google Patents

Method for programming in application and computer-readable storage medium Download PDF

Info

Publication number
CN110990044B
CN110990044B CN201911101469.3A CN201911101469A CN110990044B CN 110990044 B CN110990044 B CN 110990044B CN 201911101469 A CN201911101469 A CN 201911101469A CN 110990044 B CN110990044 B CN 110990044B
Authority
CN
China
Prior art keywords
data storage
management device
frame
application programming
upper computer
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
CN201911101469.3A
Other languages
Chinese (zh)
Other versions
CN110990044A (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.)
AECC South Industry Co Ltd
Original Assignee
AECC South Industry 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 AECC South Industry Co Ltd filed Critical AECC South Industry Co Ltd
Priority to CN201911101469.3A priority Critical patent/CN110990044B/en
Publication of CN110990044A publication Critical patent/CN110990044A/en
Application granted granted Critical
Publication of CN110990044B publication Critical patent/CN110990044B/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/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses an application programming method and a computer readable storage medium, wherein the application programming method comprises the following steps: programming codes and working codes of application programming software in a Flash memory; after the singlechip is configured to be powered on, loading and running codes of application programming software in a Flash memory; and controlling the upper computer software to send an update instruction to actively start the application programming process, and communicating with the upper computer after receiving the update instruction by the singlechip to finish the update of the working code. The in-application programming method can be applied to data storage and management devices with different single-chip microcomputer models, and does not depend on firmware and source codes provided by single-chip microcomputer manufacturers or third-party software; the application programming process is actively initiated by the upper computer software, and the upper computer software sends an update instruction to enable the data storage and management device to enter the application programming state, so that external discrete switching value input is not needed any more to configure the product to enter the application programming state.

Description

Method for programming in application and computer-readable storage medium
Technical Field
The invention relates to the technical field of application programming of data storage and management devices of aeroengines, in particular to an application programming method and a computer-readable storage medium.
Background
Nowadays, more and more aircraft engine accessories containing embedded software take the application programming capability of the accessory as an essential technical requirement, namely, upgrading the embedded software in the accessory through the external interface of the accessory without opening the housing of the engine accessory. The application programming capability reduces the difficulty and workload of upgrading the software of the engine accessory, and has great practical significance when the function and performance requirements of the engine accessory are continuously updated and perfected.
Accordingly, the aeroengine data storage and management device is designed and implemented with consideration given to its application programming functions. The existing technical implementation scheme in application programming often has great difference along with the different types of SCM (single-chip microcomputer) selected by an accessory, discrete switching value input is needed to be contained in an external interface of an engine accessory to manually control the engine accessory to run in the application programming program by an operator, and the implementation scheme is more dependent on the application programming program and special software provided by a SCM manufacturer or a third party, so that the code is difficult to adaptively modify without being opened or the code is opened.
For example, a DSP processor chip TMS320F2812 commonly used in an aeroengine accessory is selected, the application programming capability of the aeroengine accessory of the processor chip is often realized by solidifying a Boot program (which is not powered on and cannot be modified) in a FLASH in the TMS320F2812 when the aeroengine accessory leaves a factory, four Boot mode configuration GPIO pins of the TMS320F2812 are actually required to be configured into a SCI power-on Boot mode through switching value input in an external interface of the accessory when the aeroengine accessory is actually programmed, and binary accessory work codes are transmitted to the TMS320F2812 chip through serial ports by virtue of SDFLASH software provided by a TI official installed on a PC, programming of the work program is completed through the Boot program without a power source, and the user work program is jumped after programming is successful.
As another example, the application programming capability of the STM32 singlechip is realized by means of IAP (In Application Programming) routines provided by manufacturers, the upper computer needs to install super terminal or SecureCRT software, and the transmission of work codes is controlled by YMODEM file transmission protocol. The implementation scheme simplifies the product design development process, but the application programming process must be actively initiated by the singlechip in the device, the singlechip is configured to enter an application programming state through an external interface of the product in advance, the use of the third party software and the YMODEM protocol pay more attention to the reliability of serial communication transmission data files, and the inspection of code programming results is omitted, so that the product becomes very difficult to carry out self-adaptive development and code optimization on the application programming function.
Disclosure of Invention
The invention provides an application programming method and a computer readable storage medium, which are used for solving the technical problem that the prior application programming method needs to input discrete switching value signals to configure a data storage and management device to enter an application programming state and has poor adaptability.
According to one aspect of the invention, an in-application programming method is provided for in-application programming a data storage and management device of an aeroengine, the data storage and management device comprises a single chip microcomputer and a Flash memory, the single chip microcomputer can read, write and erase the Flash memory, and the method comprises the following steps:
step S1: programming codes and working codes of application programming software in a Flash memory;
step S2: after the singlechip is configured to be powered on, loading and running codes of application programming software in a Flash memory;
step S3: and controlling the upper computer software to send an update instruction to actively start the application programming process, and communicating with the upper computer after receiving the update instruction by the singlechip to finish the update of the working code.
Further, in step S1, the code and the working code of the application programming software are pre-written in different locations in the Flash memory.
Further, in the step S3, the serial communication protocol in which the data storage and management device communicates with the upper computer defines a plurality of different instruction frames, data frames and response frames, where each of the instruction frames, the data frames and the response frames includes a frame header and a frame trailer, the instruction frames adopt a repeated double-byte structure, the data frames include frame sequence numbers, and the frame sequence numbers of the entire data frames are continuous.
Further, when the singlechip in step S3 communicates with the upper computer, the upper computer software and the application programming software are both configured into a state machine;
the step S3 specifically comprises the following steps:
step S31: the upper computer sends an update notification instruction frame to the data storage and management device;
step S32: the data storage and management device sends an update notification instruction response frame to the upper computer;
step S33: after two handshakes, the upper computer sends a data frame to the data storage and management device;
step S34: the data storage and management device receives the data frame, successfully writes the update code in the data frame into the Flash memory, and then sends a response frame of the correct receiving code to the upper computer so as to inform the upper computer to continue sending the next frame of data;
step S35: the upper computer transmits an ending instruction frame to the data storage and management device after all codes are transmitted;
step S36: the data storage and management device returns a reply frame of the correct received code.
Further, the step S3 further includes the following steps:
step S37: the data storage and management device transmits the updated working codes in the Flash memory back to the upper computer;
step S38: the upper computer performs comparison and verification on the updated working codes returned by the data storage and management device, and sends comparison and verification results to the data storage and management device in the form of instruction frames;
step S39: the data storage and management device receives the comparison check result, if the comparison check result is correct, the data storage and management device jumps to the updated working code and executes the working code, otherwise, the data storage and management device does not jump.
Further, in step S34, if the data storage and management device receives the error of the data frame or the error of the Flash memory, the data storage and management device sends an error response frame to the upper computer, and requests the upper computer to resend the data frame, and after three consecutive resends fail, the data storage and management device ends the application programming and the error reporting.
Further, the method also comprises the following steps:
step S4: if the update instruction of the upper computer is not received within a certain time interval, the operation code is jumped to and operated.
Further, in step S1, the working codes include an online working mode code and an offline working mode code, where the online working mode code, the offline working mode code and the code of the application programming software are respectively programmed in different positions of the Flash memory, and the singlechip selects to update the online working mode code or the offline working mode code according to different power supplies.
The present invention also provides a computer readable storage medium storing a computer program for performing an application programming method as described above when run on a computer.
The invention has the following beneficial effects:
the application programming method of the invention is applicable to data storage and management devices with different single-chip microcomputer models, and does not depend on firmware and source codes provided by single-chip microcomputer manufacturers or third-party software; meanwhile, the application programming process is actively initiated by the upper computer software, and the upper computer software sends an update instruction to enable the data storage and management device to enter the application programming state, so that the data storage and management device is not required to keep discrete switching value input in an external interface to configure the product to enter the application programming state.
In addition to the objects, features and advantages described above, the present invention has other objects, features and advantages. The present invention will be described in further detail with reference to the drawings.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the invention. In the drawings:
fig. 1 is a flow chart of a method of programming in application according to a preferred embodiment of the present invention.
Fig. 2 is a schematic flow chart of step S3 in fig. 1 according to a preferred embodiment of the present invention.
Detailed Description
Embodiments of the invention are described in detail below with reference to the attached drawing figures, but the invention can be practiced in a number of different ways, as defined and covered below.
As shown in fig. 1, a preferred embodiment of the present invention provides an in-application programming method, which is used for in-application programming a data storage and management device of an aeroengine, where the data storage and management device includes a single chip microcomputer and a Flash memory, the single chip microcomputer is used as a control core, and can read, write and erase the Flash memory, where the Flash memory can be disposed inside or outside the single chip microcomputer. The data storage and management device comprises at least one serial interface, such as an RS422 interface or an RS485 interface, can be communicated with a numerical control system of a transmitter to complete the receiving and transmitting of engine working data, can be multiplexed to be a special serial port for application programming, and can be matched with upper computer software to complete the application programming updating of a singlechip working code. The method for programming the application comprises the following steps:
step S1: programming codes and working codes of application programming software in a Flash memory;
step S2: after the singlechip is configured to be powered on, loading and running codes of application programming software in a Flash memory;
step S3: and controlling the upper computer software to send an update instruction to actively start the application programming process, and communicating with the upper computer after receiving the update instruction by the singlechip to finish the update of the working code.
It will be appreciated that in step S1, the code and the work code of the application programming software generated by the software development environment editing, compiling, and linking are pre-programmed in the Flash memory. Preferably, the code and the working code of the application programming software are written in different positions in the Flash memory, and isolation of the physical storage area is adopted to prevent erroneous program jumps.
It can be understood that in the step S2, after the data storage and management device is powered on, the singlechip loads and runs the code of the application programming program in the Flash memory in advance, so as to wait for the instruction of the upper computer software to enter the application programming process at any time.
It can be understood that in the step S3, the upper computer actively sends an update instruction to the data storage and management device to start the application programming process, and no external discrete switch signal is required to be input to configure the data storage and management device to enter the application programming state, so that the application programming state can be adaptively modified according to different singlechip models, the firmware and source codes provided by the singlechip manufacturer are not relied on, and the application scope is wider.
In this embodiment, the in-application programming method may be applied to data storage and management devices of different single-chip microcomputer models, and does not depend on firmware and source codes provided by a single-chip microcomputer manufacturer, and does not depend on third-party software; meanwhile, the application programming process is actively initiated by the upper computer software, and the upper computer software sends an update instruction to enable the data storage and management device to enter the application programming state, so that the data storage and management device is not required to keep discrete switching value input in an external interface to configure the product to enter the application programming state.
It can be understood that in the step S3, the serial communication protocol in which the data storage and management device communicates with the upper computer defines a plurality of different instruction frames, data frames and response frames to meet the communication requirements, where the instruction frames, the data frames and the response frames each include a frame header and a frame tail, and the content of the frame header and the frame tail is completely different from the content definition of the frame header and the frame tail of the data frame structure received and transmitted by the data storage and management device in actual operation, so that confusion is avoided and normal operation of the data storage and management device is not affected. In addition, the instruction frame adopts a repeated double-byte structure, the data frame comprises a frame sequence number, and the frame sequence number of the whole data frame is continuous. The structures of the plurality of instruction frames, the data frames and the response frames according to the embodiment of the present invention are shown in tables 1 to 13.
Table 1 update notification instruction frame structure
Name of the name Frame header Instructions for Repeat instruction Frame end
Content 0xCA 0x60 0x60 0xFF
Length of 1 Byte 1Byte 1Byte 1Byte
Remarks Update notification instruction
Table 2 structure of response frame for update notification instruction
Name of the name Frame header Instructions for Repeat instruction Frame end
Content 0xCA 0x50 0x50 0xFF
Length of 1Byte 1Byte 1Byte 1Byte
Remarks Has received the update notification instruction
Table 3 update notification instruction 2 frame structure
Name of the name Frame header Instructions for Repeat instruction Frame end
Content 0xCA 0x6A 0x6A 0xFF
Length of 1Byte 1Byte 1Byte 1Byte
Remarks Update notification instruction 2
Table 4 update of structure of response frame of notification instruction 2
Figure BDA0002270004180000061
Figure BDA0002270004180000071
Table 5 structure of data frame containing code file
Figure BDA0002270004180000072
TABLE 6 Structure of response frame for correctly receiving codes
Figure BDA0002270004180000073
TABLE 7 Structure of acknowledgement frame with data frame type error
Name of the name Frame header Instructions for Repeat instruction Frame end
Content 0xCA 0x52 0x52 0xFF
Length of 1Byte 1Byte 1Byte 1Byte
Remarks Error in received data frame type
TABLE 8 structure of acknowledgement frame for data content errors
Figure BDA0002270004180000074
Table 9 structure of FLASH error-writing response frame
Figure BDA0002270004180000075
Figure BDA0002270004180000081
Table 10 structure of end instruction frame
Name of the name Frame header Instructions for Repeat instruction Frame end
Content 0xCA 0x62 0x62 0xFF
Length of 1Byte 1Byte 1Byte 1Byte
Remarks End instruction
Table 11 structure of data frame of return code
Figure BDA0002270004180000082
Table 12 code alignment correct frame structure
Name of the name Frame header Instructions for Repeat instruction Frame end
Content 0xCA 0x63 0x63 0xFF
Length of 1Byte 1Byte 1Byte 1Byte
Remarks Code alignment is correct
TABLE 13 Structure of code alignment incorrect frame
Name of the name Frame header Instructions for Repeat instruction Frame end
Content 0xCA 0x64 0x64 0xFF
Length of 1Byte 1Byte 1Byte 1Byte
Remarks Incorrect code alignment
Compared with the existing general communication protocol, such as the XModem protocol, the serial communication protocol of the present embodiment no longer uses a single byte identifier, but all uses a data frame format, no matter the data frame, the instruction frame, and the response frame, the frame header and the frame tail are included to indicate the start and the end of one instruction transmission, and the confusion with the engine data frame received when the product formally works is avoided, so that the error execution of the product in the application program and the normal working program software is caused, the instruction frame uses repeated double bytes, the error that may occur in the single byte identifier transmission is further reduced, the structure of the data frame includes the frame sequence number, and the frame sequence number is continuous, so that when the communication error occurs, the data storage and management device can identify the fault that the whole data frame is lost, and also can prompt the upper computer to retransmit the data frame with a certain designated sequence number, thereby the self-checking correction can be rapidly performed, and the communication processing efficiency is high.
It can be understood that in the step S3, when the singlechip communicates with the upper computer, the upper computer software and the application programming software are both configured into a state machine, the next state can be entered only after the correct instruction frame, the data frame or the response frame is received, the data frame and the instruction frame which are not satisfactory can be discarded, the state jump can not be caused, the reliability of the programming program during the application programming is ensured through a plurality of handshakes, the misoperation is avoided, the state jump condition is designed, the reliable jump of the product between various states in the application programming process is ensured, and the whole application programming process is successfully completed.
It can be understood that in the step S3, when the singlechip communicates with the upper computer, the upper computer software and the application programming software are both configured as a state machine. As shown in fig. 2, the step S3 specifically includes the following steps:
step S31: the upper computer sends an update notification instruction frame to the data storage and management device;
step S32: the data storage and management device sends an update notification instruction response frame to the upper computer;
step S33: after two handshakes, the upper computer sends a data frame to the data storage and management device;
step S34: the data storage and management device receives the data frame, successfully writes the update code in the data frame into the Flash memory, and then sends a response frame of the correct receiving code to the upper computer so as to inform the upper computer to continue sending the next frame of data;
step S35: the upper computer transmits an ending instruction frame to the data storage and management device after all codes are transmitted;
step S36: the data storage and management device returns a reply frame of the correct received code.
It is understood that the two-way handshake in step S33 means that step S31 and step S32 are performed twice.
It can be understood that in the step S34, if the data storage and management device receives the error of the data frame or the error of writing the Flash memory, the data storage and management device sends an error response frame to the upper computer, and requests the upper computer to resend the data frame, and after all three consecutive resends fail, the application programming and error reporting are finished.
It will be appreciated that the step S3 further comprises the steps of:
step S37: the data storage and management device transmits the updated working codes in the Flash memory back to the upper computer;
step S38: the upper computer performs comparison and verification on the updated working codes returned by the data storage and management device, and sends comparison and verification results to the data storage and management device in the form of instruction frames;
step S39: the data storage and management device receives the comparison check result, if the comparison check result is correct, the data storage and management device jumps to the updated working code and executes the working code, otherwise, the data storage and management device does not jump.
In this embodiment, by performing a multiple handshake between the upper computer and the data storage and management device at the beginning of the application programming process, and comparing the working code bin file with the updated code in the FLASH memory by the upper computer software after the working code is programmed into the FLASH memory in the product singlechip, the reliability of the application programming is increased by adopting the two measures, so that the product with the problem of programming is ensured not to flow into the next production process, but to be repeatedly operated by an operator to perform error correction.
It will be appreciated that the method of programming in-application further comprises the steps of:
step S4: if the singlechip of the data storage and management device does not receive the update instruction of the upper computer within a certain time interval, the singlechip jumps to the working code and operates.
It can be further understood that in the step S1, the working code includes an online working mode code and an offline working mode code, where the online working mode code, the offline working mode code and the code of the application programming software are respectively programmed in different positions of the Flash memory, and the singlechip selects to update the online working mode code or the offline working mode code according to different power supplies. The power supply of the online working mode is provided by the engine ECU, and the power supply of the offline working mode is provided by the ground computer. When the data storage and management device is powered on, the application programming program is firstly run, the singlechip judges that the power supply is an ECU or a ground computer so as to select to update the online working mode program or the offline working mode program, and similarly, after the update is finished or when the update program is not needed, the singlechip further jumps to the online working mode or the offline working mode for execution. The two different working modes are determined by the difference of external power supplies, and two modes cannot exist simultaneously in the use process of the product, and the isolation of the physical storage area aims to independently update codes of the different working modes and reduce the confusion execution of the product between the program codes of the two modes caused by the wrong program jump when the hardware or software fault occurs to the product.
In addition, the upper computer software is specially designed and developed according to a state machine and a serial port communication protocol of the upper computer software, the programming language is C++, development is completed in a VS2010 development environment, and executable files are released, and of course, development can be completed in other programming language tools, such as LabWindows/CVI, NI Labview, JAVA and the like, and the use effect of the software is not affected. The upper computer software comprises three parts: an important part is serial port configuration, including serial port configuration parameters such as port number, baud rate, data bit, check bit, stop bit, etc., and setting should be completed according to serial port channel parameters of the data storage and management device; the other part is a product work code file selection function, and the transmission of the bin file can be completed by utilizing application programming software through browsing the code bin file finally generated after the development of the selected product is completed; the last part is the design realization of the state machine, the upper computer software actively starts the application programming process according to the operation of an operator, successfully enters the next state after receiving the correct response of the data or the data storage and management device each time, and the state is switched to inform the operator through the indicator light and the message window, and finally, the prompt of whether the product work code is successfully updated or not can remind the operator whether the application programming process needs to be restarted or not.
It will be appreciated that another embodiment of the present invention also provides a computer readable storage medium storing a computer program for performing application programming, the computer program when run on a computer performing the steps of:
step S1: programming codes and working codes of application programming software in a Flash memory;
step S2: after the singlechip is configured to be powered on, loading and running codes of application programming software in a Flash memory;
step S3: and controlling the upper computer software to send an update instruction to actively start the application programming process, and communicating with the upper computer after receiving the update instruction by the singlechip to finish the update of the working code.
It will be appreciated that the step S3 specifically includes the following steps:
step S31: the upper computer sends an update notification instruction frame to the data storage and management device;
step S32: the data storage and management device sends an update notification instruction response frame to the upper computer;
step S33: after two handshakes, the upper computer sends a data frame to the data storage and management device;
step S34: the data storage and management device receives the data frame, successfully writes the update code in the data frame into the Flash memory, and then sends a response frame of the correct receiving code to the upper computer so as to inform the upper computer to continue sending the next frame of data;
step S35: the upper computer transmits an ending instruction frame to the data storage and management device after all codes are transmitted;
step S36: the data storage and management device returns a reply frame of the correct received code.
It can be understood that in the step S34, if the data storage and management device receives the error of the data frame or the error of writing the Flash memory, the data storage and management device sends an error response frame to the upper computer, and requests the upper computer to resend the data frame, and after all three consecutive resends fail, the application programming and error reporting are finished.
It will be appreciated that the step S3 further comprises the steps of:
step S37: the data storage and management device transmits the updated working codes in the Flash memory back to the upper computer;
step S38: the upper computer performs comparison and verification on the updated working codes returned by the data storage and management device, and sends comparison and verification results to the data storage and management device in the form of instruction frames;
step S39: the data storage and management device receives the comparison check result, if the comparison check result is correct, the data storage and management device jumps to the updated working code and executes the working code, otherwise, the data storage and management device does not jump.
It will be appreciated that the computer program when run also performs the steps of:
step S4: if the singlechip of the data storage and management device does not receive the update instruction of the upper computer within a certain time interval, the singlechip jumps to the working code and operates.
Forms of general computer-readable media include: a floppy disk (floppy disk), a flexible disk (flexible disk), hard disk, magnetic tape, any other magnetic medium, a CD-ROM, any other optical medium, punch cards, paper tape, any other physical medium with patterns of holes, a Random Access Memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a FLASH erasable programmable read-only memory (FLASH-EPROM), any other memory chip or cartridge, or any other medium from which a computer can read. The instructions may further be transmitted or received over a transmission medium. The term transmission medium may include any tangible or intangible medium that may be used to store, encode, or carry instructions for execution by a machine, and includes digital or analog communications signals or their communications with intangible medium that facilitate communication of such instructions. Transmission media includes coaxial cables, copper wire and fiber optics, including the wires that comprise a bus for transmitting a computer data signal.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (2)

1. An in-application programming method is used for in-application programming a data storage and management device of an aeroengine, the data storage and management device comprises a singlechip and a Flash memory, the singlechip can read, write and erase the Flash memory, and is characterized in that,
the method comprises the following steps:
step S1: programming codes and working codes of application programming software in a Flash memory, and particularly pre-programming the codes and the working codes of the application programming software in different positions in the Flash memory;
step S2: after the singlechip is configured to be powered on, loading and running codes of application programming software in a Flash memory;
step S3: the method comprises the steps that upper computer software is controlled to send an update instruction to actively start an application programming process, and a singlechip receives the update instruction and then communicates with the upper computer to complete update of a working code; the serial port communication protocol of the data storage and management device and the upper computer defines a plurality of different instruction frames, data frames and response frames, wherein the instruction frames, the data frames and the response frames comprise frame heads and frame tails, the frame heads and the frame tails are completely different from the frame heads and the frame tails of data frame structures received and transmitted when the data storage and management device actually works, the instruction frames adopt a repeated double-byte structure, the data frames comprise frame serial numbers, and the frame serial numbers of the whole data frames are continuous;
step S4: if the update instruction of the upper computer is not received within a certain time interval, jumping to a working code and running;
when the singlechip in the step S3 is communicated with the upper computer, the upper computer software and the application programming software are configured into a state machine;
the step S3 specifically comprises the following steps:
step S31: the upper computer sends an update notification instruction frame to the data storage and management device;
step S32: the data storage and management device sends an update notification instruction response frame to the upper computer;
step S33: after two handshakes, the upper computer sends a data frame to the data storage and management device;
step S34: the data storage and management device receives the data frame, successfully writes the update code in the data frame into the Flash memory, and then sends a response frame of the correct receiving code to the upper computer so as to inform the upper computer to continue sending the next frame of data;
step S35: the upper computer transmits an ending instruction frame to the data storage and management device after all codes are transmitted;
step S36: the data storage and management device returns a response frame for correctly receiving the codes;
step S37: the data storage and management device transmits the updated working codes in the Flash memory back to the upper computer;
step S38: the upper computer performs comparison and verification on the updated working codes returned by the data storage and management device, and sends comparison and verification results to the data storage and management device in the form of instruction frames;
step S39: the data storage and management device receives the comparison and verification result, if the comparison and verification result is correct, the data storage and management device jumps to the updated working code and executes the working code, otherwise, the data storage and management device does not jump;
in the step S34, if the data storage and management device receives the error of the data frame or the error of the Flash memory, the data storage and management device sends an error response frame to the upper computer, and requests the upper computer to resend the data frame, and after three continuous resending failures, the data storage and management device ends the application programming and reporting the error;
in the step S1, the working codes include an online working mode code and an offline working mode code, where the online working mode code, the offline working mode code and the code of the application programming software are respectively programmed in different positions of the Flash memory, and the singlechip selectively updates the online working mode code or the offline working mode code according to different power supplies, where the power supplies of the online working mode are provided by the engine ECU, and the power supplies of the offline working mode are provided by the ground computer.
2. A computer-readable storage medium storing a computer program for on-application programming, characterized in that the computer program performs the steps of the on-application programming method as claimed in claim 1 when run on a computer.
CN201911101469.3A 2019-11-12 2019-11-12 Method for programming in application and computer-readable storage medium Active CN110990044B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911101469.3A CN110990044B (en) 2019-11-12 2019-11-12 Method for programming in application and computer-readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911101469.3A CN110990044B (en) 2019-11-12 2019-11-12 Method for programming in application and computer-readable storage medium

Publications (2)

Publication Number Publication Date
CN110990044A CN110990044A (en) 2020-04-10
CN110990044B true CN110990044B (en) 2023-06-30

Family

ID=70083938

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911101469.3A Active CN110990044B (en) 2019-11-12 2019-11-12 Method for programming in application and computer-readable storage medium

Country Status (1)

Country Link
CN (1) CN110990044B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11593282B2 (en) * 2020-05-12 2023-02-28 Francesco E. DeAngelis Dual memory secure digital (SD) card and system and method for wirelessly and automatically updating data in host computer using dual memory SD card
CN112527366B (en) * 2020-11-25 2024-03-19 江苏华创微系统有限公司 Update rollback fault tolerant design technique for embedded processor boot
CN113821227B (en) * 2021-09-23 2024-05-17 青岛海信日立空调系统有限公司 Online burning system of air conditioner
CN115174701B (en) * 2022-06-30 2024-12-20 江苏科瑞恩科技股份有限公司 Data transmission method, device, computer equipment and storage medium

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4445177A (en) * 1981-05-22 1984-04-24 Data General Corporation Digital data processing system utilizing a unique arithmetic logic unit for handling uniquely identifiable addresses for operands and instructions
WO2004019160A2 (en) * 2002-08-23 2004-03-04 Jway Group, Inc. Extensible user interface (xui) framework and development environment
CN101183314A (en) * 2007-12-11 2008-05-21 中国科学院长春光学精密机械与物理研究所 A Method for Realizing Online Programming of Digital Signal Processor Program
CN102983884A (en) * 2011-09-05 2013-03-20 国民技术股份有限公司 A method for transmitting data via a magnetic channel
US8826261B1 (en) * 2010-02-25 2014-09-02 Bloom Energy Corporation Programming processors through CAN interface without changing the boot mode select pins
WO2016037474A1 (en) * 2014-09-12 2016-03-17 中兴通讯股份有限公司 Framing method and device
CN105513636A (en) * 2014-09-26 2016-04-20 北京兆易创新科技股份有限公司 Programming monitoring apparatus
CN105679367A (en) * 2016-01-14 2016-06-15 中国电子科技集团公司第五十八研究所 Programmer for MTM anti-fuse PROM
CN106649142A (en) * 2016-12-02 2017-05-10 北京航天长征飞行器研究所 High-speed memorizer with outage renew function
CN109358891A (en) * 2018-09-18 2019-02-19 中国船舶重工集团公司第七〇九研究所 A kind of the dsp software upgrade method and system of embedded controller
CN109710296A (en) * 2018-12-14 2019-05-03 上海航天控制技术研究所 A kind of sky and space plane inertial navigation embedded software on-line updating method
WO2019179384A1 (en) * 2018-03-22 2019-09-26 华为技术有限公司 Communication method and related device
CN110430215A (en) * 2019-08-16 2019-11-08 深圳特蓝图科技有限公司 A kind of robot communication control method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103024074B (en) * 2012-12-28 2015-04-22 哈尔滨工业大学 DSP (digital signal processor) remote wireless upgrading method based on GPRS (general packet radio service)

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4445177A (en) * 1981-05-22 1984-04-24 Data General Corporation Digital data processing system utilizing a unique arithmetic logic unit for handling uniquely identifiable addresses for operands and instructions
WO2004019160A2 (en) * 2002-08-23 2004-03-04 Jway Group, Inc. Extensible user interface (xui) framework and development environment
CN101183314A (en) * 2007-12-11 2008-05-21 中国科学院长春光学精密机械与物理研究所 A Method for Realizing Online Programming of Digital Signal Processor Program
US8826261B1 (en) * 2010-02-25 2014-09-02 Bloom Energy Corporation Programming processors through CAN interface without changing the boot mode select pins
CN102983884A (en) * 2011-09-05 2013-03-20 国民技术股份有限公司 A method for transmitting data via a magnetic channel
WO2016037474A1 (en) * 2014-09-12 2016-03-17 中兴通讯股份有限公司 Framing method and device
CN105513636A (en) * 2014-09-26 2016-04-20 北京兆易创新科技股份有限公司 Programming monitoring apparatus
CN105679367A (en) * 2016-01-14 2016-06-15 中国电子科技集团公司第五十八研究所 Programmer for MTM anti-fuse PROM
CN106649142A (en) * 2016-12-02 2017-05-10 北京航天长征飞行器研究所 High-speed memorizer with outage renew function
WO2019179384A1 (en) * 2018-03-22 2019-09-26 华为技术有限公司 Communication method and related device
CN109358891A (en) * 2018-09-18 2019-02-19 中国船舶重工集团公司第七〇九研究所 A kind of the dsp software upgrade method and system of embedded controller
CN109710296A (en) * 2018-12-14 2019-05-03 上海航天控制技术研究所 A kind of sky and space plane inertial navigation embedded software on-line updating method
CN110430215A (en) * 2019-08-16 2019-11-08 深圳特蓝图科技有限公司 A kind of robot communication control method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于电力线信道的智能家居系统;汪波;黄佩伟;钟幼平;;电讯技术(第02期);全文 *

Also Published As

Publication number Publication date
CN110990044A (en) 2020-04-10

Similar Documents

Publication Publication Date Title
CN110990044B (en) Method for programming in application and computer-readable storage medium
CN105912356B (en) A kind of optical module firmware program on-line upgrading method for supporting version rollback
WO2018120213A1 (en) Firmware updating method and controller
CA3025606C (en) Tire pressure monitoring sensor enabling fast configuration and software updates
CN101557583A (en) Remote-updating and version-switching method of repeater equipment embedded software
US20120117557A1 (en) Method and system for upgrading wireless data card
CN104834547B (en) A kind of remote upgrade method and system of the read-only root file systems of Squashfs
CN111026427B (en) Remote online upgrading method for embedded system containing CPU and FPGA
JP6257506B2 (en) Method for changing software in the memory of an electronic control unit
CN108874422B (en) Software online upgrading method for refrigerator electric control board, refrigerator electric control board and refrigerator
KR101533813B1 (en) Apparatus and method for controlling power relay assembly
CN115718610A (en) Reliable method for updating application program of single chip microcomputer
CN111813597A (en) Air conditioner
CN112181444B (en) DSP multi-core data programming method based on 1553B bus
CN118394393B (en) IO module firmware updating method based on EtherCat coupler
CN109933347A (en) A Reliable Upgrading Method of Multi-Embedded Processor Software Based on 1553B Bus
CN110442493A (en) A kind of automation services management system and method
CN111026428A (en) System and method capable of simultaneously remotely updating FPGA firmware programs in multiple board cards on line
CN116315168A (en) Battery management system information updating method and device
CN100511147C (en) Data processing apparatus and program data setting method thereof
CN113342383A (en) Remote online burning upgrading method for single chip microcomputer
CN111090447A (en) Firmware updating method of IO module and related device
CN112597131A (en) Distributed script control method and related device
EP4179454B1 (en) Data calibration method and driver
JP2004355389A (en) Remote update system

Legal Events

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