CN103744712A - Method and device for updating application program - Google Patents

Method and device for updating application program Download PDF

Info

Publication number
CN103744712A
CN103744712A CN201410042175.9A CN201410042175A CN103744712A CN 103744712 A CN103744712 A CN 103744712A CN 201410042175 A CN201410042175 A CN 201410042175A CN 103744712 A CN103744712 A CN 103744712A
Authority
CN
China
Prior art keywords
slave computer
address
indication information
described slave
reprogrammed
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.)
Pending
Application number
CN201410042175.9A
Other languages
Chinese (zh)
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.)
Beijing Jingwei Hirain Tech Co Ltd
Original Assignee
Beijing Jingwei Hirain Tech 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 Beijing Jingwei Hirain Tech Co Ltd filed Critical Beijing Jingwei Hirain Tech Co Ltd
Priority to CN201410042175.9A priority Critical patent/CN103744712A/en
Publication of CN103744712A publication Critical patent/CN103744712A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

The invention provides a method and a device for updating application programs. The method and the device are applied to a host computer; the host computer can communicate with an electronic control unit as a lower computer; the method comprises the following steps: rewriting a reprogramming identifier of the lower computer into a valid value, so that Bootloader does not hand the control right of the lower computer to the application program after the lower computer executes reset operation and enters into Bootloader, writing the identification information of a first application program into a memory of the lower computer, writing first application program data into the memory of the lower computer, verifying the first application program data in the memory of the lower computer, changing the reprogramming identifier into non-valid values after the verification is accomplished, so that the Bootloader is enabled to hand the control right of he lower computer to the first application program after the lower computer executes the reset operation and enters into Bootloader. By adopting the method and device for updating the application programs, the application programs in the electronic control unit with the Bootloader function in an automobile bus can be updated.

Description

A kind of update method of application program and device
Technical field
The present invention relates to embedded software technology field, relate in particular to a kind of update method and device of application program.
Background technology
Along with informationalized development, the electronic trend of automobile industry is day by day obvious, and increasing electronic control unit ECU appears in the systems such as the power, chassis, vehicle body, amusement of motor vehicles.In recent years, with respect to conventional automobile bus such as CAN, LIN, the New Bus such as emerging MOST, FlexRay, Ethernet, because of its efficient real-time transfer rate or cheap cost, have also been obtained significant progress.Various ECU link together by multiple automobile bus, have just formed the topological structure of whole automotive networking.
For various reasons, after entrucking, the application program in ECU may exist certain defect or application program to need change, at this moment just need to the application program in ECU be safeguarded or be upgraded.Owing to being difficult to dismounting after the assembling of ECU car load factory, therefore, can only to the application program in ECU, carry out reprogrammed (being that application programs is upgraded) by automobile bus, this just requires this class ECU to have Bootloader function, and how by automobile bus, to having application program in the ECU of Bootloader function, to carry out reprogrammed be to need the problem of solution badly.
Summary of the invention
In view of this, the invention provides a kind of update method and device of application program, in order to the application program having in the ECU of Bootloader function is carried out to reprogrammed by automobile bus, its technical scheme is as follows:
A update method for application program, is applied to host computer, and described host computer can be communicated by letter with the electronic control unit as slave computer, and described method comprises:
The reprogrammed sign of described slave computer is rewritten as to effective value, so that described slave computer is executing after reset operation enters Bootloader, described Bootloader is not handed over the control of described slave computer
Give application program;
At described slave computer, execute after reset operation enters Bootloader, the identification information of the first application program is write to the storer of described slave computer, the renewal application program that described the first application program is the second application program in slave computer;
After the identification information of described the first application program is write to the storer of described slave computer, the first application data is write to the storer of described slave computer;
Described the first application data writing in the storer of described slave computer is carried out to verification, and after described the first application data verification succeeds, described reprogrammed sign is changed to non-effective value, so that described slave computer, executing after reset operation enters Bootloader, makes described Bootloader give described the first application program by the control of described slave computer.
Wherein, when the application program in slave computer is supported XCP agreement, the reprogrammed sign of described slave computer is rewritten as to effective value, comprises:
After successfully establishing a communications link with described slave computer, the first address that sends the memory address that comprises described reprogrammed sign to described slave computer arranges indication information, to indicate described slave computer by the memory address of reprogrammed sign described in the internal memory transmission pointed of XCP;
Receiving after the first address that described slave computer returns arranges successful indication information, to described slave computer, send first and download indication information, to indicate described slave computer that the reprogrammed sign of the current sensing of described internal memory transmission pointer is rewritten as to effective value;
When receiving complete the first indication information of download that described slave computer returns, again to described slave computer, send described the first address indication information is set, to indicate described slave computer described internal memory transmission pointer to be pointed to again to the memory address of described reprogrammed sign;
Receiving after the first address that described slave computer returns arranges successfully indication information, to described slave computer, send first and upload indication information, to indicate described slave computer read the value of described reprogrammed sign and upload from the address of the current sensing of described internal memory transmission pointer;
After receiving the value of the described reprogrammed sign that described slave computer returns, determine whether the value of described reprogrammed sign is effective value, if so, determine that described reprogrammed sign rewrites successfully.
Wherein, the described identification information by the first application program writes the storer of described slave computer, comprising:
After successfully establishing a communications link with described slave computer, to described slave computer, send the first programming and start indication information;
Receiving after programming that described slave computer returns starts successful the first indication information, the second address that sends the memory address of the identification information that comprises described the second application program to described slave computer arranges indication information, to indicate described slave computer by the memory address of the identification information of the second application program described in described internal memory transmission pointed;
When receiving the second address that described slave computer returns successful indication information be set, to described slave computer, send first and wipe indication information, the identification information of the second application program of locating with the address of indicating described slave computer to wipe the current sensing of described internal memory transmission pointer;
Receive that described slave computer returns wipe successful the first indication information time, again to described slave computer, send described the second address indication information is set, to indicate described slave computer described internal memory transmission pointer to be pointed to again to the memory address of the identification information of described the second application program;
Receiving after the second address that described slave computer returns arranges successful indication information, the the second download indication information that comprises the identification information of described the first application program is sent to described slave computer, to indicate described slave computer the identification information of described the first application program to be downloaded to the storage address of the current sensing of described internal memory transmission pointer.
Wherein, described the first application data is write to the storer of described slave computer, comprising:
After successfully establishing a communications link with described slave computer, to described slave computer, send the second programming and start indication information;
Receiving after programming that described slave computer returns starts successful the second indication information, the 3rd address that sends the initial memory address that comprises described the second application data to described slave computer arranges indication information, to indicate described slave computer by the initial memory address of the second application data described in described internal memory transmission pointed;
Receiving after the 3rd address that described slave computer returns arranges successful indication information, to described slave computer, send second and wipe indication information, to indicate described slave computer to wipe described second application data at the place, address of the current sensing of described internal memory transmission pointer;
Receive that described slave computer returns wipe successful the second indication information time, again to described slave computer, send described the 3rd address indication information is set, to indicate described slave computer described internal memory transmission pointer to be pointed to again to the initial memory address of described the second application data;
Receiving after the 3rd address that described slave computer returns arranges successful indication information, to described slave computer, sending and comprise that the 3rd of the first application data downloads indication information, to indicate described slave computer
Described the first application data is downloaded to the storage address of the current sensing of described internal memory transmission pointer.
Wherein, describedly to writing the data of described the first application program in the storer of described slave computer, carry out verification, and after the data check success to described the first application program, described reprogrammed sign changed to non-effective value, comprising:
After successfully establishing a communications link with described slave computer, the four-address that sends the initial memory address that comprises the first application data to described slave computer arranges indication information, to indicate described slave computer by the initial memory address of the first application data described in described internal memory transmission pointed;
Receiving after the four-address that described slave computer returns arranges successful indication information, to described slave computer, send verification indication information, to indicate described slave computer to carry out verification to described the first application data;
When receiving the indication information of the verification succeeds that described slave computer returns, the 5th address that sends the memory address that comprises described reprogrammed sign to described slave computer arranges indication information, to indicate described slave computer by the memory address of reprogrammed sign described in described internal memory transmission pointed;
When receiving the 5th address that described slave computer returns successful indication information be set, to described slave computer, send the 4th and download indication information, to indicate described slave computer that the value of the described reprogrammed sign at the place, address of the current sensing of described internal memory transmission pointer is changed to non-effective value;
When receiving complete the 4th indication information of download that described slave computer returns, again to described slave computer, send and comprise that described the 5th address arranges indication information, to indicate described slave computer described internal memory transmission pointer to be pointed to again to the memory address of described reprogrammed sign;
Receiving after the 5th address that described slave computer returns arranges successfully indication information, to described slave computer, send second and upload indication information, to indicate described slave computer read the value of described reprogrammed sign and upload from the address of the current sensing of described internal memory transmission pointer;
After receiving the value of the described reprogrammed sign that slave computer returns, determine whether the value of described reprogrammed sign is non-effective value, if so, determine that described reprogrammed sign rewrites successfully.
A updating device for application program, is applied to host computer, and described host computer can be communicated by letter with the electronic control unit as slave computer, and described device comprises:
Effectively rewrite module, for the reprogrammed sign of described slave computer is rewritten as to effective value, so that described slave computer is executing after reset operation enters Bootloader, make described Bootloader by the control of described slave computer, not give application program;
Update of identification information module, for executing at described slave computer after reset operation enters Bootloader, the identification information of the first application program is write to the storer of described slave computer, the renewal application program that described the first application program is the second application program in slave computer;
Application data update module, for after the identification information of described the first application program is write to the storer of described slave computer, writes the first application data the storer of described slave computer;
Correction verification module, for carrying out verification to writing described first application data of the storer of described slave computer;
Invalid rewriting module, for after described the first application data verification succeeds, described reprogrammed sign is changed to non-effective value, so that described slave computer, executing after reset operation enters Bootloader, makes described Bootloader give described the first application program by the control of described slave computer.
Wherein, described effective rewriting module comprises:
First sends submodule, for after described host computer and described slave computer successfully establish a communications link, the first address that sends the memory address that comprises described reprogrammed sign to described slave computer arranges indication information, to indicate described slave computer internal memory to be transmitted to the memory address of reprogrammed sign described in pointed;
Second sends submodule, for receiving at described host computer after the first address that described slave computer returns arranges successful indication information, to described slave computer, send first and download indication information, to indicate described slave computer that the reprogrammed sign of the current sensing of described internal memory transmission pointer is rewritten as to effective value;
The 3rd sends submodule, when receiving complete the first indication information of download that described slave computer returns at described host computer, again to described slave computer, send described the first address indication information is set, to indicate described slave computer described internal memory transmission pointer to be pointed to again to the memory address of described reprogrammed sign;
The 4th sends submodule, for receiving at described host computer after the first address that described slave computer returns arranges successfully indication information, to described slave computer, send first and upload indication information, to indicate described slave computer read the value of described reprogrammed sign and upload from the address of the current sensing of described internal memory transmission pointer;
First determines submodule, for receive the value of the described reprogrammed sign that slave computer returns at described host computer after, determines whether the value of described reprogrammed sign is effective value, if so, determines that described reprogrammed sign successfully rewrites.
Wherein, described update of identification information module comprises:
The 5th sends submodule, for after described host computer and described slave computer successfully establish a communications link, to described slave computer, sends the first programming startup indication information;
The 6th sends submodule, for receiving at described host computer after programming that described slave computer returns starts successful the first indication information, the second address that sends the memory address of the identification information that comprises described the second application program to described slave computer arranges indication information, to indicate described slave computer by the memory address of the identification information of the second application program described in described internal memory transmission pointed;
The 7th sends submodule, while successful indication information being set for receive the second address that described slave computer returns at described host computer, to described slave computer, send first and wipe indication information, the identification information of the second application program of locating with the address of indicating described slave computer to wipe the current sensing of described internal memory transmission pointer;
The 8th sends submodule, for at described host computer, receive that described slave computer returns wipe successful the first indication information time, again to described slave computer, send described the second address indication information is set, to indicate described slave computer described internal memory transmission pointer to be pointed to again to the memory address of the identification information of described the second application program;
The 9th sends submodule, for receiving at described host computer after the second address that described slave computer returns arranges successful indication information, the the second download indication information that comprises the identification information of described the first application program is sent to described slave computer, to indicate described slave computer the identification information of described the first application program to be downloaded to the storage address of the current sensing of described internal memory transmission pointer.
Wherein, described application data update module comprises:
The tenth sends submodule, for after described host computer and described slave computer successfully establish a communications link, to described slave computer, sends the second programming startup indication information;
The 11 sends submodule, for receiving at described host computer after programming that described slave computer returns starts successful the second indication information, the 3rd address that sends the initial memory address that comprises described the second application data to described slave computer arranges indication information, to indicate described slave computer by the initial memory address of the second application data described in described internal memory transmission pointed;
The 12 sends submodule, for receiving at described host computer after the 3rd address that described slave computer returns arranges successful indication information, to described slave computer, send second and wipe indication information, to indicate described slave computer to wipe second application data at the place, address of the current sensing of described internal memory transmission pointer;
The 13 sends submodule, for at described host computer, receive that described slave computer returns wipe successful the second indication information time, again to described slave computer, send described the 3rd address indication information is set, to indicate described slave computer described internal memory transmission pointer to be pointed to again to the initial memory address of described the second application data;
The 14 sends submodule, for receiving at described host computer after the 3rd address that described slave computer returns arranges successful indication information, to described slave computer, send the 3rd download indication information that comprises the first application data, to indicate described slave computer described the first application data to be downloaded to the storage address of the current sensing of described internal memory transmission pointer.
Wherein, described correction verification module comprises:
The 15 sends submodule, for after described host computer and described slave computer successfully establish a communications link, the four-address that sends the initial memory address that comprises the first application data to described slave computer arranges indication information, to indicate described slave computer by the initial memory address of the first application data described in described internal memory transmission pointed;
The 16 sends submodule, for receiving at described host computer after the four-address that described slave computer returns arranges successful indication information, to described slave computer, send verification indication information, to indicate described slave computer to carry out verification to described the first application data;
Described invalid rewriting module comprises:
The 17 sends submodule, when receiving the indication information of the verification succeeds that described slave computer returns at described host computer, the 5th address that sends the memory address that comprises described reprogrammed sign to described slave computer arranges indication information, to indicate described slave computer by the memory address of reprogrammed sign described in described internal memory transmission pointed;
The 18 sends submodule, while successful indication information being set for receive the 5th address that described slave computer returns at described host computer, to described slave computer, send the 4th and download indication information, with the value of indicating the described reprogrammed at the place, address of the current sensing of described internal memory transmission pointer to identify, change to non-effective value;
The 19 sends submodule, when receiving complete the 4th indication information of download that described slave computer returns at described host computer, again to described slave computer, send and comprise that described the 5th address arranges indication information, to indicate described slave computer described internal memory transmission pointer to be pointed to again to the memory address of described reprogrammed sign;
The 20 sends submodule, for receiving at described host computer after the 5th address that described slave computer returns arranges successfully indication information, to described slave computer, send second and upload indication information, to indicate described slave computer read the value of described reprogrammed sign and upload from the address of the current sensing of described internal memory transmission pointer;
Second determines submodule, for receive the value of the described reprogrammed sign that slave computer returns at described host computer after, determines whether the value of described reprogrammed sign is non-effective value, if so, determines that described reprogrammed sign successfully rewrites.
Technique scheme has following beneficial effect:
In the update method of application program provided by the invention and device, host computer is first rewritten as effective value by the reprogrammed sign of slave computer, like this, slave computer is executing after reset operation enters Bootloader, Bootloader does not give application program by the control of slave computer, then, host computer writes the identification information of the first application program the storer of slave computer, after the identification information of the first application program is write to the storer of slave computer, the first application data is write to the storer of slave computer, then the first application data writing in the storer of slave computer is carried out to verification, and after the first application data verification succeeds, reprogrammed sign is changed to non-effective value, like this, slave computer is executing after reset operation enters Bootloader, Bootloader gives the first application program by the control of slave computer, thereby realize the renewal to application program in slave computer.The update method of application program provided by the invention and device, can upgrade the application program having in the electronic control unit of Bootloader function by automobile bus.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, to the accompanying drawing of required use in embodiment or description of the Prior Art be briefly described below, apparently, accompanying drawing in the following describes is only embodiments of the invention, for those of ordinary skills, do not paying under the prerequisite of creative work, other accompanying drawing can also be provided according to the accompanying drawing providing.
The schematic flow sheet of the update method of a kind of application program that Fig. 1 provides for the embodiment of the present invention;
In the update method of the application program that Fig. 2 provides for the embodiment of the present invention, the reprogrammed sign of slave computer is rewritten as to the schematic flow sheet of the implementation of effective value;
In the update method of the application program that Fig. 3 provides for the embodiment of the present invention, the identification information of the first application program is write to the schematic flow sheet of implementation of the storer of slave computer;
In the update method of the application program that Fig. 4 provides for the embodiment of the present invention, the first application data is write to the schematic flow sheet of implementation of the storer of slave computer;
In the update method of the application program that Fig. 5 provides for the embodiment of the present invention, the first application data writing in the storer of slave computer is carried out to verification, and after the first application data verification succeeds, reprogrammed sign is changed to the schematic flow sheet of the implementation of non-effective value;
The structural representation of the updating device of the application program that Fig. 6 provides for the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
Refer to Fig. 1, the schematic flow sheet of the update method of a kind of application program providing for the embodiment of the present invention, the method is applied to host computer, and this host computer can be communicated by letter with the electronic control unit as slave computer, and the method can comprise:
Step S101: the reprogrammed sign of slave computer is rewritten as to effective value, so that slave computer is executing after reset operation enters Bootloader, makes Bootloader not give application program by the control of slave computer.
Wherein, Bootloader is one section of small routine of operation before operating system nucleus operation.By this section of small routine, can initiating hardware equipment, set up memory headroom mapping graph, thus take the hardware environment of system to a proper states, to be ready to correct environment for final call operation system kernel.In embedded system, conventionally do not have the firmware program as BIOS, therefore, the loading initiating task of whole system is just completed by Bootloader completely.
After the characteristic of Bootloader has determined that the electronic control unit as slave computer has resetted, can first enter Bootloader, now, reprogrammed sign has been revised as effective value, therefore, Bootloader can not give application program by the control of ECU, but rests in Bootloader always.
A kind of, possible in the situation that, the application program in slave computer is supported XCP agreement, now, can realize the rewriting to reprogrammed sign by the order of XCP agreement.In the situation that another kind is possible, application program in slave computer is not supported XCP agreement, now, slave computer must be able to be realized the function that assigned address (being the memory address of reprogrammed sign) is modified, and, the operation of revising reprogrammed sign must be by Event triggered, meets specific condition and just can rewrite (for example receive the special packet that host computer is sent, or receive the signal of certain special value).After reprogrammed sign is rewritten as effective value, host computer reminding user, reprogrammed sign is successfully change.
Step S102: execute after reset operation enters Bootloader at slave computer, the identification information of the first application program is write to the storer of slave computer.Wherein, the first application program is the renewal application program of the second application program in slave computer.
Before carrying out the first application data download, need to first download the identification information of the first application program, the identification information of the first application program comprises slip-stick artist's sign of the first application program, the time marking of the first application program, version information sign of the first application program etc.The identification information of the first application program may be simple one section of binary data, may be also an independently HEX file,
Wherein, slave computer can reset by house dog is overtime.
In addition, in order to guarantee after slave computer power down, the identification information of the first application program of memory stores is not lost, and the storer of slave computer is preferably nonvolatile memory.
Step S103: after the identification information of the first application program is write to the storer of slave computer, the first application data is write to the storer of slave computer.
Step S104: the first application data writing in the storer of slave computer is carried out to verification, and after the first application data verification succeeds, reprogrammed sign is changed to non-effective value, so that slave computer, executing after reset operation enters Bootloader, makes Bootloader give the first application program by the control of slave computer.
After the first application data is downloaded to the storer of slave computer, need to carry out verification to the first application data, if check results and expectation is consistent, show the first application data by correct, effectively downloaded.Afterwards, just reprogrammed sign can be revised as to non-effective value, like this, after the electronic control unit as slave computer is carried out reset operation, the control that the first application program of renewal just can electron gain control module.
In the update method of the application program that the embodiment of the present invention provides, host computer is first rewritten as effective value by the reprogrammed sign of slave computer, like this, slave computer is executing after reset operation enters Bootloader, Bootloader does not give application program by the control of slave computer, then, host computer writes the identification information of the first application program the storer of slave computer, after the identification information of the first application program is write to the storer of slave computer, the first application data is write to the storer of slave computer, then the first application data writing in the storer of slave computer is carried out to verification, and after the first application data verification succeeds, reprogrammed sign is changed to non-effective value, like this, slave computer is executing after reset operation enters Bootloader, Bootloader gives the first application program by the control of slave computer, thereby realize the renewal to application program in slave computer.The update method of the application program that the embodiment of the present invention provides, can upgrade the application program having in the electronic control unit of Bootloader function by automobile bus.In addition, the method that the embodiment of the present invention provides can be supported the multiple buses such as CAN, MOST, FlexRay.
When the application program in slave computer is supported XCP agreement, on the basis of above-described embodiment, below by the information interaction between host computer and slave computer, describe in detail, in technical scheme of the present invention, the reprogrammed sign of slave computer is rewritten as to a kind of implementation of effective value, Fig. 2 shows the schematic flow sheet of this implementation, can comprise:
Step S201: host computer sends bind command to slave computer, to set up the communication connection with slave computer.
Step S202: slave computer, after receiving bind command, returns to the response of bind command to host computer.
Wherein, the response of bind command comprises: be used to indicate the indication information whether successfully establishing a communications link.
It should be noted that, when the indication information indication in the response of bind command does not successfully establish a communications link with slave computer, end more new technological process.
Step S203: host computer, after the response that receives bind command, if determined and successfully established a communications link with slave computer by the indication information in the response of bind command, sends the first address to slave computer order is set.
Wherein, the first address arranges the memory address that order comprises reprogrammed sign, and the first address arranges order and is used to indicate slave computer by the memory address of the internal memory transmission pointed reprogrammed sign of XCP.
Step S204: slave computer arranges after order receiving the first address, transmits internal memory the memory address of pointed reprogrammed sign, then to host computer, returns to the response that the first address arranges order.
Wherein, the response that the first address arranges order comprises: the indication information that is used to indicate the memory address of whether successfully internal memory being transmitted to pointed reprogrammed sign.
It should be noted that, when the first address arranges that indication information indication slave computer in the response of order is unsuccessful transmits the memory address of pointed reprogrammed sign by internal memory, end more new technological process.
Step S205: host computer is after receiving the first address the response of order is set, if the indication information arranging in order by the first address is determined the memory address of successfully internal memory being transmitted to pointed reprogrammed sign, to slave computer, send the first download command.
Wherein, the first download command is used to indicate the reprogrammed sign that slave computer transmits the current sensing of pointer by internal memory and is rewritten as effective value.
Step S206: slave computer is after receiving the first download command, and the reprogrammed sign of internal memory being transmitted to the current sensing of pointer is rewritten as effective value, then returns to the response of the first download command to host computer.
Wherein, the response of the first download command comprises: be used to indicate the indication information whether reprogrammed sign has rewritten.
It should be noted that, when the indication information indication reprogrammed sign in the response of the first download command has not been rewritten, end more new technological process.
Step S207: host computer, when receiving the response of the first download command, if determine that by the indication information in the first download command reprogrammed sign rewritten, resends the first address to slave computer order is set.
Resending the object that the first address arranges order is, makes slave computer that internal memory is transmitted to the memory address that pointer points to reprogrammed sign again.
Step S208: slave computer arranges after order receiving the first address, transmits by internal memory the memory address that pointer points to reprogrammed sign again, then to host computer, returns to the response that the first address arranges order.
Step S209: host computer is after receiving the first address the response of order is set, if the indication information arranging in order by the first address is determined the memory address of successfully internal memory being transmitted to pointed reprogrammed sign, to slave computer, send the first upload command.
Wherein, the first upload command is used to indicate slave computer and reads the value of reprogrammed sign from the address of the current sensing of internal memory transmission pointer, and the value reading is uploaded to host computer.
Step S210: slave computer is after receiving the first upload command, and the value of reprogrammed sign is read in the address of reading the current sensing of internal memory transmission pointer, then returns to the response of the first upload command to host computer.
Wherein, the response of the first upload command comprises the value of the reprogrammed sign that slave computer reads.
Slave computer, after receiving the response of the first upload command, determines whether the value of reprogrammed sign in the response of the first upload command is effective value, if so, determines that reprogrammed sign successfully rewrites.Now, host computer can reminding user reprogrammed sign be rewritten successfully.
On the basis of above-described embodiment, below by the information interaction between host computer and slave computer, describe in detail, in technical scheme of the present invention, the identification information of the first application program is write to a kind of implementation of the storer of slave computer, Fig. 3 shows the schematic flow sheet of this implementation, can comprise:
Step S301: host computer sends bind command to slave computer, with set up and slave computer between logical
Letter connects.
Step S302: slave computer, after receiving bind command, returns to the response of bind command to host computer.
Wherein, the response of bind command comprises: be used to indicate the indication information whether successfully establishing a communications link.
It should be noted that, when the indication information indication in the response of bind command does not successfully establish a communications link with slave computer, end more new technological process.
Step S303: host computer, after the response that receives bind command, if determined and successfully established a communications link with slave computer by the indication information in the response of bind command, sends the first programming startup command to slave computer.
Step S304: slave computer, after receiving the first programming startup command, returns to the response of the first programming startup command to host computer.
Wherein, the response of the first programming startup command comprises: be used to indicate and whether allow indication information that the storer of slave computer is operated.
Step S305: host computer, after receiving the response of the first programming startup command, if determined and allowed the storer of slave computer to operate by the indication information in the first programming startup command, sends the second address to slave computer order is set.
Wherein, the second address arranges the memory address that order comprises the identification information of the second application program, and the second address arranges order and is used to indicate slave computer and internal memory transmitted to the memory address of the identification information of pointed the second application program.
Step S306: slave computer arranges after order receiving the second address, internal memory is transmitted to the memory address of the identification information of pointed the second application program, then returns to host computer the response that the second address arranges order.
Wherein, the response that the second address arranges order comprises: be used to indicate the indication information of memory address whether slave computer successfully transmits internal memory the identification information of pointed the second application program.
Step S307: host computer arranges after the response of order receiving the second address, if the indication information arranging in order by the second address determines that slave computer successfully transmits internal memory the memory address of the identification information of pointed the second application program, sends the first erase command to slave computer.
Wherein, the first erase command is used to indicate the identification information that slave computer is wiped the second application program of locating the address of the current sensing of internal memory transmission pointer.
Step S308: slave computer, after receiving the first erase command, is wiped the identification information of the second application program at the place, address of the current sensing of internal memory transmission pointer, then returns to the response of the first erase command to host computer.
Wherein, the response of the first erase command comprises: be used to indicate and whether wipe complete indication information.
Step S309: host computer, after receiving the response of the first erase command, if determine that by the indication information in the response of the first erase command the identification information of the second application program wiped completely, resends the second address to host computer order is set.
Step S310: slave computer arranges after order receiving the second address, and internal memory is transmitted to the memory address that pointer points to the identification information of the second application program again, then returns to host computer the response that the second address arranges order.
Step S311: host computer arranges after the response of order receiving the second address, if the indication information arranging in order by the second address determines that slave computer successfully transmits internal memory the memory address of the identification information of pointed the second application program, sends the second download command to slave computer.
Wherein, the second download command comprises the identification information of the first application program, and the second download command is used to indicate slave computer and the identification information of the first application program is downloaded to the storage address of the current sensing of internal memory transmission pointer.
Step S312: slave computer, after receiving the second download command, transmits the identification information write memory of the first application program in the second download command the storage address of the current sensing of pointer, and to host computer, return to the response of the second download command.
Wherein, the response of the second download command comprises: whether the identification information that is used to indicate the first application program in the second download command successfully writes in the storer of slave computer.
Step S313: host computer is after receiving the response of the second download command, if determine that by the indication information in the response of the second download command the identification information of the first application program in the second download command successfully writes the storer of slave computer, whether all identification informations of determining the first application program are downloaded complete, if so, to slave computer, send the first programming reset command.
The first programming reset command has been downloaded complete for informing all identification informations of slave computer the first application program.
It should be noted that, the identification information of the first application program may be longer, by second download command, cannot carry full detail, therefore, need to send a plurality of the second download commands.; after all identification informations that host computer is determined the first application program are not downloaded; then to slave computer, send the second download command of the identification information that carries the first application program of not downloading, until all identification informations all write the storer of slave computer.
Step S314: slave computer, after receiving the first programming reset command, returns to the response of the first programming reset command to host computer.
The identification information of the first application program is downloaded to after slave computer, is about to begin the first application data is downloaded.The first application data can be compiled the binary file that generates hex file, s19 file or other form conventionally.On the basis of above-described embodiment, below by the information interaction between host computer and slave computer, describe in detail, in technical scheme of the present invention, the first application data is write to a kind of implementation of the storer of slave computer, Fig. 4 shows the schematic flow sheet of this implementation, can comprise:
Step S401: host computer sends bind command to slave computer, to set up the communication connection with slave computer.
Step S402: slave computer, after receiving bind command, returns to the response of bind command to host computer.
Wherein, the response of bind command comprises: be used to indicate the indication information whether successfully establishing a communications link.
It should be noted that, when the indication information indication in the response of bind command does not successfully establish a communications link with slave computer, end more new technological process.
Step S403: host computer, after the response that receives bind command, if determined and successfully established a communications link with slave computer by the indication information in the response of bind command, sends the second programming startup command to slave computer.
Step S404: slave computer, after receiving the second programming startup command, returns to the response of the second programming startup command to host computer.
Wherein, the response of the second programming startup command comprises: be used to indicate and whether allow indication information that the storer of slave computer is operated.
Step S405: host computer, after receiving the response of the second programming startup command, if determined and allowed the storer of slave computer to operate by the indication information in the second programming startup command, sends the 3rd address to slave computer order is set.
Wherein, the 3rd address arranges the initial memory address that order comprises the second application data, and the 3rd address arranges order and is used to indicate slave computer and internal memory transmitted to the initial memory address of pointed the second application data.
Step S406: slave computer arranges after order receiving the 3rd address, internal memory is transmitted to the initial memory address of pointed the second application data, then returns to host computer the response that the 3rd address arranges order.
Wherein, the response that the 3rd address arranges order comprises: whether internal memory is transmitted to the indication information that pointer successfully points to the initial memory address of the second application data.
Step S407: host computer is receiving after the 3rd address arranges the response of order, if the indication information arranging by the 3rd address in the response of order determines that slave computer successfully transmits internal memory the initial memory address of pointed the second application data, sends the second erase command to slave computer.
Wherein, the second erase command is used to indicate the second application data that slave computer is wiped the place, address of the current sensing of internal memory transmission pointer.
Step S408: slave computer, after receiving the second erase command, is wiped second application data at the place, address of the current sensing of internal memory transmission pointer, then returns to the response of the second erase command to host computer.
Wherein, the response of the second erase command comprises: be used to indicate and whether wipe complete indication information.
Step S409: host computer, after receiving the response of the second erase command, if determine that by the indication information in the response of the second erase command the second application data wiped completely, resends the 3rd address to host computer order is set.
Step S410: slave computer, receiving after the 3rd address arranges order, transmits by internal memory the initial memory address that pointer points to the second application data again, then returns to host computer the response that the 3rd address arranges order.
Step S411: host computer is receiving after the 3rd address arranges the response of order, if the indication information arranging by the 3rd address in the response of order determines that slave computer successfully transmits internal memory the initial memory address of pointed the second application data, to slave computer, send the 3rd download command.
Wherein, the 3rd download command comprises the first application data, and the 3rd download command is used to indicate and slave computer is downloaded to the first application data to the storage address of the current sensing of internal memory transmission pointer.
Step S412: slave computer, after receiving the 3rd download command, by the storage address of the current sensing of the first application data write memory transmission pointer in the 3rd download command, then returns to the response of the 3rd download command to host computer.
Wherein, the response of the 3rd download command comprises: whether the first application data being used to indicate in the 3rd download command successfully writes in the storer of slave computer.
It should be noted that, the indication of indication information in the response of the 3rd download command is unsuccessful when the first application data is write to the storer of slave computer, ends more new technological process.
Step S413: host computer is after receiving the response of the 3rd download command, if determine that by the indication information in the response of the 3rd download command the first application data in the 3rd download command successfully writes the storer of slave computer, determine whether the first all application datas is downloaded complete, if so, to slave computer, send the second programming reset command.
The second programming reset command is used for informing that slave computer the first application data downloaded complete.
It should be noted that, the first application data may be longer, by the 3rd download command, cannot carry total data, therefore, need to send a plurality of the 3rd download commands.That is,, after host computer is determined the first application data and do not downloaded, then to slave computer, send the 3rd download command that carries the first application data of not downloading, until the first all application datas all writes the storer of slave computer.
Step S414: slave computer, after receiving the second programming reset command, returns to the response of the second programming reset command to host computer.
On the basis of above-described embodiment, below by the information interaction between host computer and slave computer, describe in detail, in technical scheme of the present invention, the first application data writing in the storer of slave computer is carried out to verification, and after the first application data verification succeeds, reprogrammed sign is changed to a kind of implementation of non-effective value, Fig. 5 shows the schematic flow sheet of this implementation, can comprise:
Step S501: host computer sends bind command to slave computer, to set up the communication connection with slave computer.
Step S502: slave computer, after receiving bind command, returns to the response of bind command to host computer.
Wherein, the response of bind command comprises: be used to indicate the indication whether successfully establishing a communications link
Information.
It should be noted that, when the indication information indication in the response of bind command does not successfully establish a communications link with slave computer, end more new technological process.
Step S503: host computer, after the response that receives bind command, if determined and successfully established a communications link with slave computer by the indication information in the response of bind command, sends the four-address to slave computer order is set.
Wherein, the four-address arranges the initial memory address that order comprises the first application data, and the four-address arranges order and is used to indicate slave computer and internal memory transmitted to the initial memory address of pointed the first application data.
Step S504: slave computer is receiving after the four-address arranges order, internal memory is transmitted to the initial memory address of pointed the first application data, then returns to host computer the response that the four-address arranges order.
Wherein, the response that the four-address arranges order comprises: whether successfully internal memory is transmitted to the indication information of the initial memory address of pointed the first application data.
It should be noted that, when the four-address arranges that the indication of indication information in order is unsuccessful transmits the initial memory address of pointed the first application data by internal memory, end more new technological process.
Step S505: host computer is after receiving the four-address response of order is set, if the indication information arranging by the four-address in the response of order determines that slave computer successfully transmits internal memory the initial memory address of pointed the first application data, to slave computer, send check command.
Wherein, check command comprises the byte length that needs verification.
Step S506: slave computer is after receiving check order, according to needing the byte length of verification to carry out verification to the first application data in storer in check command, after verification completes, to the response of host computer back-checking order.
Wherein, whether successfully the response of check command comprises: be used to indicate check indication information.
It should be noted that, when the indication information in check command is indicated the first application data verification succeeds, show that the first application data correctly writes, when verification is unsuccessful, end more new technological process.
Step S507: after host computer receives the response of check command, if determine verification succeeds by the indication information in the response of check command, send the 5th address to slave computer order is set.
Wherein, the 5th address arranges the memory address that order comprises reprogrammed sign, and the 5th address arranges
Order is used to indicate slave computer and internal memory is transmitted to the memory address of pointed reprogrammed sign.
Step S508: slave computer arranges after order receiving the 5th address, transmits internal memory the memory address of pointed reprogrammed sign, then to host computer, returns to the response that the 5th address arranges order.
Wherein, the response that the 5th address arranges order comprises: whether indication slave computer successfully transmits internal memory the indication information of the memory address of pointed reprogrammed sign.
It should be noted that, when the 5th address arranges that indication slave computer in the response of order is unsuccessful transmits the memory address of pointed reprogrammed sign by internal memory, end more new technological process.
Step S509: host computer is receiving after the 5th address arranges the response of order, if the indication information arranging by the 5th address in the response of order determines that slave computer successfully transmits internal memory the memory address of pointed reprogrammed sign, sends the 4th download command to slave computer.
Wherein, the 4th download command is used to indicate the value of reprogrammed sign that slave computer transmits internal memory at the address place of the current sensing of pointer and changes to non-effective value.
Step S510: slave computer is after receiving the 4th download command, and the value of reprogrammed sign of internal memory being transmitted to the address place of the current sensing of pointer changes to non-effective value, then returns to the response of the 4th download command to host computer.
Wherein, the response of the 4th download command comprises: be used to indicate the indication information whether reprogrammed sign has rewritten.
It should be noted that, when the indication information indication reprogrammed sign in the response of the 4th download command has not been rewritten, end more new technological process.
Step S511: host computer, when receiving the response of the 4th download command, if determine that by the indication information in the 4th download command reprogrammed sign rewritten, resends the 5th address to slave computer order is set.
Resending the object that the 5th address arranges order is, makes slave computer that internal memory is transmitted to the memory address that pointer points to reprogrammed sign again.
Step S512: slave computer arranges after order receiving the 5th address, transmits by internal memory the memory address that pointer points to reprogrammed sign again, then to host computer, returns to the response that the 5th address arranges order.
Step S513: host computer is receiving after the 5th address arranges the response of order, if the indication information arranging in order by the 5th address determines that slave computer successfully transmits internal memory pointed weight
The memory address of programming sign, sends the second upload command to slave computer.
Wherein, the second upload command is used to indicate slave computer and reads the value of reprogrammed sign from the address of the current sensing of internal memory transmission pointer, and the value reading is uploaded to host computer.
Step S514: slave computer is after receiving the second upload command, and the value of reprogrammed sign is read in the address of reading the current sensing of internal memory transmission pointer, then returns to the response of the second upload command to host computer.
Wherein, the response of the second upload command comprises the value of the reprogrammed sign that slave computer reads.
Step S515: host computer, after receiving the response of the second upload command, if be non-effective value by the value of reprogrammed sign in the response of definite the second upload command, send and disconnects order to slave computer.
In the response of the second upload command, the value of reprogrammed sign is during for non-effective value, and host computer determines that reprogrammed sign successfully rewrites, and now, host computer can reminding user reprogrammed identifies to be rewritten successfully.So far, the renewal of application program completes, and can restart slave computer and enter new application program, and because reprogrammed sign changes to non-effective value, therefore, the application program after renewal can obtain the control of slave computer.
Step S516: slave computer, after receiving and disconnecting order, returns to the response that disconnects order to host computer.
Corresponding with said method, the embodiment of the present invention also provides a kind of updating device of application program, be applied to host computer, host computer can be communicated by letter with the electronic control unit as slave computer, and this device can comprise: effectively rewrite module 601, update of identification information module 602, application data update module 603, correction verification module 604 and invalid rewriting module 605.Wherein:
Effectively rewrite module 601, for the reprogrammed sign of slave computer is rewritten as to effective value, so that slave computer is executing after reset operation enters Bootloader, make Bootloader by the control of slave computer, not give application program.
Update of identification information module 602, for executing at slave computer after reset operation enters Bootloader, the identification information of the first application program is write to the storer of slave computer, wherein, the first application program is the renewal application program of the second application program in slave computer.
Application data update module 603, for after the identification information of the first application program is write to the storer of slave computer, writes the first application data the storer of slave computer.
Correction verification module 604, for carrying out verification to writing the first application data of the storer of slave computer.
Invalid rewriting module 605, for after the first application data verification succeeds, reprogrammed sign is changed to non-effective value, so that slave computer is executing after reset operation enters Bootloader, make Bootloader give the first application program by the control of slave computer.
The updating device of the application program that the embodiment of the present invention provides, first the reprogrammed sign of slave computer is rewritten as to effective value, like this, slave computer is executing after reset operation enters Bootloader, Bootloader does not give application program by the control of slave computer, then, the identification information of the first application program is write to the storer of slave computer, after the identification information of the first application program is write to the storer of slave computer, the first application data is write to the storer of slave computer, then the first application data writing in the storer of slave computer is carried out to verification, and after the first application data verification succeeds, reprogrammed sign is changed to non-effective value, like this, executing after reset operation enters Bootloader, Bootloader gives the first application program by the control of slave computer, thereby realize the renewal to application program in slave computer.The updating device of the application program that the embodiment of the present invention provides, can upgrade the application program having in the electronic control unit of Bootloader function by automobile bus.
When the application program in the electronic control unit as slave computer is supported XCP agreement, in the device providing at above-described embodiment, effectively rewrite module 601 and comprise: first sends submodule, second sends submodule, the 3rd transmission submodule, the 4th transmission submodule and first definite submodule.
First sends submodule, for after host computer and slave computer successfully establish a communications link, the first address that sends the memory address that comprises reprogrammed sign to slave computer arranges indication information, to indicate slave computer by the memory address of the internal memory transmission pointed reprogrammed sign of XCP.
Second sends submodule, for receiving at host computer after the first address that slave computer returns arranges successful indication information, to slave computer, send first and download indication information, to indicate the reprogrammed sign that slave computer transmits the current sensing of pointer by internal memory to be rewritten as effective value.
The 3rd sends submodule, when receiving complete the first indication information of download that slave computer returns at host computer, again to slave computer, send the first address indication information is set, to indicate slave computer that internal memory is transmitted to the memory address that pointer points to reprogrammed sign again.
The 4th sends submodule, for receiving at host computer after the first address that slave computer returns arranges successfully indication information, to slave computer, send first and upload indication information, to indicate slave computer read the value of reprogrammed sign and upload from the address of the current sensing of internal memory transmission pointer.
First determines submodule, for receive the value of the reprogrammed sign that slave computer returns at host computer after, determines whether the value of reprogrammed sign is effective value, if so, determines that reprogrammed sign successfully rewrites.
In the device providing at above-described embodiment, update of identification information module 602 can comprise: the 5th sends submodule, the 6th sends submodule, the 7th transmission submodule, the 8th transmission submodule and the 9th transmission submodule.Wherein:
The 5th sends submodule, for after host computer and slave computer successfully establish a communications link, to slave computer, sends the first programming startup indication information.
The 6th sends submodule, for receiving at host computer after programming that slave computer returns starts successful the first indication information, the second address that sends the memory address of the identification information that comprises the second application program to slave computer arranges indication information, to indicate slave computer internal memory to be transmitted to the memory address of the identification information of pointed the second application program.
The 7th sends submodule, while successful indication information being set for receive the second address that slave computer returns at host computer, to slave computer, send first and wipe indication information, the identification information of the second application program of locating with the address of indicating slave computer to wipe the current sensing of internal memory transmission pointer.
The 8th sends submodule, for at host computer, receive that slave computer returns wipe successful the first indication information time, again to slave computer, send the second address indication information is set, to indicate slave computer that internal memory is transmitted to the memory address that pointer points to the identification information of the second application program again.
The 9th sends submodule, for receiving at host computer after the second address that slave computer returns arranges successful indication information, the the second download indication information that comprises the identification information of the first application program is sent to slave computer, to indicate slave computer the identification information of the first application program to be downloaded to the storage address of the current sensing of internal memory transmission pointer.
In the device providing at above-described embodiment, application data update module 603 can comprise: the tenth sends submodule, the 11 sends submodule, the 12 transmission submodule, the 13 transmission submodule and the 14 transmission submodule.Wherein:
The tenth sends submodule, for after host computer and slave computer successfully establish a communications link, to slave computer, sends the second programming startup indication information.
The 11 sends submodule, for receiving at host computer after programming that slave computer returns starts successful the second indication information, the 3rd address that sends the initial memory address that comprises the second application data to slave computer arranges indication information, to indicate slave computer internal memory to be transmitted to the initial memory address of pointed the second application data.
The 12 sends submodule, for receiving at host computer after the 3rd address that slave computer returns arranges successful indication information, to slave computer, send second and wipe indication information, to indicate slave computer to wipe second application data at the place, address of the current sensing of internal memory transmission pointer.
The 13 sends submodule, for at host computer, receive that slave computer returns wipe successful the second indication information time, again to slave computer, send the 3rd address indication information is set, to indicate slave computer that internal memory is transmitted to the initial memory address that pointer points to the second application data again.
The 14 sends submodule, for receiving at host computer after the 3rd address that slave computer returns arranges successful indication information, to slave computer, send the 3rd download indication information that comprises the first application data, to indicate slave computer the first application data to be downloaded to the storage address of the current sensing of internal memory transmission pointer.
In the device providing at above-described embodiment, correction verification module 604 comprises: the 15 sends submodule, the 16 sends submodule.Wherein:
The 15 sends submodule, for after host computer and slave computer successfully establish a communications link, the four-address that sends the initial memory address that comprises the first application data to slave computer arranges indication information, to indicate slave computer internal memory to be transmitted to the initial memory address of pointed the first application data.
The 16 sends submodule, for receiving at host computer after the four-address that described slave computer returns arranges successful indication information, sends verification indication information, to indicate slave computer to carry out verification to the first application data to slave computer.
In the device providing at above-described embodiment, invalid rewriting module 605 can comprise: the 17 sends submodule, the 18 sends submodule, the 19 transmission submodule, the 20 transmission submodule and second definite submodule.Wherein:
The 17 sends submodule, and when receiving the indication information of the verification succeeds that described slave computer returns at host computer, the 5th address that sends the memory address that comprises reprogrammed sign to slave computer arranges indication
Information, to indicate slave computer internal memory to be transmitted to the memory address of pointed reprogrammed sign.
The 18 sends submodule, while successful indication information being set for receive the 5th address that slave computer returns at host computer, to slave computer, send the 4th and download indication information, with the value of indicating the reprogrammed at the place, address of the current sensing of internal memory transmission pointer to identify, change to non-effective value.
The 19 sends submodule, when receiving complete the 4th indication information of download that slave computer returns at host computer, again to slave computer, send and comprise that the 5th address arranges indication information, to indicate slave computer that internal memory is transmitted to the memory address that pointer points to reprogrammed sign again.
The 20 sends submodule, for receiving at host computer after the 5th address that slave computer returns arranges successfully indication information, to slave computer, send second and upload indication information, to indicate slave computer read the value of reprogrammed sign and upload from the address of the current sensing of internal memory transmission pointer.
Second determines submodule, for receive the value of the reprogrammed sign that slave computer returns at host computer after, determines whether the value of reprogrammed sign is non-effective value, if so, determines that reprogrammed sign successfully rewrites.
In this instructions, each embodiment adopts the mode of going forward one by one to describe, and each embodiment stresses is the difference with other embodiment, between each embodiment identical similar part mutually referring to.
In the several embodiment that provide in the application, should be understood that disclosed method, device and equipment can be realized by another way.For example, device embodiment described above is only schematic, for example, the division of described unit, be only that a kind of logic function is divided, during actual realization, can have other dividing mode, for example a plurality of unit or assembly can in conjunction with or can be integrated into another system, or some features can ignore, or do not carry out.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some communication interfaces, indirect coupling or the communication connection of device or unit can be electrically, machinery or other form.
The described unit as separating component explanation can or can not be also physically to separate, and the parts that show as unit can be or can not be also physical locations, can be positioned at a place, or also can be distributed in a plurality of network element.Can select according to the actual needs some or all of unit wherein to realize the object of the present embodiment scheme.In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, can be also that the independent physics of unit exists, and also can be integrated in a unit two or more unit.
If described function usings that the form of SFU software functional unit realizes and during as production marketing independently or use, can be stored in a computer read/write memory medium.Understanding based on such, the part that technical scheme of the present invention contributes to prior art in essence in other words or the part of this technical scheme can embody with the form of software product, this computer software product is stored in a storage medium, comprise that some instructions are with so that a computer equipment (can be personal computer, server, or the network equipment etc.) carry out all or part of step of method described in each embodiment of the present invention.And aforesaid storage medium comprises: various media that can be program code stored such as USB flash disk, portable hard drive, ROM (read-only memory) (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disc or CDs.
Above-mentioned explanation to the disclosed embodiments, makes professional and technical personnel in the field can realize or use the present invention.To the multiple modification of these embodiment, will be apparent for those skilled in the art, General Principle as defined herein can, in the situation that not departing from the spirit or scope of the present invention, realize in other embodiments.Therefore, the present invention will can not be restricted to these embodiment shown in this article, but will meet the widest scope consistent with principle disclosed herein and features of novelty.

Claims (10)

1. a update method for application program, is characterized in that, is applied to host computer, and described host computer can be communicated by letter with the electronic control unit as slave computer, and described method comprises:
The reprogrammed sign of described slave computer is rewritten as to effective value, so that described slave computer is executing after reset operation enters Bootloader, makes described Bootloader by the control of described slave computer, not give application program;
At described slave computer, execute after reset operation enters Bootloader, the identification information of the first application program is write to the storer of described slave computer, the renewal application program that described the first application program is the second application program in slave computer;
After the identification information of described the first application program is write to the storer of described slave computer, the first application data is write to the storer of described slave computer;
Described the first application data writing in the storer of described slave computer is carried out to verification, and after described the first application data verification succeeds, described reprogrammed sign is changed to non-effective value, so that described slave computer, executing after reset operation enters Bootloader, makes described Bootloader give described the first application program by the control of described slave computer.
2. method according to claim 1, is characterized in that, when the application program in slave computer is supported XCP agreement, the reprogrammed sign of described slave computer is rewritten as to effective value, comprising:
After successfully establishing a communications link with described slave computer, the first address that sends the memory address that comprises described reprogrammed sign to described slave computer arranges indication information, to indicate described slave computer by the memory address of reprogrammed sign described in the internal memory transmission pointed of XCP;
Receiving after the first address that described slave computer returns arranges successful indication information, to described slave computer, send first and download indication information, to indicate described slave computer that the reprogrammed sign of the current sensing of described internal memory transmission pointer is rewritten as to effective value;
When receiving complete the first indication information of download that described slave computer returns, again to described slave computer, send described the first address indication information is set, to indicate described slave computer described internal memory transmission pointer to be pointed to again to the memory address of described reprogrammed sign;
Receiving after the first address that described slave computer returns arranges successfully indication information, to described slave computer, send first and upload indication information, to indicate described slave computer read the value of described reprogrammed sign and upload from the address of the current sensing of described internal memory transmission pointer;
After receiving the value of the described reprogrammed sign that described slave computer returns, determine whether the value of described reprogrammed sign is effective value, if so, determine that described reprogrammed sign rewrites successfully.
3. method according to claim 2, is characterized in that, the described identification information by the first application program writes the storer of described slave computer, comprising:
After successfully establishing a communications link with described slave computer, to described slave computer, send the first programming and start indication information;
Receiving after programming that described slave computer returns starts successful the first indication information, the second address that sends the memory address of the identification information that comprises described the second application program to described slave computer arranges indication information, to indicate described slave computer by the memory address of the identification information of the second application program described in described internal memory transmission pointed;
When receiving the second address that described slave computer returns successful indication information be set, to described slave computer, send first and wipe indication information, the identification information of the second application program of locating with the address of indicating described slave computer to wipe the current sensing of described internal memory transmission pointer;
Receive that described slave computer returns wipe successful the first indication information time, again to described slave computer, send described the second address indication information is set, to indicate described slave computer described internal memory transmission pointer to be pointed to again to the memory address of the identification information of described the second application program;
Receiving after the second address that described slave computer returns arranges successful indication information, the the second download indication information that comprises the identification information of described the first application program is sent to described slave computer, to indicate described slave computer the identification information of described the first application program to be downloaded to the storage address of the current sensing of described internal memory transmission pointer.
4. method according to claim 2, is characterized in that, described the first application data is write to the storer of described slave computer, comprising:
After successfully establishing a communications link with described slave computer, to described slave computer, send the second programming and start indication information;
Receiving after programming that described slave computer returns starts successful the second indication information, the 3rd address that sends the initial memory address that comprises described the second application data to described slave computer arranges indication information, to indicate described slave computer by the initial memory address of the second application data described in described internal memory transmission pointed;
Receiving after the 3rd address that described slave computer returns arranges successful indication information, to described slave computer, send second and wipe indication information, to indicate described slave computer to wipe described second application data at the place, address of the current sensing of described internal memory transmission pointer;
Receive that described slave computer returns wipe successful the second indication information time, again to described slave computer, send described the 3rd address indication information is set, to indicate described slave computer described internal memory transmission pointer to be pointed to again to the initial memory address of described the second application data;
Receiving after the 3rd address that described slave computer returns arranges successful indication information, to described slave computer, send the 3rd download indication information that comprises the first application data, to indicate described slave computer described the first application data to be downloaded to the storage address of the current sensing of described internal memory transmission pointer.
5. method according to claim 4, it is characterized in that, describedly to writing the data of described the first application program in the storer of described slave computer, carry out verification, and after the data check success to described the first application program, described reprogrammed sign is changed to non-effective value, comprising:
After successfully establishing a communications link with described slave computer, the four-address that sends the initial memory address that comprises the first application data to described slave computer arranges indication information, to indicate described slave computer by the initial memory address of the first application data described in described internal memory transmission pointed;
Receiving after the four-address that described slave computer returns arranges successful indication information, to described slave computer, send verification indication information, to indicate described slave computer to carry out verification to described the first application data;
When receiving the indication information of the verification succeeds that described slave computer returns, the 5th address that sends the memory address that comprises described reprogrammed sign to described slave computer arranges indication information, to indicate described slave computer by the memory address of reprogrammed sign described in described internal memory transmission pointed;
When receiving the 5th address that described slave computer returns successful indication information be set, to described slave computer, send the 4th and download indication information, to indicate described slave computer that the value of the described reprogrammed sign at the place, address of the current sensing of described internal memory transmission pointer is changed to non-effective value;
When receiving complete the 4th indication information of download that described slave computer returns, again to described slave computer, send and comprise that described the 5th address arranges indication information, to indicate described slave computer described internal memory transmission pointer to be pointed to again to the memory address of described reprogrammed sign;
Receiving after the 5th address that described slave computer returns arranges successfully indication information, to described slave computer, send second and upload indication information, to indicate described slave computer read the value of described reprogrammed sign and upload from the address of the current sensing of described internal memory transmission pointer;
After receiving the value of the described reprogrammed sign that slave computer returns, determine whether the value of described reprogrammed sign is non-effective value, if so, determine that described reprogrammed sign rewrites successfully.
6. a updating device for application program, is characterized in that, is applied to host computer, and described host computer can be communicated by letter with the electronic control unit as slave computer, and described device comprises:
Effectively rewrite module, for the reprogrammed sign of described slave computer is rewritten as to effective value, so that described slave computer is executing after reset operation enters Bootloader, make described Bootloader by the control of described slave computer, not give application program;
Update of identification information module, for executing at described slave computer after reset operation enters Bootloader, the identification information of the first application program is write to the storer of described slave computer, the renewal application program that described the first application program is the second application program in slave computer;
Application data update module, for after the identification information of described the first application program is write to the storer of described slave computer, writes the first application data the storer of described slave computer;
Correction verification module, for carrying out verification to writing described first application data of the storer of described slave computer;
Invalid rewriting module, for after described the first application data verification succeeds, described reprogrammed sign is changed to non-effective value, so that described slave computer, executing after reset operation enters Bootloader, makes described Bootloader give described the first application program by the control of described slave computer.
7. device according to claim 6, is characterized in that, described effective rewriting module comprises:
First sends submodule, for after described host computer and described slave computer successfully establish a communications link, the first address that sends the memory address that comprises described reprogrammed sign to described slave computer arranges indication information, to indicate described slave computer internal memory to be transmitted to the memory address of reprogrammed sign described in pointed;
Second sends submodule, for receiving at described host computer after the first address that described slave computer returns arranges successful indication information, to described slave computer, send first and download indication information, to indicate described slave computer that the reprogrammed sign of the current sensing of described internal memory transmission pointer is rewritten as to effective value;
The 3rd sends submodule, when receiving complete the first indication information of download that described slave computer returns at described host computer, again to described slave computer, send described the first address indication information is set, to indicate described slave computer described internal memory transmission pointer to be pointed to again to the memory address of described reprogrammed sign;
The 4th sends submodule, for receiving at described host computer after the first address that described slave computer returns arranges successfully indication information, to described slave computer, send first and upload indication information, to indicate described slave computer read the value of described reprogrammed sign and upload from the address of the current sensing of described internal memory transmission pointer;
First determines submodule, for receive the value of the described reprogrammed sign that slave computer returns at described host computer after, determines whether the value of described reprogrammed sign is effective value, if so, determines that described reprogrammed sign successfully rewrites.
8. device according to claim 7, is characterized in that, described update of identification information module comprises:
The 5th sends submodule, for after described host computer and described slave computer successfully establish a communications link, to described slave computer, sends the first programming startup indication information;
The 6th sends submodule, for receiving at described host computer after programming that described slave computer returns starts successful the first indication information, the second address that sends the memory address of the identification information that comprises described the second application program to described slave computer arranges indication information, to indicate described slave computer by the memory address of the identification information of the second application program described in described internal memory transmission pointed;
The 7th sends submodule, while successful indication information being set for receive the second address that described slave computer returns at described host computer, to described slave computer, send first and wipe indication information, the identification information of the second application program of locating with the address of indicating described slave computer to wipe the current sensing of described internal memory transmission pointer;
The 8th sends submodule, for at described host computer, receive that described slave computer returns wipe successful the first indication information time, again to described slave computer, send described the second address indication information is set, to indicate described slave computer described internal memory transmission pointer to be pointed to again to the memory address of the identification information of described the second application program;
The 9th sends submodule, for receiving at described host computer after the second address that described slave computer returns arranges successful indication information, the the second download indication information that comprises the identification information of described the first application program is sent to described slave computer, to indicate described slave computer the identification information of described the first application program to be downloaded to the storage address of the current sensing of described internal memory transmission pointer.
9. device according to claim 8, is characterized in that, described application data update module comprises:
The tenth sends submodule, for after described host computer and described slave computer successfully establish a communications link, to described slave computer, sends the second programming startup indication information;
The 11 sends submodule, for receiving at described host computer after programming that described slave computer returns starts successful the second indication information, the 3rd address that sends the initial memory address that comprises described the second application data to described slave computer arranges indication information, to indicate described slave computer by the initial memory address of the second application data described in described internal memory transmission pointed;
The 12 sends submodule, for receiving at described host computer after the 3rd address that described slave computer returns arranges successful indication information, to described slave computer, send second and wipe indication information, to indicate described slave computer to wipe second application data at the place, address of the current sensing of described internal memory transmission pointer;
The 13 sends submodule, for at described host computer, receive that described slave computer returns wipe successful the second indication information time, again to described slave computer, send described the 3rd address indication information is set, to indicate described slave computer described internal memory transmission pointer to be pointed to again to the initial memory address of described the second application data;
The 14 sends submodule, for receiving at described host computer after the 3rd address that described slave computer returns arranges successful indication information, to described slave computer, send the 3rd download indication information that comprises the first application data, to indicate described slave computer described the first application data to be downloaded to the storage address of the current sensing of described internal memory transmission pointer.
10. device according to claim 9, is characterized in that, described correction verification module comprises:
The 15 sends submodule, for after described host computer and described slave computer successfully establish a communications link, the four-address that sends the initial memory address that comprises the first application data to described slave computer arranges indication information, to indicate described slave computer by the initial memory address of the first application data described in described internal memory transmission pointed;
The 16 sends submodule, for receiving at described host computer after the four-address that described slave computer returns arranges successful indication information, to described slave computer, send verification indication information, to indicate described slave computer to carry out verification to described the first application data;
Described invalid rewriting module comprises:
The 17 sends submodule, when receiving the indication information of the verification succeeds that described slave computer returns at described host computer, the 5th address that sends the memory address that comprises described reprogrammed sign to described slave computer arranges indication information, to indicate described slave computer by the memory address of reprogrammed sign described in described internal memory transmission pointed;
The 18 sends submodule, while successful indication information being set for receive the 5th address that described slave computer returns at described host computer, to described slave computer, send the 4th and download indication information, with the value of indicating the described reprogrammed at the place, address of the current sensing of described internal memory transmission pointer to identify, change to non-effective value;
The 19 sends submodule, when receiving complete the 4th indication information of download that described slave computer returns at described host computer, again to described slave computer, send and comprise that described the 5th address arranges indication information, to indicate described slave computer described internal memory transmission pointer to be pointed to again to the memory address of described reprogrammed sign;
The 20 sends submodule, for receiving at described host computer after the 5th address that described slave computer returns arranges successfully indication information, to described slave computer, send second and upload indication information, to indicate described slave computer read the value of described reprogrammed sign and upload from the address of the current sensing of described internal memory transmission pointer;
Second determines submodule, for receive the value of the described reprogrammed sign that slave computer returns at described host computer after, determines whether the value of described reprogrammed sign is non-effective value, if so, determines that described reprogrammed sign successfully rewrites.
CN201410042175.9A 2014-01-28 2014-01-28 Method and device for updating application program Pending CN103744712A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410042175.9A CN103744712A (en) 2014-01-28 2014-01-28 Method and device for updating application program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410042175.9A CN103744712A (en) 2014-01-28 2014-01-28 Method and device for updating application program

Publications (1)

Publication Number Publication Date
CN103744712A true CN103744712A (en) 2014-04-23

Family

ID=50501732

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410042175.9A Pending CN103744712A (en) 2014-01-28 2014-01-28 Method and device for updating application program

Country Status (1)

Country Link
CN (1) CN103744712A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106528198A (en) * 2016-09-29 2017-03-22 陕西法士特齿轮有限责任公司 Program downloading system and program downloading method applied to automobile electric-control unit
CN107220075A (en) * 2016-03-22 2017-09-29 宝沃汽车(中国)有限公司 The update method and device of the application program of slave computer
CN109284117A (en) * 2018-09-26 2019-01-29 深圳市慧嘉智科技有限公司 Firmware upgrade method and system and flash memory microcontroller based on flash memory microcontroller
CN109857426A (en) * 2018-12-27 2019-06-07 百度在线网络技术(北京)有限公司 Bootloader method for updating program, device, electronic equipment and storage medium
CN111061500A (en) * 2019-12-31 2020-04-24 宝能汽车有限公司 bootloader program updating method and bootloader program updating device
CN112988172A (en) * 2021-02-20 2021-06-18 浙江禾川科技股份有限公司 Program updating method, device and system of encoder
CN113176891A (en) * 2021-05-10 2021-07-27 常州易控汽车电子股份有限公司 Program programming method of ECU with backup function based on Bootloader
CN114125073A (en) * 2020-06-29 2022-03-01 株洲中车时代电气股份有限公司 Data interaction method, storage medium and electronic device

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101334662A (en) * 2008-07-25 2008-12-31 重庆邮电大学 Automobile electric control unit calibration system and method based on ASAP standard
CN101621792A (en) * 2009-07-15 2010-01-06 厦门敏讯信息技术股份有限公司 Method for upgrading telesoftware of wireless fixed phone terminal
CN101699398A (en) * 2009-10-27 2010-04-28 中兴通讯股份有限公司 RFID active tag, method for upgrading software thereof and system for upgrading software thereof
CN101770384A (en) * 2010-01-18 2010-07-07 深圳市航盛电子股份有限公司 Car audio system and software upgrading method thereof
CN102109818A (en) * 2009-12-24 2011-06-29 上海帕西诺测控技术有限公司 Adaptive command processing method and system based on XCP (universal measurement and calibration protocol)
CN102135922A (en) * 2011-03-18 2011-07-27 北京经纬恒润科技有限公司 Method and system for refreshing application program
CN102289383A (en) * 2011-09-22 2011-12-21 四川长虹电器股份有限公司 Method for upgrading software of set top box
CN103136018A (en) * 2011-12-05 2013-06-05 联想(北京)有限公司 Setting method and setting system of basic input/ output system (BIOS)
CN103347095A (en) * 2013-07-22 2013-10-09 广州市交通信息中心 Wireless firmware updating method used in vehicle networking system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101334662A (en) * 2008-07-25 2008-12-31 重庆邮电大学 Automobile electric control unit calibration system and method based on ASAP standard
CN101621792A (en) * 2009-07-15 2010-01-06 厦门敏讯信息技术股份有限公司 Method for upgrading telesoftware of wireless fixed phone terminal
CN101699398A (en) * 2009-10-27 2010-04-28 中兴通讯股份有限公司 RFID active tag, method for upgrading software thereof and system for upgrading software thereof
CN102109818A (en) * 2009-12-24 2011-06-29 上海帕西诺测控技术有限公司 Adaptive command processing method and system based on XCP (universal measurement and calibration protocol)
CN101770384A (en) * 2010-01-18 2010-07-07 深圳市航盛电子股份有限公司 Car audio system and software upgrading method thereof
CN102135922A (en) * 2011-03-18 2011-07-27 北京经纬恒润科技有限公司 Method and system for refreshing application program
CN102289383A (en) * 2011-09-22 2011-12-21 四川长虹电器股份有限公司 Method for upgrading software of set top box
CN103136018A (en) * 2011-12-05 2013-06-05 联想(北京)有限公司 Setting method and setting system of basic input/ output system (BIOS)
CN103347095A (en) * 2013-07-22 2013-10-09 广州市交通信息中心 Wireless firmware updating method used in vehicle networking system

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107220075A (en) * 2016-03-22 2017-09-29 宝沃汽车(中国)有限公司 The update method and device of the application program of slave computer
CN106528198A (en) * 2016-09-29 2017-03-22 陕西法士特齿轮有限责任公司 Program downloading system and program downloading method applied to automobile electric-control unit
CN109284117A (en) * 2018-09-26 2019-01-29 深圳市慧嘉智科技有限公司 Firmware upgrade method and system and flash memory microcontroller based on flash memory microcontroller
CN109857426A (en) * 2018-12-27 2019-06-07 百度在线网络技术(北京)有限公司 Bootloader method for updating program, device, electronic equipment and storage medium
CN111061500A (en) * 2019-12-31 2020-04-24 宝能汽车有限公司 bootloader program updating method and bootloader program updating device
CN114125073A (en) * 2020-06-29 2022-03-01 株洲中车时代电气股份有限公司 Data interaction method, storage medium and electronic device
CN114125073B (en) * 2020-06-29 2023-06-13 株洲中车时代电气股份有限公司 Data interaction method, storage medium and electronic device
CN112988172A (en) * 2021-02-20 2021-06-18 浙江禾川科技股份有限公司 Program updating method, device and system of encoder
CN113176891A (en) * 2021-05-10 2021-07-27 常州易控汽车电子股份有限公司 Program programming method of ECU with backup function based on Bootloader
CN113176891B (en) * 2021-05-10 2024-06-28 常州易控汽车电子股份有限公司 Bootloader-based ECU (electronic control Unit) program programming method with backup function

Similar Documents

Publication Publication Date Title
CN103744712A (en) Method and device for updating application program
JP6390644B2 (en) Program update system, program update method, and computer program
CN109933348B (en) Method and device for updating Bootloader in electronic control unit
CN108804118B (en) Firmware upgrading method, device and storage medium
EP3200077B1 (en) Vehicle control device, reprogramming system
CN105573807A (en) ECU online program upgrading system and method based on CAN bus
KR101640207B1 (en) Bootloader and embedded system upgrade method
US8601464B2 (en) Memory online update system and method
CN110244958B (en) Method and device for updating calibration data of a vehicle
US8036786B2 (en) On-vehicle control apparatus
CN107807624B (en) Method for refreshing application program in controller
CN110825403A (en) Method and system for flashing ECU (electronic control Unit) of automobile
CN109857426A (en) Bootloader method for updating program, device, electronic equipment and storage medium
CN100507849C (en) Software on-line updating method and system
CN112181455B (en) Online upgrading method of microcontroller, microcontroller and storage medium
CN104423993A (en) Automotive electronic equipment software updating method and terminal and automotive electronic system
CN108153548A (en) A kind of EMMC firmware upgrade methods and device
CN102446101A (en) System for mandatorily upgrading firmware and method for mandatorily upgrading firmware thereof
US11449329B2 (en) Vehicle control device and program update system
US20060155941A1 (en) Program rewriting system, boot loader, storage medium, and electronic control unit
JP2012093961A (en) Control apparatus and method, and program write system
CN111459508B (en) BootLoader self-upgrading method and system
US12039322B2 (en) OTA master, center, system, update method, non-transitory storage medium, and vehicle
US20220405083A1 (en) Ota master, system, method, non-transitory storage medium, and vehicle
US20230032451A1 (en) Center, method, and non-transitory storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20140423