CN106970892A - Single chip microcomputer operation method, device and system and single chip microcomputer - Google Patents
Single chip microcomputer operation method, device and system and single chip microcomputer Download PDFInfo
- Publication number
- CN106970892A CN106970892A CN201710169620.1A CN201710169620A CN106970892A CN 106970892 A CN106970892 A CN 106970892A CN 201710169620 A CN201710169620 A CN 201710169620A CN 106970892 A CN106970892 A CN 106970892A
- Authority
- CN
- China
- Prior art keywords
- chip microcomputer
- host computer
- boot programs
- run
- receiving
- 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.)
- Withdrawn
Links
- 238000000034 method Methods 0.000 title claims abstract description 43
- 230000004044 response Effects 0.000 claims abstract description 49
- 238000003860 storage Methods 0.000 claims abstract description 35
- 230000015654 memory Effects 0.000 claims description 20
- 230000006854 communication Effects 0.000 claims description 10
- 238000004891 communication Methods 0.000 claims description 9
- 238000004590 computer program Methods 0.000 claims description 7
- 230000008569 process Effects 0.000 abstract description 8
- 230000006870 function Effects 0.000 description 9
- 230000005540 biological transmission Effects 0.000 description 3
- 230000005611 electricity Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 235000013399 edible fruits Nutrition 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000000151 deposition Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 239000012634 fragment Substances 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 210000003733 optic disk Anatomy 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000007639 printing Methods 0.000 description 1
- 230000000284 resting effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F15/00—Digital computers in general; Data processing equipment in general
- G06F15/76—Architectures of general purpose stored program computers
- G06F15/78—Architectures of general purpose stored program computers comprising a single central processing unit
- G06F15/7828—Architectures of general purpose stored program computers comprising a single central processing unit without memory
- G06F15/7832—Architectures of general purpose stored program computers comprising a single central processing unit without memory on one IC chip (single chip microprocessors)
Landscapes
- Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Theoretical Computer Science (AREA)
- Microelectronics & Electronic Packaging (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention provides a singlechip operation method, a device and a system and a singlechip, wherein the method comprises the following steps: when the single chip microcomputer is started, the Boot program is operated, if the flag bit is not inquired in the preset storage area, the target message is sent to the upper computer of the single chip microcomputer, and when the target response returned by the upper computer is received, the Boot program is continuously operated. In the prior art, the upper computer is required to continuously send the special message, so that the single chip microcomputer can receive the special message in the process of staying in the Boot program for a short time.
Description
Technical field
The present invention relates to field of computer technology, more particularly to a kind of single-chip microcomputer operation method, device, system and monolithic
Machine.
Background technology
Single-chip microcomputer is also known as single chip microcontroller, and it is not the chip for completing some logic function, but a calculating
The machine system integration is on a chip, the computer miniature equivalent to one.The program run in single-chip microcomputer is divided into system and drawn
Lead (Boot) program, and two parts of application program.
Boot programs can be used for being updated application program, when Boot programs are updated to application program, need
Single-chip microcomputer is wanted to rest in Boot programs.In order that obtaining single-chip microcomputer can rest in Boot programs, application program normal operation
In the case of, a flag bit can be write in the nonvolatile storage of single-chip microcomputer.When the single-chip microcomputer as slave computer
After restarting, Boot programs can be inquired about the flag bit first, if in the presence of the flag bit, single-chip microcomputer can rest on Boot programs
In, wait host computer to complete for the programming process to application program update;If in the absence of the flag bit, single-chip microcomputer short time
Rest on after Boot programs, jump to the entrance of application program.
In order that application program is damaged or during in the absence of application program, single-chip microcomputer can also rest on Boot programs
In, in the prior art, using host computer when single-chip microcomputer starts, specific message is sent with very short time interval.Work as single-chip microcomputer
During short time rests on Boot programs, the specific message is received, then can be remained in Boot programs, then
Complete for the programming process to application program update.But this mode, Boot programs are rested on when starting due to single-chip microcomputer
Process it is very short, if not receiving specific message during this period of time, single-chip microcomputer can jump to the entrance of application program, cause list
Piece machine can not be rested in Boot programs.
The content of the invention
It is contemplated that at least solving one of technical problem in correlation technique to a certain extent.
Therefore, first purpose of the present invention is to propose a kind of single-chip microcomputer operation method, with solution in the prior art,
The application program of single-chip microcomputer damage or in the absence of application program in the case of, the mortality that single-chip microcomputer is rested in Boot programs
Higher technical problem.
Second object of the present invention is to propose a kind of single-chip microcomputer running gear.
Third object of the present invention is to propose a kind of single-chip microcomputer.
The 4th of the present invention aims at a kind of single-chip microcomputer runtime of proposition.
For up to above-mentioned purpose, first aspect present invention embodiment proposes a kind of method, the single-chip microcomputer operation has system
Boot programs are guided, be the described method comprises the following steps:
When the single-chip microcomputer starts, the Boot programs are run;
If the Boot programs do not inquire flag bit in default storage region, sent to the host computer of the single-chip microcomputer
Object message;
When receiving the target response of the host computer, the Boot programs are continued to run with.
The single-chip microcomputer operation method of the embodiment of the present invention, by when single-chip microcomputer starts, Boot programs being run, if Boot journeys
Sequence does not inquire flag bit in default storage region, then object message is sent to the host computer of single-chip microcomputer, with receiving
During the target response that position machine is returned, the Boot programs are continued to run with.In the prior art, it is necessary to which host computer persistently sends special report
Text, so that during the single-chip microcomputer short time rests on Boot programs, the specific message can be received, compared to existing skill
This mode in art, improves the success rate that single-chip microcomputer is rested in Boot programs, solves in the prior art, in single-chip microcomputer
Application program damage or in the absence of application program in the case of, the higher skill of mortality that single-chip microcomputer is rested in Boot programs
Art problem.
For up to above-mentioned purpose, second aspect of the present invention embodiment proposes a kind of single-chip microcomputer running gear, the single-chip microcomputer
Operation has System guides Boot programs, and described device includes:
Module is run, for when the single-chip microcomputer starts, running the Boot programs;
Sending module, if flag bit is not inquired in default storage region for the Boot programs, to the monolithic
The host computer of machine sends object message;
Receiving module, for when receiving the target response of the host computer, continuing to run with the Boot programs.
The single-chip microcomputer running gear of the embodiment of the present invention, by when single-chip microcomputer starts, Boot programs being run, if Boot journeys
Sequence does not inquire flag bit in default storage region, then object message is sent to the host computer of single-chip microcomputer, with receiving
During the target response that position machine is returned, the Boot programs are continued to run with.Compared in the prior art, it is necessary to which host computer persistently sends spy
Different message, so that during the single-chip microcomputer short time rests on Boot programs, the mode of the specific message can be received, carried
The success rate that high single-chip microcomputer is rested in Boot programs, is solved in the prior art, damage in the application program of single-chip microcomputer or
In the case of application program, the higher technical problem of mortality that single-chip microcomputer is rested in Boot programs.
For up to above-mentioned purpose, third aspect present invention embodiment proposes a kind of single-chip microcomputer, including memory, processor and
The computer program that can be run on a memory and on a processor is stored, the computer program includes System guides Boot journeys
Sequence and application program, it is characterised in that when the single-chip microcomputer starts, Boot programs described in the computing device, to realize:
If not inquiring flag bit in default storage region, object message is sent to the host computer of the single-chip microcomputer;
When receiving the target response of the host computer, the Boot programs are continued to run with.
For up to above-mentioned purpose, fourth aspect present invention embodiment proposes a kind of single-chip microcomputer runtime, the system bag
Include the single-chip microcomputer described in the third aspect, and the host computer with the single chip communication;
The host computer, for when needing to carry out programming to the single-chip microcomputer, receiving what the single-chip microcomputer was sent
After object message, target response is sent to the single-chip microcomputer.
The additional aspect of the present invention and advantage will be set forth in part in the description, and will partly become from the following description
Obtain substantially, or recognized by the practice of the present invention.
Brief description of the drawings
Of the invention above-mentioned and/or additional aspect and advantage will become from the following description of the accompanying drawings of embodiments
Substantially and be readily appreciated that, wherein:
A kind of schematic flow sheet for single-chip microcomputer operation method that Fig. 1 is provided by the embodiment of the present invention;
The schematic flow sheet for another single-chip microcomputer operation method that Fig. 2 is provided by the embodiment of the present invention;
Fig. 3 is a kind of structural representation of single-chip microcomputer running gear provided in an embodiment of the present invention;
Fig. 4 is the structural representation of another single-chip microcomputer running gear provided in an embodiment of the present invention;
Fig. 5 is a kind of structural representation of single-chip microcomputer provided in an embodiment of the present invention;And
Fig. 6 is a kind of structural representation of single-chip microcomputer runtime provided in an embodiment of the present invention
Embodiment
Embodiments of the invention are described below in detail, the example of the embodiment is shown in the drawings, wherein from beginning to end
Same or similar label represents same or similar element or the element with same or like function.Below with reference to attached
The embodiment of figure description is exemplary, it is intended to for explaining the present invention, and be not considered as limiting the invention.
Below with reference to the accompanying drawings the single-chip microcomputer operation method and device of the embodiment of the present invention described.
A kind of schematic flow sheet for single-chip microcomputer operation method that Fig. 1 is provided by the embodiment of the present invention.
Boot programs can be used for being updated application program, when Boot programs are updated to application program, need
Single-chip microcomputer is wanted to rest in Boot programs.In order that application program is damaged or during in the absence of application program, single-chip microcomputer also can
Enough rest in Boot programs, in the prior art, using host computer when single-chip microcomputer starts, send special with very short time interval
Different message.During the single-chip microcomputer short time rests on Boot programs, the specific message is received, then can be remained in
In Boot programs, then complete for the programming process to application program update.But this mode, when starting due to single-chip microcomputer
The process for resting on Boot programs is very short, if not receiving specific message during this period of time, single-chip microcomputer can jump to and apply journey
The entrance of sequence, causes single-chip microcomputer can not rest in Boot programs.
For this problem, the embodiments of the invention provide single-chip microcomputer operation method, the program of single-chip microcomputer operation includes
Boot programs and application program.As shown in figure 1, the single-chip microcomputer operation method comprises the following steps:
Step 101, when single-chip microcomputer starts, Boot programs are run.
Specifically, program storage area is provided with the memory of single-chip microcomputer, the program in program storage area point Boot programs and
Application program, is realized by Boot programs after the renewal of application program, single-chip microcomputer electrifying startup, then runs Boot journeys first
Sequence.
Step 102, if Boot programs do not inquire flag bit in default storage region, sent to the host computer of single-chip microcomputer
Object message.
Specifically, during application program normal condition, when application program needs to update, then write in default storage region
One flag bit.After single-chip microcomputer starts, Boot programs, which can then be inquired about, whether there is this flag bit in default storage region, such as
Fruit does not inquire flag bit, exists in the case of two kinds of possible situations, one kind, application program need not be updated;Another feelings
Under condition, application program missing, or application program need to update but abnormal due to occurring, it is impossible to write this flag bit.Rear
, it is necessary to continue to run with Boot programs in the case of one kind, so as to carry out application program programming based on Boot programs.
In order to when not inquiring flag bit, it is determined whether need to continue to run with Boot programs, single-chip microcomputer is sent out to host computer
Object message is sent, the response of host computer is waited, to determine the need for continuing to run with Boot programs, application program update is waited.
That is, when application program is damaged or do not have application program, application program is possibly can not be in default memory block
Interior write-in flag bit, and single-chip microcomputer is to need to continue to run with Boot programs, and programming is carried out to application program by Boot programs, because
This, even if single-chip microcomputer Boot programs are not detected by flag bit, can not also determine whether to jump to application program, it is necessary to upwards
Position machine sends object message, waits the response of host computer, is determined the need for continuing to run with Boot programs by host computer.
Wherein, there is communication connection between single-chip microcomputer and host computer, realize single-chip microcomputer to host computer based on the communication connection
Object message is sent, and host computer receives feedback response and programming after message and instructed to the single-chip microcomputer as slave computer.
The possible implementation of one of which, between single-chip microcomputer and host computer, can specifically pass through controller LAN
(Controller Area Network, CAN) realizes data communication.
Step 103, when receiving the target response of host computer, Boot programs are continued to run with.
Specifically, single-chip microcomputer inquiry then periodically sends target report less than the flag bit of application program update to host computer
Text.Host computer if desired programming application program, then can send target response after object message is received to single-chip microcomputer,
So that slave computer continues to run with Boot programs;If conversely, host computer does not need programming application program, target can be being received
After message, ignore the object message, do not send target response to single-chip microcomputer, so that slave computer Boot programs out of service, and
Jump to application program.
Correspondingly, if single-chip microcomputer is within this cycle, the target response of host computer transmission is received, then single-chip microcomputer continues to transport
Row Boot programs, and wait host computer to send programming instruction within the cycle, if host computer does not send burning within this cycle
Write command, then single-chip microcomputer machine is continued up within next cycle and sends an object message.Single-chip microcomputer can periodically send the target
Message, as long as receiving the target response of host computer within each cycle, then continues to run with Boot programs, waits burning to refer to
Order, if in a certain cycle, after single-chip microcomputer sends object message to host computer, not receiving the target response of host computer, then
Operation application program can be jumped out after the deferred run Boot programs a bit of time.
Wherein, the aforementioned communication process of single-chip microcomputer and host computer, can specifically be realized based on CAN network.CAN network is real-time
Property it is strong, the efficiency of single-chip microcomputer and host computer data communication can be improved, if there is host computer startup in CAN network, single-chip microcomputer
Just object message can be sent after startup by position machine upwards, continued to run with Boot programs after host computer response is received, waited upper
Machine sends programming instruction, if host computer is closed, single-chip microcomputer can not receive the response of host computer, then single-chip microcomputer can be from Boot journeys
Sequence jumps to application program.
In the present embodiment, by when single-chip microcomputer starts, Boot programs being run, if Boot programs are not in default storage region
Flag bit is inside inquired, then sends object message to the host computer of single-chip microcomputer, to receive the target response of host computer return
When, continue to run with the Boot programs.Compared in the prior art, it is necessary to which host computer persistently sends specific message, so that monolithic
During the machine short time rests on Boot programs, the mode of the specific message can be received, single-chip microcomputer is improved and rests on
Success rate in Boot programs, solves in the prior art, to damage or in the absence of application program in the application program of single-chip microcomputer
In the case of, the higher technical problem of mortality that single-chip microcomputer is rested in Boot programs.
For an embodiment in clear explanation, another single-chip microcomputer operation method is present embodiments provided, Fig. 2 is the present invention
The schematic flow sheet for another single-chip microcomputer operation method that embodiment is provided.
As shown in Fig. 2 the single-chip microcomputer operation method may comprise steps of:
Step 201, when single-chip microcomputer starts, Boot programs are run.
Specifically, computer program memory block, computer program therein point Boot journeys are provided with the memory of single-chip microcomputer
Sequence and application program, are realized after the renewal of application program, single-chip microcomputer electrifying startup by Boot programs, then run Boot first
Program..
Step 202, Boot programs inquiry in default storage region whether there is flag bit, and step 209 is performed if existing,
Otherwise step 203 is performed.
Specifically, it is that application program is in normal condition in the case of a kind of, when application program needs to update, then pre-
If write-in flag bit in storage region, after single-chip microcomputer restarts, Boot programs can then inquire about in default memory cell whether
There is flag bit, if inquiring flag bit, continue to run with Boot programs.If not inquiring flag bit, single-chip microcomputer by
Host computer sends object message, so as to inquire whether host computer continues to run with Boot programs and wait programming.
In another case, it is that application program is damaged or without application program, application program can not be in default memory block
Flag bit is write, and application program is to need to update.In this case, after single-chip microcomputer is restarted, Boot programs are not detected by mark
Will position, can send object message, so as to inquire whether host computer continues to run with Boot programs and wait programming to host computer.
Wherein, storage region is preset, can be non-volatile memories, including but not limited to read-only storage (ROM), it is erasable
Write programmable read only memory (EPROM) or flash memory (Flash Memory).
Wherein, the flag bit of storage region, represents the mark whether application program needs to update, can there is a variety of realization sides
Formula, possible be achieved in that of one of which is represented with numeral 0 and 1, and 0 represents and need not update, and 1 representative needs to update.
It should be noted that those skilled in the art can also represent the flag bit, the present embodiment in other ways
In the form of the flag bit is not limited.
Step 203, if Boot programs do not inquire flag bit in default storage region, to the host computer week of single-chip microcomputer
Phase property sends object message.
Specifically, object message, can there is a variety of implementations, and one of which is possible to be achieved in that:Utilize 10
The sequence of byte represents object message, for example, 0x55,0xAA, 0x55,0xAA, 0x55,0xAA, 0x55,0xAA, 0x55,0xAA
To represent object message that single-chip microcomputer is inquired to host computer, i.e., whether continue to run with Boot programs.It is somebody's turn to do when single-chip microcomputer is actively sent
Sequence is to host computer, and it is that single-chip microcomputer asks whether to continue to run with Boot programs that host computer is then resolved to after receiving.Need explanation
It is that those skilled in the art can also represent in the object message, the present embodiment to the object message in other ways
Form is not limited.
Specifically, periodically send object message and refer to single-chip microcomputer in a certain time interval, repeat to send object message.
For example, the cycle that single-chip microcomputer sends object message is 2s, after single-chip microcomputer transmission object message, the time for waiting host computer response is
1 second, if receiving host computer response, continue to run with Boot programs and wait 1 second, host computer programming instruction is waited, if do not connect
Host computer programming instruction is received, then repeats to send object message in next cycle.It should be noted that between the time in the cycle
Every that can be set by those skilled in the art, do not limited in the present embodiment.
Step 204, judge whether single-chip microcomputer receives the target response of host computer, if receiving execution step 205, otherwise perform
Step 206.
Specifically, the target response can have a variety of implementations, and the possible implementation of one of which can be with continuously
The sequences of 8 bytes represent the target response, such as 0x55,0xAA, 0x55,0xAA, 0x55,0xAA, 0x55,0xAA carrys out table
Show, after single-chip microcomputer receives the sequence of host computer transmission, resolve to and continue to run with Boot programs.It should be noted that ability
Field technique personnel can also represent the target response in other ways, it is only necessary to reduce the bit error rate, the present embodiment as far as possible
In the form of the target response is not limited.
Step 205, if single-chip microcomputer receives the target response of host computer, Boot programs are continued to run with.
Specifically, when single-chip microcomputer receives host computer target response, then explanation has application program to need to update, single-chip microcomputer
Need to continue to run with Boot programs.
Step 206, if single-chip microcomputer does not receive the target response of host computer, application program is run.
Specifically, when single-chip microcomputer does not receive host computer target response, then explanation is that no application program needs renewal, monolithic
Machine then Boot programs out of service, jump to application program entry operation application program.
Step 207, judge whether single-chip microcomputer receives the programming instruction of host computer, if receiving execution step 208, otherwise return
Receipt row step 203.
Specifically, if single-chip microcomputer receives the programming instruction of host computer, application program is upgraded by Boot programs,
If single-chip microcomputer does not receive programming instruction, position machine sends object message again up.
Step 208, single-chip microcomputer is updated by Boot programs to application program.
Step 209, if Boot programs inquire flag bit in default storage region, Boot programs are continued to run with.
Step 210, judge whether single-chip microcomputer receives the programming instruction of host computer, it is no if receiving execution step 208
Then perform step 206.
Specifically, if single-chip microcomputer receives the programming instruction of host computer, programming is carried out to application program by Boot programs,
Realization is upgraded to application program, if single-chip microcomputer does not receive programming instruction, is jumped to application program entry operation and is applied journey
Sequence.
In the present embodiment, by when single-chip microcomputer starts, Boot programs being run, if Boot programs are not in default storage region
Flag bit is inside inquired, then sends object message to the host computer of single-chip microcomputer, to receive the target response of host computer return
When, continue to run with the Boot programs.Compared in the prior art, it is necessary to which host computer persistently sends specific message, so that monolithic
During the machine short time rests on Boot programs, the mode of the specific message can be received, single-chip microcomputer is improved and rests on
Success rate in Boot programs, solves in the prior art, to damage or in the absence of application program in the application program of single-chip microcomputer
In the case of, the higher technical problem of mortality that single-chip microcomputer is rested in Boot programs.
As a kind of possible application scenarios, the single-chip microcomputer involved by the single-chip microcomputer operation method of previous embodiment can be with
Applied to the entire car controller of vehicle, and/or in the electronic control unit of vehicle.Wherein, vehicle here includes electronic vapour
Car, fuel-engined vehicle and/or hybrid vehicle.
For example:In the electronic control unit applied to electric automobile, single-chip microcomputer specifically can apply to motor control electricity
Sub-control unit, battery control electronic control unit etc..
In order to realize above-described embodiment, the present invention also proposes a kind of single-chip microcomputer running gear.
Fig. 3 is a kind of structural representation of single-chip microcomputer running gear provided in an embodiment of the present invention.
As shown in figure 3, the single-chip microcomputer running gear includes:Run module 31, sending module 32 and receiving module 33.
Module 31 is run, for when single-chip microcomputer starts, running Boot programs.
Sending module 32, if flag bit is not inquired in default storage region for Boot programs, to the upper of single-chip microcomputer
Position machine sends object message.
Receiving module 33, for when receiving the target response of host computer, continuing to run with Boot programs.
It should be noted that the foregoing explanation to embodiment of the method is also applied for the device of the embodiment, herein not
Repeat again.
In the present embodiment, single-chip microcomputer running gear includes:Module is run, for when the single-chip microcomputer starts, running institute
State Boot programs;Sending module, if flag bit is not inquired in default storage region for the Boot programs, to the list
The host computer of piece machine sends object message;Receiving module, for when receiving the target response of the host computer, continuing to run with
The Boot programs.Compared in the prior art, it is necessary to which host computer persistently sends specific message, so that the single-chip microcomputer short time stops
During staying in Boot programs, the mode of the specific message can be received, single-chip microcomputer is improved and rests in Boot programs
Success rate, solve in the prior art, single-chip microcomputer application program damage or in the absence of application program in the case of, monolithic
The higher technical problem of mortality that machine is rested in Boot programs.
Based on above-described embodiment, the embodiment of the present invention additionally provides a kind of possible realization side of single-chip microcomputer running gear
Formula, Fig. 4 is the structural representation of another single-chip microcomputer running gear provided in an embodiment of the present invention, on the basis of a upper embodiment
On, sending module 32 also includes:Running unit 321 and changing unit 322.
It is used as a kind of possible implementation, sending module 32, specifically for the host computer periodicity to the single-chip microcomputer
Send the object message.
Running unit 321, if during target response within this cycle, receiving the host computer, continuing to run with institute
State Boot programs.
Changing unit 322, if within this cycle, when not receiving the target response of the host computer, from operation institute
Boot programing changes are stated to run the application program.
It should be noted that the foregoing explanation to embodiment of the method is also applied for the device of the embodiment, herein not
Repeat again.
In the present embodiment, single-chip microcomputer running gear includes:Module is run, for when the single-chip microcomputer starts, running institute
State Boot programs;Sending module, if flag bit is not inquired in default storage region for the Boot programs, to the list
The host computer of piece machine sends object message;Receiving module, for when receiving the target response of the host computer, continuing to run with
The Boot programs.Compared in the prior art, it is necessary to which host computer persistently sends specific message, so that the single-chip microcomputer short time stops
During staying in Boot programs, the mode of the specific message can be received, single-chip microcomputer is improved and rests in Boot programs
Success rate, solve in the prior art, single-chip microcomputer application program damage or in the absence of application program in the case of, monolithic
The higher technical problem of mortality that machine is rested in Boot programs.
In order to realize above-described embodiment, the present invention also proposes a kind of single-chip microcomputer, and single-chip microcomputer includes foregoing any embodiment institute
The device stated.
Fig. 5 is a kind of structural representation of single-chip microcomputer provided in an embodiment of the present invention, as shown in figure 5, single-chip microcomputer includes depositing
Reservoir 1001, processor 1002 and storage are on a memory and the computer program 1100 that can run on a processor, the meter
Calculation machine program includes Boot programs 1112 and application program 1113, when the single-chip microcomputer starts, described in the computing device
Boot programs 1112, to realize:
If not inquiring flag bit in default storage region, object message is sent to the host computer of the single-chip microcomputer;
When receiving the target response of the host computer, the Boot programs are continued to run with.
It should be noted that the foregoing description to embodiment of the method, is also applied for the single-chip microcomputer of the embodiment of the present invention, in fact
Existing principle is similar, will not be repeated here.
As a kind of possible application scenarios, the single-chip microcomputer of the present embodiment can apply to the entire car controller of vehicle,
And/or in the electronic control unit of vehicle.Wherein, vehicle here includes electric automobile, fuel-engined vehicle and/or hybrid power
Automobile.
For example:In the electronic control unit applied to electric automobile, single-chip microcomputer specifically can apply to motor control electricity
Sub-control unit, battery control electronic control unit etc..
For clear explanation previous embodiment, the present embodiment additionally provides a kind of single-chip microcomputer runtime, and Fig. 6 is the present invention
The structural representation of one embodiment of single-chip microcomputer runtime, it is possible to achieve the flow of Fig. 1-4 illustrated embodiments of the present invention, such as
Shown in Fig. 6, the system includes the single-chip microcomputer 62 in previous embodiment, and the host computer 61 with the single chip communication.
Host computer 61, for when needing to carry out programming to the single-chip microcomputer 62, being sent receiving the single-chip microcomputer 62
Object message after, to the single-chip microcomputer 62 send target response.
Further, the host computer 61, is additionally operable to when without carrying out programming to the single-chip microcomputer 62, receiving the list
After the object message that piece machine 62 is sent, ignore the object message, do not send target response to single-chip microcomputer 62.
Specifically, host computer specifically can be with according to whether the application program to single-chip microcomputer be upgraded or write
Enter, it is determined whether need to carry out programming to single-chip microcomputer.When needing the application program to single-chip microcomputer to be upgraded or write, really
Surely need to carry out programming to single-chip microcomputer, otherwise, it determines without carrying out programming to the single-chip microcomputer.
Wherein, the communication connection between single-chip microcomputer and host computer, can be specifically that controller LAN realizes number by CAN
According to communication.
In summary, the single-chip microcomputer in the present embodiment, by when single-chip microcomputer starts, Boot programs being run, if Boot journeys
Sequence does not inquire flag bit in default storage region, then object message is sent to the host computer of single-chip microcomputer, with receiving
During the target response that position machine is returned, the Boot programs are continued to run with.Compared in the prior art, it is necessary to which host computer persistently sends spy
Different message, so that during the single-chip microcomputer short time rests on Boot programs, the mode of the specific message can be received, carried
The success rate that high single-chip microcomputer is rested in Boot programs, is solved in the prior art, damage in the application program of single-chip microcomputer or
In the case of application program, the higher technical problem of mortality that single-chip microcomputer is rested in Boot programs.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show
The description of example " or " some examples " etc. means to combine specific features, structure, material or the spy that the embodiment or example are described
Point is contained at least one embodiment of the present invention or example.In this manual, to the schematic representation of above-mentioned term not
Identical embodiment or example must be directed to.Moreover, specific features, structure, material or the feature of description can be with office
Combined in an appropriate manner in one or more embodiments or example.In addition, in the case of not conflicting, the skill of this area
Art personnel can be tied the not be the same as Example or the feature of example and non-be the same as Example or example described in this specification
Close and combine.
In addition, term " first ", " second " are only used for describing purpose, and it is not intended that indicating or implying relative importance
Or the implicit quantity for indicating indicated technical characteristic.Thus, define " first ", the feature of " second " can express or
Implicitly include at least one this feature.In the description of the invention, " multiple " are meant that at least two, such as two, three
It is individual etc., unless otherwise specifically defined.
Any process described otherwise above or method description are construed as in flow chart or herein, represent to include
Module, fragment or the portion of the code of one or more executable instructions for the step of realizing custom logic function or process
Point, and the scope of the preferred embodiment of the present invention includes other realization, wherein can not be by shown or discussion suitable
Sequence, including according to involved function by it is basic simultaneously in the way of or in the opposite order, carry out perform function, this should be of the invention
Embodiment person of ordinary skill in the field understood.
Represent in flow charts or logic and/or step described otherwise above herein, for example, being considered use
In the order list for the executable instruction for realizing logic function, it may be embodied in any computer-readable medium, for
Instruction execution system, device or equipment (such as computer based system including the system of processor or other can be held from instruction
The system of row system, device or equipment instruction fetch and execute instruction) use, or combine these instruction execution systems, device or set
It is standby and use.For the purpose of this specification, " computer-readable medium " can any can be included, store, communicate, propagate or pass
Defeated program is for instruction execution system, device or equipment or the dress for combining these instruction execution systems, device or equipment and using
Put.The more specifically example (non-exhaustive list) of computer-readable medium includes following:Electricity with one or more wirings
Connecting portion (electronic installation), portable computer diskette box (magnetic device), random access memory (RAM), read-only storage
(ROM), erasable edit read-only storage (EPROM or flash memory), fiber device, and portable optic disk is read-only deposits
Reservoir (CDROM).In addition, can even is that can be in the paper of printing described program thereon or other are suitable for computer-readable medium
Medium, because can then enter edlin, interpretation or if necessary with it for example by carrying out optical scanner to paper or other media
His suitable method is handled electronically to obtain described program, is then stored in computer storage.
It should be appreciated that each several part of the present invention can be realized with hardware, software, firmware or combinations thereof.Above-mentioned
In embodiment, the software that multiple steps or method can in memory and by suitable instruction execution system be performed with storage
Or firmware is realized.Such as, if realized with hardware with another embodiment, following skill well known in the art can be used
Any one of art or their combination are realized:With the logic gates for realizing logic function to data-signal from
Scattered logic circuit, the application specific integrated circuit with suitable combinational logic gate circuit, programmable gate array (PGA), scene can be compiled
Journey gate array (FPGA) etc..
Those skilled in the art are appreciated that to realize all or part of step that above-described embodiment method is carried
Rapid to can be by program to instruct the hardware of correlation to complete, described program can be stored in a kind of computer-readable storage medium
In matter, the program upon execution, including one or a combination set of the step of embodiment of the method.
In addition, each functional unit in each embodiment of the invention can be integrated in a processing module, can also
That unit is individually physically present, can also two or more units be integrated in a module.Above-mentioned integrated mould
Block can both be realized in the form of hardware, it would however also be possible to employ the form of software function module is realized.The integrated module is such as
Fruit is realized using in the form of software function module and as independent production marketing or in use, can also be stored in a computer
In read/write memory medium.
Storage medium mentioned above can be read-only storage, disk or CD etc..Although having been shown and retouching above
Embodiments of the invention are stated, it is to be understood that above-described embodiment is exemplary, it is impossible to be interpreted as the limit to the present invention
System, one of ordinary skill in the art can be changed to above-described embodiment, change, replace and become within the scope of the invention
Type.
Claims (13)
1. a kind of single-chip microcomputer operation method, it is characterised in that the single-chip microcomputer operation has System guides Boot programs, methods described
Comprise the following steps:
When the single-chip microcomputer starts, the Boot programs are run;
If the Boot programs do not inquire flag bit in default storage region, target is sent to the host computer of the single-chip microcomputer
Message;
When receiving the target response of the host computer, the Boot programs are continued to run with.
2. single-chip microcomputer operation method according to claim 1, it is characterised in that the host computer to the single-chip microcomputer is sent out
Object message is sent, including:
Periodically the object message is sent to the host computer of the single-chip microcomputer.
3. single-chip microcomputer operation method according to claim 2, it is characterised in that described when the mesh for receiving the host computer
During mark response, the Boot programs are continued to run with, including:
If within this cycle, when receiving the target response of the host computer, continuing to run with the Boot programs.
4. single-chip microcomputer operation method according to claim 2, it is characterised in that described periodically to be sent to the single-chip microcomputer
After the object message, in addition to:
If being operation from the Boot programing changes are run when not receiving the target response of the host computer within this cycle
The application program.
5. the single-chip microcomputer operation method according to claim any one of 1-4, it is characterised in that the flag bit is described answers
With program it is to be updated when, in the non-volatile memory medium for writing the single-chip microcomputer;
It is described continue to run with the Boot programs after, in addition to:
When the programming for receiving the host computer is instructed, the application program is updated by the Boot programs.
6. a kind of single-chip microcomputer running gear, it is characterised in that the single-chip microcomputer operation has System guides Boot programs, described device
Including:
Module is run, for when the single-chip microcomputer starts, running the Boot programs;
Sending module, if flag bit is not inquired in default storage region for the Boot programs, to the single-chip microcomputer
Host computer sends object message;
Receiving module, for when receiving the target response of the host computer, continuing to run with the Boot programs.
7. single-chip microcomputer running gear according to claim 6, it is characterised in that the sending module, specifically for:
Periodically the object message is sent to the host computer of the single-chip microcomputer.
8. single-chip microcomputer running gear according to claim 7, it is characterised in that the receiving module, including:
Running unit, if during target response within this cycle, receiving the host computer, continuing to run with the Boot journeys
Sequence.
9. single-chip microcomputer running gear according to claim 7, it is characterised in that the receiving module, in addition to:
Changing unit, if within this cycle, when not receiving the target response of the host computer, from the operation Boot journeys
Sequence is changed to run the application program.
10. the single-chip microcomputer running gear according to claim any one of 6-9, it is characterised in that the flag bit is described
When application program is to be updated, in the non-volatile memory medium for writing the single-chip microcomputer;
Described device, in addition to:
Programming module, for when the programming for receiving the host computer is instructed, by the Boot programs to the application journey
Sequence is updated.
11. a kind of single-chip microcomputer, it is characterised in that including memory, processor and store on a memory and can be on a processor
The computer program of operation, the computer program includes System guides Boot programs and application program, it is characterised in that in institute
When stating single-chip microcomputer startup, Boot programs described in the computing device, to realize:
If not inquiring flag bit in default storage region, object message is sent to the host computer of the single-chip microcomputer;
When receiving the target response of the host computer, the Boot programs are continued to run with.
12. single-chip microcomputer according to claim 11, it is characterised in that the single chip application is in the full-vehicle control of vehicle
Device, and/or vehicle electronic control unit.
13. a kind of single-chip microcomputer runtime, it is characterised in that the system includes the monolithic as described in claim 11 or 12
Machine, and the host computer with the single chip communication;
The host computer, for when needing to carry out programming to the single-chip microcomputer, receiving the target that the single-chip microcomputer is sent
After message, target response is sent to the single-chip microcomputer.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710169620.1A CN106970892A (en) | 2017-03-21 | 2017-03-21 | Single chip microcomputer operation method, device and system and single chip microcomputer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710169620.1A CN106970892A (en) | 2017-03-21 | 2017-03-21 | Single chip microcomputer operation method, device and system and single chip microcomputer |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106970892A true CN106970892A (en) | 2017-07-21 |
Family
ID=59329246
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710169620.1A Withdrawn CN106970892A (en) | 2017-03-21 | 2017-03-21 | Single chip microcomputer operation method, device and system and single chip microcomputer |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106970892A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102253849A (en) * | 2011-06-08 | 2011-11-23 | 重庆金美通信有限责任公司 | Intelligent boot loader based on controller area network (CAN) bus |
CN102314363A (en) * | 2011-07-27 | 2012-01-11 | 深圳市航盛电子股份有限公司 | Booting method of automobile controller and automobile controller |
CN104657160A (en) * | 2013-11-21 | 2015-05-27 | 联创汽车电子有限公司 | Multichip application burning method of vehicle-mounted controller |
CN104898637A (en) * | 2015-03-27 | 2015-09-09 | 北京经纬恒润科技有限公司 | Vehicle controller self-refreshing method and system |
-
2017
- 2017-03-21 CN CN201710169620.1A patent/CN106970892A/en not_active Withdrawn
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102253849A (en) * | 2011-06-08 | 2011-11-23 | 重庆金美通信有限责任公司 | Intelligent boot loader based on controller area network (CAN) bus |
CN102314363A (en) * | 2011-07-27 | 2012-01-11 | 深圳市航盛电子股份有限公司 | Booting method of automobile controller and automobile controller |
CN104657160A (en) * | 2013-11-21 | 2015-05-27 | 联创汽车电子有限公司 | Multichip application burning method of vehicle-mounted controller |
CN104898637A (en) * | 2015-03-27 | 2015-09-09 | 北京经纬恒润科技有限公司 | Vehicle controller self-refreshing method and system |
Non-Patent Citations (1)
Title |
---|
王琦: "基于CAN总线的Bootloader研究与实现", 《中国优秀硕士学位论文全文数据库工程科技Ⅱ辑》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102591676B (en) | The online updating method of vehicle-mounted machine | |
RU2669526C2 (en) | Method for reflashing electronic modules and a vehicle | |
CN102495744B (en) | Control software upgrading method of electronic control devices of electric automobile based on controller area network (CAN) bus | |
CN111488165B (en) | Method and system for upgrading vehicle ECU through script | |
CN103777972B (en) | System, configuration method based on field programmable gate array and upgrade method | |
CN104081726A (en) | Train-information management device and method for selecting control software therefor | |
CN111831297B (en) | Zero-difference upgrading method and device | |
CN106990983A (en) | Singlechip programming method, device and system and singlechip | |
CN108241494A (en) | Vehicle Electronic Control Unit upgrade method, device, vehicle control electronics and vehicle | |
CN204155295U (en) | Card access device and card intelligent control system | |
CN109165055A (en) | A kind of component loading method, device, computer equipment and storage medium | |
CN107329784A (en) | Firmware upgrade method and Distributed-tier system | |
CN107357595A (en) | A kind of multiple driver firmware online updating system based on bus | |
US20230211694A1 (en) | Method and device for controlling vehicle charging and vehicle | |
CN104346179A (en) | Embedded system and method for remote upgrade by use of CAN bus | |
CN105446762B (en) | The method for updating program and program updating system of battery management system | |
CN110119286A (en) | A kind of firmware guidance implementation method based on simulation Flash chip | |
CN103010039A (en) | Boot loading method of battery management systems | |
CN106970892A (en) | Single chip microcomputer operation method, device and system and single chip microcomputer | |
AU2006337975B2 (en) | Method for storing a data block containing data for controlling a technical process, and control and automation apparatus | |
CN1321388C (en) | Electronic control unit | |
CN106201617A (en) | A kind of method and system of burning memorizer | |
CN109525452A (en) | Car networking function detecting method and device | |
CN109766116A (en) | A kind of multicore control assembly based on CAN communication guides upgrade method online | |
CN102110002B (en) | Method for increasing starting speed of electronic device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20170721 |