CN106990983A - Single-chip microcomputer programming method, device, system and single-chip microcomputer - Google Patents
Single-chip microcomputer programming method, device, system and single-chip microcomputer Download PDFInfo
- Publication number
- CN106990983A CN106990983A CN201710170442.4A CN201710170442A CN106990983A CN 106990983 A CN106990983 A CN 106990983A CN 201710170442 A CN201710170442 A CN 201710170442A CN 106990983 A CN106990983 A CN 106990983A
- Authority
- CN
- China
- Prior art keywords
- address
- chip microcomputer
- programming
- file
- data
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/60—Software deployment
- G06F8/61—Installation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/0223—User address space allocation, e.g. contiguous or non contiguous base addressing
- G06F12/023—Free address space management
- G06F12/0238—Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
- G06F12/0246—Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Stored Programmes (AREA)
Abstract
The present invention proposes a kind of single-chip microcomputer programming method, device, system and single-chip microcomputer, wherein, method includes:Obtain the file that host computer is compiled, according to the corresponding address conversion strategy of single-chip microcomputer, to the first address involved in file, carry out address conversion, obtain the second address of single-chip microcomputer, into the data volume according to single-chip microcomputer single programming, the second address location obtained in the first address conversion, data corresponding to the first address in file carry out programming.Compared in the prior art, the mode of address conversion is carried out by host computer, due to carrying out address conversion according to corresponding address conversion strategy by single-chip microcomputer in the embodiment of the present invention, so that host computer has higher versatility, the single-chip microcomputer of a variety of different chip types can be applied to, solve in the prior art, the poor technical problem of the versatility of host computer.
Description
Technical field
The present invention relates to field of computer technology, more particularly to a kind of single-chip microcomputer programming method, device, system and monolithic
Machine.
Background technology
Single-chip microcomputer is also known as single chip microcontroller, the computer miniature equivalent to one.The operation of single-chip microcomputer need to rely on
The program stored in single-chip microcomputer, in order to which the SCM program debugged is written in the storage medium of single-chip microcomputer, it is necessary to hold
The programming process of row single-chip microcomputer.So that completing corresponding function by running these programs during single-chip microcomputer startup.
, it is necessary to which the file generated to compiler is pre-processed during programming, for example, carry out address conversion and code
Filling etc..In the prior art, the step of pretreatment such as address conversion and code filling mainly being performed by host computer, due to belonging to
There is some difference in address conversion mode and filling mode for the single-chip microcomputer of different chip types, it is necessary to uses and single-chip microcomputer
The host computer matched somebody with somebody carries out programming, causes the versatility of host computer poor.
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 programming method, to solve in the prior art, on
The poor technical problem of versatility of position machine.
Second object of the present invention is to propose a kind of single-chip microcomputer programming device.
Third object of the present invention is to propose a kind of single-chip microcomputer.
Fourth object of the present invention is to propose a kind of single-chip microcomputer programming system.
For up to above-mentioned purpose, first aspect present invention embodiment proposes a kind of single-chip microcomputer programming method, methods described bag
Include following steps:
Obtain the file that host computer is compiled;The file includes the first address, and the corresponding number in first address
According to;
According to the corresponding address conversion strategy of the single-chip microcomputer, to the first address involved in the file, carry out ground
Location is changed, and obtains the second address of the single-chip microcomputer;
According to the data volume of the single-chip microcomputer single programming, the second address location obtained in first address conversion,
Data corresponding to the first address described in the file carry out programming.
The single-chip microcomputer programming method of the embodiment of the present invention, by obtaining the file that host computer is compiled after, according to monolithic
The corresponding address conversion strategy of machine, to the first address involved in file, carries out address conversion, obtains the second ground of single-chip microcomputer
Location, into the data volume according to single-chip microcomputer single programming, the second address location obtained in the first address conversion, in file the
The corresponding data in one address carry out programming.Compared in the prior art, the mode of address conversion is carried out by host computer, due to this hair
Address conversion is carried out according to corresponding address conversion strategy by single-chip microcomputer in bright embodiment so that host computer has higher lead to
With property, the single-chip microcomputer of a variety of different chip types can be applied to, the versatility for solving host computer in the prior art is poor
Technical problem.
For up to above-mentioned purpose, second aspect of the present invention embodiment proposes a kind of single-chip microcomputer programming device, described device bag
Include:
Acquisition module, for obtaining the file that host computer is compiled;The file includes the first address, and described first
The corresponding data in address;
Modular converter, for according to the corresponding address conversion strategy of the single-chip microcomputer, in the file involved the
One address, carries out address conversion, obtains the second address of the single-chip microcomputer;
Programming module, for the data volume according to the single-chip microcomputer single programming, is obtained in first address conversion
Second address location, data corresponding to the first address described in the file carry out programming.
The single-chip microcomputer programming device of the embodiment of the present invention, by obtaining the file that host computer is compiled after, according to monolithic
The corresponding address conversion strategy of machine, to the first address involved in file, carries out address conversion, obtains the second ground of single-chip microcomputer
Location, into the data volume according to single-chip microcomputer single programming, the second address location obtained in the first address conversion, in file the
The corresponding data in one address carry out programming.Compared in the prior art, the mode of address conversion is carried out by host computer, due to this hair
Address conversion is carried out according to corresponding address conversion strategy by single-chip microcomputer in bright embodiment so that host computer has higher lead to
With property, the single-chip microcomputer of a variety of different chip types can be applied to, solved in the prior art, the versatility of host computer is poor
Technical problem.
For up to above-mentioned purpose, third aspect present invention embodiment proposes a kind of single-chip microcomputer, including memory, processor and
Storage on a memory and the computer program that can run on a processor, computer program described in the computing device, with
Realize:
Obtain the file that the compiler of host computer is compiled;The file includes the first address, and first address
Corresponding data;
According to the corresponding address conversion strategy of the single-chip microcomputer, to the first address involved in the file, carry out ground
Location is changed, and obtains the second address of the single-chip microcomputer;
According to the data volume of the single-chip microcomputer single programming, the second address location obtained in first address conversion,
Data corresponding to the first address described in the file carry out programming.
For up to above-mentioned purpose, fourth aspect present invention embodiment proposes a kind of single-chip microcomputer programming system, it is characterised in that
The single-chip microcomputer programming system includes the single-chip microcomputer described in the third aspect, and is compiled for treating the program of programming
Position machine.
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 programming method that Fig. 1 is provided by the embodiment of the present invention;
Fig. 2 is the schematic flow sheet of another single-chip microcomputer programming method provided in an embodiment of the present invention;
Fig. 3 is a kind of structural representation of single-chip microcomputer programming device provided in an embodiment of the present invention;
Fig. 4 is the structural representation of another single-chip microcomputer programming device provided in an embodiment of the present invention;And
Fig. 5 is a kind of structural representation of single-chip microcomputer 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 programming method that Fig. 1 is provided by the embodiment of the present invention.
, it is necessary to generate the code that has program recorded thereon by the compiler of host computer before program code programming is entered into single-chip microcomputer,
Suffix is the file of " Hex " or " S19 ".Wherein, Hex and S19 are the form for the file that can be burnt in single-chip microcomputer, generally
Referred to as Hex files, S19 files.
On the one hand, it can just enter because the binary code address in Hex files or S19 files usually needs to be changed
Row programming, for example:Logical address is converted into physical address, is without address of caching etc. by the address conversion with caching;And
And on the other hand, the general data for wanting one-time write to meet certain data volume of storage (Flash) driving of slave computer, if Hex
Data in file or S19 files are running into address discontinuously, or Flash drivings are repeatedly write after data, last remaining
Data are accomplished by being filled when can not reach the data volume of one-time write.
In the prior art, address conversion is performed by host computer and code fills the two steps, in this case, due to
Using the single-chip microcomputer of different chip types, there is some difference in address conversion mode and filling mode, therefore, it is necessary to using
The host computer matched with single-chip microcomputer carries out programming, causes the versatility of host computer poor.
For this problem, the embodiments of the invention provide single-chip microcomputer programming method, as shown in figure 1, the single-chip microcomputer programming
Method comprises the following steps:
Step 101, the file that host computer is compiled is obtained.
Wherein, file includes the first address, and the corresponding data in the first address.File format be Hex files and/or
S19 files.Here mentioned data are specifically as follows the program code for treating programming.
Step 102, according to the corresponding address conversion strategy of single-chip microcomputer, to the first address involved in file, carry out ground
Location is changed, and obtains the second address of single-chip microcomputer.
Specifically, according to the corresponding address conversion strategy of the single-chip microcomputer, to the first address involved in the file,
The conversion between the logical address of file and the physical address of single-chip microcomputer is carried out, the second address of the single-chip microcomputer is obtained.
And/or, according to the corresponding address conversion strategy of the single-chip microcomputer, to the first address involved in the file,
Carry out file without buffer address and single-chip microcomputer containing the conversion between buffer address, obtain the second ground of the single-chip microcomputer
Location.
Step 103, the data volume according to single-chip microcomputer single programming, the second address location obtained in the first address conversion,
Data corresponding to the first address in file carry out programming.
Wherein, data volume includes the byte number of code.
Specifically, the data volume according to single-chip microcomputer single programming, reads the corresponding data in the first address in file by several times.
As a kind of possible situation, when the data volume of this reading data is less than the data volume of single-chip microcomputer single programming
When, this reading data is filled, so that the data volume of data is equal to the data of the single-chip microcomputer single programming after filling
Amount;Since second address location, programming is carried out to data after filling.
As alternatively possible situation, when the data volume of this reading data is equal to the number of the single-chip microcomputer single programming
During according to amount, since second address location, programming is carried out to this reading data.
It can be seen that in the prior art, not only needing manually to operate host computer, complex operation step, and need behaviour
Make personnel has certain understanding to Hex files and S19 files, just can correctly fill.In addition, the list based on different chip types
Piece machine, the mode of address conversion is different, the code word joint number that the Flash driving write-onces of different chips enter it is also different, it is necessary to
Host computer uses different address conversion mode and code filling mode according to different chips.And in the embodiment of the present invention, by list
Piece machine performs address conversion and code fills the two steps, and host computer only needs to parse Hex files or S19 files,
The operating procedure of host computer is reduced, the versatility of host computer is improved.
It is right according to the corresponding address conversion strategy of single-chip microcomputer by obtaining the file that host computer is compiled in the present embodiment
The first involved address in file, carries out address conversion, obtains the second address of single-chip microcomputer, is burnt into according to single-chip microcomputer single
The data volume write, the second address location obtained in the first address conversion is burnt to the corresponding data in the first address in file
Write.Compared in the prior art, the mode of address conversion is carried out by host computer, due in the embodiment of the present invention by single-chip microcomputer according to
According to corresponding address conversion strategy carry out address conversion so that host computer have higher versatility, can be applied to it is a variety of not
With the single-chip microcomputer of chip type, solve in the prior art, the poor technical problem of the versatility of host computer.
For an embodiment in clear explanation, another single-chip microcomputer programming method is present embodiments provided, Fig. 2 is the present invention
The schematic flow sheet for another single-chip microcomputer programming method that embodiment is provided.
As shown in Fig. 2 the single-chip microcomputer programming method may comprise steps of:
Step 201, single-chip microcomputer obtains the file that host computer is compiled.
Wherein, file includes the first address, and the corresponding data in the first address.
In a kind of possible application scenarios, the first address in file may be multiple, be respectively necessary for from different many
Data are carried out programming by individual first address location.
Step 202, single-chip microcomputer is according to default address conversion strategy, to the first current address, carries out address conversion, obtains
To the second address of single-chip microcomputer.
Specifically, the single-chip microcomputer of different chip types, default address conversion strategy is probably different, each monolithic
Machine, according to respective default address conversion strategy, to the first address involved in file, carry out file logical address and
Conversion between the physical address of single-chip microcomputer, furthermore it is also possible to the first address involved in file, carry out being free of for file
Buffer address and single-chip microcomputer containing the conversion between buffer address, obtain the second address of single-chip microcomputer.
For example:In Hex files, the first address location is that the code of 30 bytes of correspondence in 0xC000, file needs programming.
It is the second address 0x8000 by the first address conversion according to default address conversion strategy in single-chip microcomputer, so that single-chip microcomputer
Flash is driven since the second address 0x8000, and programming is carried out to the code of this 30 bytes.
Step 203, single-chip microcomputer reads the corresponding data in the first address in file, judges that this data volume for reading data is
The no data volume for meeting single-chip microcomputer single programming, if so, then performing step 204, otherwise performs step 207.
Specifically, the data volume of the Flash driving single programmings of single-chip microcomputer is limited, accordingly, it would be desirable to the first ground in file
The corresponding data in location carry out programming several times, accordingly, before programming each time, and single-chip microcomputer reads a certain amount of data, tool
For body, the data volume that single-chip microcomputer is read each time should be the data volume that Flash drives single programming, to meet this programming
Demand.
Certainly, when remaining data is not enough, there is data volume of the data volume less than Flash driving single programmings of reading
Situation, then need to be filled to reading data, to make it equal to the data volume that Flash drives single programming.
Step 204, when the data volume of this reading data is equal to the data volume of single-chip microcomputer single programming, from the second address
Position starts, and the data to this reading carry out programming.
Specifically, when the data volume of this reading data is equal to the data volume of single-chip microcomputer single programming, without to data
It is filled, the step of directly can performing programming.When carrying out this programming, it is necessary to since the second address location, order
Write data streams read, and the end position by programming pointer from the second address locations offset to this programming.
Step 205, judge whether programming terminates, if programming terminates, terminate this flow, if programming does not terminate, perform step
206。
In a kind of possible application scenarios, when carrying out programming to single-chip microcomputer, whole programming process is related to single-chip microcomputer
Multiple second addresses, programming may be carried out several times.
In alternatively possible application scenarios, it is necessary to which the data of programming are more since some second address location,
It can may also several times carry out programming.
Based on above both of these case, after programming each time, it is thus necessary to determine that whether whole programming process terminates.
Step 206, if the first current address is updated to next first address in file, if so, then performing
Step 202, step 203 is otherwise performed.
Specifically, if whole programming process does not terminate, there are two kinds of situations:
In the case of one kind, the first address location programming of file is completed, it is necessary to next first address bit in file
Carry out programming is put, and correspondence updates the second current address, since next second address location, to carry out burning next time
Write.
In another case, the non-programming in the first address location of file is completed, it is necessary to continuing with the first current address
Programming is carried out, without carrying out programming to next first address location in file.
When there is the previous case, it is necessary to carry out address conversion first, then perform programming step.And there are latter feelings
During condition, then programming step can be directly performed.
Step 207, judge whether that needs are filled, if so, performing step 208, otherwise perform step 209.
Specifically, when the data volume of this reading data is less than the data volume of single-chip microcomputer single programming, there are two kinds of feelings
A kind of condition, situation is that the file of host computer compiling has been sent, and after multiple programming, this needs the data volume of programming
It is not enough;Another situation is that the file of host computer compiling is not sent also, causes this to need the data volume of programming not enough.
For the first situation, it is necessary to be filled, and for second of situation, it is only necessary to wait.
Step 208, this reading data is filled, then performs step 204.
Specifically, when the data volume of this reading data is less than the data volume of the single-chip microcomputer single programming, to this
Read data to be filled, so that the data volume of data is equal to the data volume of the single-chip microcomputer single programming after filling.
For example:The code for having 30 bytes needs programming, and the data volume of single-chip microcomputer single programming is 8 bytes, that is,
Say, as the single-chip microcomputer of slave computer, Flash drivings need the code of 8 bytes of write-once, calculate and understand 30%8=6, most
Afterwards during a programming, there are 6 bytes to carry out programming, so in the case of need fill 2 bytes, add this 6 bytes, gather together enough
8 bytes carry out last time programming.
Step 209, the data in file to be received are waited, step 204 is then performed.
It is right according to the corresponding address conversion strategy of single-chip microcomputer by obtaining the file that host computer is compiled in the present embodiment
The first involved address in file, carries out address conversion, obtains the second address of single-chip microcomputer, is burnt into according to single-chip microcomputer single
The data volume write, the second address location obtained in the first address conversion is burnt to the corresponding data in the first address in file
Write.Compared in the prior art, the mode of address conversion is carried out by host computer, due in the embodiment of the present invention by single-chip microcomputer according to
According to corresponding address conversion strategy carry out address conversion so that host computer have higher versatility, can be applied to it is a variety of not
With the single-chip microcomputer of chip type, solve in the prior art, the poor technical problem of the versatility of host computer.
As a kind of possible application scenarios, the single-chip microcomputer involved by the single-chip microcomputer programming 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 programming device.
Fig. 3 is a kind of structural representation of single-chip microcomputer programming device provided in an embodiment of the present invention.
As shown in figure 3, the single-chip microcomputer programming device includes:Acquisition module 31, modular converter 32 and programming module 33.
Acquisition module 31, for obtaining the file that host computer is compiled.
Wherein, this document includes the first address, and the corresponding data in the first address.
Modular converter 32, for according to the corresponding address conversion strategy of single-chip microcomputer, to the first address involved in file,
Address conversion is carried out, the second address of single-chip microcomputer is obtained.
Specifically, modular converter 32, specifically for:According to the corresponding address conversion strategy of the single-chip microcomputer, to the text
The first involved address in part, carries out the conversion between the logical address of file and the physical address of single-chip microcomputer, obtains described
Second address of single-chip microcomputer;And/or, according to the corresponding address conversion strategy of the single-chip microcomputer, to involved in the file
First address, carry out file without buffer address and single-chip microcomputer containing the conversion between buffer address, obtain the single-chip microcomputer
The second address.
Programming module 33, for the data volume according to single-chip microcomputer single programming, the second ground obtained in the first address conversion
Location position, data corresponding to the first address in this document carry out programming.
In the present embodiment, by obtaining the file that host computer is compiled after, according to the corresponding address conversion plan of single-chip microcomputer
Slightly, to the first address involved in file, address conversion is carried out, the second address of single-chip microcomputer is obtained, into according to single-chip microcomputer
The data volume of single programming, the second address location obtained in the first address conversion, to the corresponding data in the first address in file
Carry out programming.Compared in the prior art, the mode of address conversion is carried out by host computer, due to passing through list in the embodiment of the present invention
Piece machine carries out address conversion according to corresponding address conversion strategy so that host computer has higher versatility, can be applied to
The single-chip microcomputer of a variety of different chip types, solves the poor technical problem of the versatility of host computer in the prior art.
For the single-chip microcomputer programming device that an embodiment is provided in clear explanation, further provided in the present embodiment another
A kind of single-chip microcomputer programming device, Fig. 4 is the structural representation of another single-chip microcomputer programming device provided in an embodiment of the present invention,
On the basis of a upper embodiment, further, programming module 33, including:Reading unit 331, fills unit 332 and programming unit
333。
Reading unit 331, for the data volume according to single-chip microcomputer single programming, reads the first address correspondence in file by several times
Data.
Fills unit 332, the data volume for being less than the single-chip microcomputer single programming when the data volume of this reading data
When, this reading data is filled, so that the data volume of data is equal to the data of the single-chip microcomputer single programming after filling
Amount.
Programming unit 333, for since second address location, programming to be carried out to data after the filling.
Further, programming unit 333, is additionally operable to:
When the data volume of this reading data is equal to the data volume of the single-chip microcomputer single programming, from second address
Position starts, and programming is carried out to this reading data.
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 embodiment of the present invention, by obtaining the file that host computer is compiled after, turned according to the corresponding address of single-chip microcomputer
Strategy is changed, to the first address involved in file, address conversion is carried out, obtains the second address of single-chip microcomputer, into according to single
The data volume of piece machine single programming, the second address location obtained in the first address conversion is corresponding to the first address in file
Data carry out programming.Compared in the prior art, the mode of address conversion is carried out by host computer, due to leading in the embodiment of the present invention
Cross single-chip microcomputer and carry out address conversion according to corresponding address conversion strategy so that host computer has higher versatility, Neng Goushi
For the single-chip microcomputer of a variety of different chip types, the poor technical problem of the versatility of host computer in the prior art is solved.
In order to realize above-described embodiment, the present invention also proposes a kind of single-chip microcomputer, and Fig. 5 is one kind provided in an embodiment of the present invention
The structural representation of single-chip microcomputer, as shown in figure 5, single-chip microcomputer includes memory, processor and stores on a memory and can locate
The computer program run on reason device, computer program described in the computing device, to realize:
Obtain the file that the compiler of host computer is compiled;The file includes the first address, and first address
Corresponding data;According to the corresponding address conversion strategy of the single-chip microcomputer, to the first address involved in the file, carry out
Address conversion, obtains the second address of the single-chip microcomputer;According to the data volume of the single-chip microcomputer single programming, on first ground
The second address location that location is converted to, data corresponding to the first address described in the file carry out programming.
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..
Based on this, the embodiment of the present invention additionally provides a kind of single-chip microcomputer programming system, including foregoing single-chip microcomputer and use
The host computer being compiled in the program for treating programming.
Wherein, single-chip microcomputer is connected with host computer by the communications cable.As a kind of possible implementation, single-chip microcomputer with it is upper
Between the machine of position, specifically data communication can be realized by controller LAN (Controller Area Network, CAN).
In the embodiment of the present invention, by obtaining the file that host computer is compiled after, turned according to the corresponding address of single-chip microcomputer
Strategy is changed, to the first address involved in file, address conversion is carried out, obtains the second address of single-chip microcomputer, into according to single
The data volume of piece machine single programming, the second address location obtained in the first address conversion is corresponding to the first address in file
Data carry out programming.Compared in the prior art, the mode of address conversion is carried out by host computer, due to leading in the embodiment of the present invention
Cross single-chip microcomputer and carry out address conversion according to corresponding address conversion strategy so that host computer has higher versatility, Neng Goushi
For the single-chip microcomputer of a variety of different chip types, the poor technical problem of the versatility of host computer in the prior art is solved.
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 (11)
1. a kind of single-chip microcomputer programming method, it is characterised in that methods described is performed by single-chip microcomputer, methods described includes following step
Suddenly:
The file that host computer is compiled is obtained, wherein, the file includes the first address, and the corresponding number in first address
According to;
According to the corresponding address conversion strategy of the single-chip microcomputer, to the first address involved in the file, enter row address and turn
Change, obtain the second address of the single-chip microcomputer;
According to the data volume of the single-chip microcomputer single programming, the second address location obtained in first address conversion, to institute
State the corresponding data in the first address described in file and carry out programming.
2. single-chip microcomputer programming method according to claim 1, it is characterised in that described according to the single-chip microcomputer single programming
Data volume, the second address location obtained in first address conversion is corresponding to the first address described in the file
Data carry out programming, including:
According to the data volume of the single-chip microcomputer single programming, the corresponding data in the first address in the file are read by several times;
When the data volume of this reading data is less than the data volume of the single-chip microcomputer single programming, this reading data is carried out
Filling, so that the data volume of data is equal to the data volume of the single-chip microcomputer single programming after filling;
Since second address location, programming is carried out to data after the filling.
3. single-chip microcomputer programming method according to claim 2, it is characterised in that the gradation is read first in the file
After the corresponding data in address, in addition to:
When the data volume of this reading data is equal to the data volume of the single-chip microcomputer single programming, from second address location
Start, programming is carried out to this reading data.
4. the single-chip microcomputer programming method according to claim any one of 1-3, it is characterised in that described according to the single-chip microcomputer
Corresponding address conversion strategy, to the first address involved in the file, carries out address conversion, obtains the single-chip microcomputer
Second address, including:
According to the corresponding address conversion strategy of the single-chip microcomputer, to the first address involved in the file, file is carried out
Conversion between logical address and the physical address of single-chip microcomputer, obtains the second address of the single-chip microcomputer;
And/or, according to the corresponding address conversion strategy of the single-chip microcomputer, to the first address involved in the file, carry out
File without buffer address and single-chip microcomputer containing the conversion between buffer address, obtain the second address of the single-chip microcomputer.
5. a kind of single-chip microcomputer programming device, it is characterised in that described device includes:
Acquisition module, for obtaining the file that host computer is compiled, wherein, the file includes the first address, and described the
The corresponding data in one address;
Modular converter, for according to the corresponding address conversion strategy of the single-chip microcomputer, to the first ground involved in the file
Location, carries out address conversion, obtains the second address of the single-chip microcomputer;
Programming module, for the data volume according to the single-chip microcomputer single programming, second obtained in first address conversion
Address location, data corresponding to the first address described in the file carry out programming.
6. single-chip microcomputer programming device according to claim 5, it is characterised in that the programming module, including:
Reading unit, for the data volume according to the single-chip microcomputer single programming, reads the first address pair in the file by several times
The data answered;
Fills unit, for when the data volume of this reading data is less than the data volume of the single-chip microcomputer single programming, to this
Secondary reading data are filled, so that the data volume of data is equal to the data volume of the single-chip microcomputer single programming after filling;
Programming unit, for since second address location, programming to be carried out to data after the filling.
7. single-chip microcomputer programming device according to claim 6, it is characterised in that the programming unit, is additionally operable to:
When the data volume of this reading data is equal to the data volume of the single-chip microcomputer single programming, from second address location
Start, programming is carried out to this reading data.
8. the single-chip microcomputer programming device according to claim any one of 5-7, it is characterised in that the modular converter, specifically
For:
According to the corresponding address conversion strategy of the single-chip microcomputer, to the first address involved in the file, file is carried out
Conversion between logical address and the physical address of single-chip microcomputer, obtains the second address of the single-chip microcomputer;
And/or, according to the corresponding address conversion strategy of the single-chip microcomputer, to the first address involved in the file, carry out
File without buffer address and single-chip microcomputer containing the conversion between buffer address, obtain the second address of the single-chip microcomputer.
9. a kind of single-chip microcomputer, it is characterised in that including memory, processor and store on a memory and can transport on a processor
Capable computer program, it is characterised in that computer program described in the computing device, to realize:
Obtain the file that the compiler of host computer is compiled;The file includes the first address, and first address correspondence
Data;
According to the corresponding address conversion strategy of the single-chip microcomputer, to the first address involved in the file, enter row address and turn
Change, obtain the second address of the single-chip microcomputer;
According to the data volume of the single-chip microcomputer single programming, the second address location obtained in first address conversion, to institute
State the corresponding data in the first address described in file and carry out programming.
10. single-chip microcomputer according to claim 9, it is characterised in that the single chip application in the entire car controller of vehicle,
And/or the electronic control unit of vehicle.
11. a kind of single-chip microcomputer programming system, it is characterised in that the single-chip microcomputer programming system is included such as the institute of claim 9 or 10
The single-chip microcomputer stated, and for treating the host computer that the program of programming is compiled.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710170442.4A CN106990983B (en) | 2017-03-21 | 2017-03-21 | Singlechip programming method, device and system and singlechip |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710170442.4A CN106990983B (en) | 2017-03-21 | 2017-03-21 | Singlechip programming method, device and system and singlechip |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106990983A true CN106990983A (en) | 2017-07-28 |
CN106990983B CN106990983B (en) | 2021-09-24 |
Family
ID=59412209
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710170442.4A Active CN106990983B (en) | 2017-03-21 | 2017-03-21 | Singlechip programming method, device and system and singlechip |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106990983B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108279910A (en) * | 2018-01-17 | 2018-07-13 | 珠海市杰理科技股份有限公司 | Program code programming method, apparatus, computer equipment and storage medium |
CN108491224A (en) * | 2018-07-09 | 2018-09-04 | 深圳市路畅科技股份有限公司 | A kind of vehicle-mounted Oftware updating method and system |
CN110007931A (en) * | 2019-01-21 | 2019-07-12 | 合肥市航嘉电子技术有限公司 | Programming module and its programming method |
CN113448596A (en) * | 2020-03-24 | 2021-09-28 | 上海汽车集团股份有限公司 | Vehicle controller flashing system and method and related equipment |
CN114237647A (en) * | 2021-12-20 | 2022-03-25 | 深圳市德仪电子科技有限公司 | Singlechip programming control system, singlechip and singlechip programming control method |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101030173A (en) * | 2006-02-28 | 2007-09-05 | 富士通株式会社 | Address converting apparatus |
CN103034801A (en) * | 2011-08-30 | 2013-04-10 | 马克西姆综合产品公司 | Safety microcontroller based on mode |
CN103324503A (en) * | 2013-05-29 | 2013-09-25 | 京东方科技集团股份有限公司 | Data programming system and method |
US20130297901A1 (en) * | 2012-05-01 | 2013-11-07 | Renesas Electronics Corporation | Memory protection circuit, processing unit, and memory protection method |
CN103513997A (en) * | 2012-06-21 | 2014-01-15 | 比亚迪股份有限公司 | Program recording method and system used for bus network |
CN104077166A (en) * | 2014-07-10 | 2014-10-01 | 西北工业大学 | EPCS and EPCQ storer online upgrading method based on IP core in FPGA |
CN104239916A (en) * | 2014-09-04 | 2014-12-24 | 深圳市鼎芯无限科技有限公司 | Bluetooth pairing tag programming method and programmer |
CN104268095A (en) * | 2014-09-24 | 2015-01-07 | 上海新储集成电路有限公司 | Memory and data reading/ writing operation method based on memory |
-
2017
- 2017-03-21 CN CN201710170442.4A patent/CN106990983B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101030173A (en) * | 2006-02-28 | 2007-09-05 | 富士通株式会社 | Address converting apparatus |
CN103034801A (en) * | 2011-08-30 | 2013-04-10 | 马克西姆综合产品公司 | Safety microcontroller based on mode |
US20130297901A1 (en) * | 2012-05-01 | 2013-11-07 | Renesas Electronics Corporation | Memory protection circuit, processing unit, and memory protection method |
CN103513997A (en) * | 2012-06-21 | 2014-01-15 | 比亚迪股份有限公司 | Program recording method and system used for bus network |
CN103324503A (en) * | 2013-05-29 | 2013-09-25 | 京东方科技集团股份有限公司 | Data programming system and method |
CN104077166A (en) * | 2014-07-10 | 2014-10-01 | 西北工业大学 | EPCS and EPCQ storer online upgrading method based on IP core in FPGA |
CN104239916A (en) * | 2014-09-04 | 2014-12-24 | 深圳市鼎芯无限科技有限公司 | Bluetooth pairing tag programming method and programmer |
CN104268095A (en) * | 2014-09-24 | 2015-01-07 | 上海新储集成电路有限公司 | Memory and data reading/ writing operation method based on memory |
Non-Patent Citations (3)
Title |
---|
DEYI SHI等: "Design of Microcontroller"s Display System Based on FPGA", 《2013 FOURTH INTERNATIONAL CONFERENCE ON INTELLIGENT SYSTEMS DESIGN AND ENGINEERING APPLICATIONS》 * |
张智华等: "基于双CPU和GPS定位技术的电能质量监测仪的研制", 《低压电器》 * |
李兵兵: "基于ARM-Linux的多道脉冲幅度分析器数字系统设计", 《中国优秀硕士学位论文全文数据库 工程科技Ⅱ辑》 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108279910A (en) * | 2018-01-17 | 2018-07-13 | 珠海市杰理科技股份有限公司 | Program code programming method, apparatus, computer equipment and storage medium |
CN108491224A (en) * | 2018-07-09 | 2018-09-04 | 深圳市路畅科技股份有限公司 | A kind of vehicle-mounted Oftware updating method and system |
CN108491224B (en) * | 2018-07-09 | 2022-02-11 | 深圳市路畅科技股份有限公司 | Vehicle-mounted software updating method and system |
CN110007931A (en) * | 2019-01-21 | 2019-07-12 | 合肥市航嘉电子技术有限公司 | Programming module and its programming method |
CN113448596A (en) * | 2020-03-24 | 2021-09-28 | 上海汽车集团股份有限公司 | Vehicle controller flashing system and method and related equipment |
CN114237647A (en) * | 2021-12-20 | 2022-03-25 | 深圳市德仪电子科技有限公司 | Singlechip programming control system, singlechip and singlechip programming control method |
CN114237647B (en) * | 2021-12-20 | 2022-10-14 | 深圳市德仪电子科技有限公司 | Single-chip microcomputer programming control system and single-chip microcomputer programming control method |
Also Published As
Publication number | Publication date |
---|---|
CN106990983B (en) | 2021-09-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106990983A (en) | Single-chip microcomputer programming method, device, system and single-chip microcomputer | |
CN109034814B (en) | Intelligent contract processing method and device based on Etheng virtual machine | |
CN108491224A (en) | A kind of vehicle-mounted Oftware updating method and system | |
CN105068927A (en) | Keyword drive-based automatic test method of urban rail drive control units | |
CN101916089B (en) | Configurable passenger car body control system and parameter configuration method thereof | |
CN103577308B (en) | Method for obtaining log files of mobile device | |
CN111488165B (en) | Method and system for upgrading vehicle ECU through script | |
CN109324813A (en) | Electronic control system writes with a brush dipped in Chinese ink method, apparatus and computer media | |
CN110837385A (en) | DSP application program online upgrading method based on CANopen protocol | |
CN100405325C (en) | Embedded software loading debugging method and system thereof | |
CN110990034A (en) | ECU upgrading method and system, electronic equipment and storage medium | |
CN111475174A (en) | Device and method for online writing and configuration of vehicle-mounted gateway | |
CN106648563A (en) | Method and device for dependence decoupling processing of shared module in application program | |
CN102750249B (en) | The method that host computer communicates with slave computer, Apparatus and system | |
CN107729071A (en) | A kind of method and device for initializing network interface card | |
CN105739482A (en) | Multi-vehicle-model simulation system based on Linux dynamic link library and working method thereof | |
CN110321170A (en) | Starting-up method | |
CN109992517A (en) | Firmware module adjustment method and system based on UEFI | |
CN108008959A (en) | A kind of Software Development Kit SDK cut-in methods, system and device | |
CN101667133B (en) | Method for updating firmware and chip updating firmware by using same | |
JP2000010790A (en) | System and method for unitary data structure for making global collision decision and computer program product | |
US7228527B1 (en) | Method and system for structuring a procedure | |
CN108137124A (en) | Control device, computer and communication system | |
CN108459885A (en) | A kind of method and its microcontroller of resource dispersion load | |
CN116450109A (en) | Modbus communication library adaptation method under MATLAB and CCS combined development mode |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |