CN106802811A - program writing method and device - Google Patents

program writing method and device Download PDF

Info

Publication number
CN106802811A
CN106802811A CN201611075581.0A CN201611075581A CN106802811A CN 106802811 A CN106802811 A CN 106802811A CN 201611075581 A CN201611075581 A CN 201611075581A CN 106802811 A CN106802811 A CN 106802811A
Authority
CN
China
Prior art keywords
initial address
program
address
write
storage region
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
Application number
CN201611075581.0A
Other languages
Chinese (zh)
Other versions
CN106802811B (en
Inventor
史文森
赵轶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Silicon Valley Analog Suzhou Semiconductor Co ltd
Analogix International LLC
Original Assignee
Analogix Semiconductor Beijing Inc
Analogix International LLC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Analogix Semiconductor Beijing Inc, Analogix International LLC filed Critical Analogix Semiconductor Beijing Inc
Priority to CN201611075581.0A priority Critical patent/CN106802811B/en
Publication of CN106802811A publication Critical patent/CN106802811A/en
Application granted granted Critical
Publication of CN106802811B publication Critical patent/CN106802811B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Abstract

The invention discloses a kind of program writing method and device.The method includes:The first initial address of the first program for having been written into storage region is obtained from reserved area, wherein, storage region is the storage region in disposal programmable device, multiple reserved areas are reserved in storage region, each reserved area is used to be stored in the initial address of the program stored in storage region;Obtain in storage region close to the address that can write the second program after the first program;The second initial address is obtained, wherein, the value of the second initial address meets following condition:More than or equal to the address that can write the second program and it is possible to write in the address of the second program and 0 is revised as what can be obtained after 1;0 in the first initial address in reserved area is revised as 1 according to the second initial address;The second program is write from the second initial address.By the present invention, burning number of times in OTP program origins is limited in solving the problems, such as correlation technique.

Description

Program writing method and device
Technical field
The present invention relates to computer realm, in particular to a kind of program writing method and device.
Background technology
In One Time Programmable (One Time Programmable, referred to as OTP) program, the renewal of each secondary program, It is required for recording current program origin, when updating next time, can be according to the initial address of OTP and the length of program Degree (length can be read from original program), and then calculate new initial address.It is disposable due to OTP, therefore the content of OTP 1 can only be write, it is impossible to write 0.But the structure of current OTP only supports the mode of advance reservation OTP initial addresses, Fig. 1 is according to this The schematic diagram of a kind of OTP initial addresses record of invention first embodiment, if as shown in figure 1, wanting burning 16 times, it is necessary in advance 16words spaces are reserved in the beginning part of OTP to record the initial address of present procedure, once 16 burnings are finished, OTP will Cannot logging program initial address, cause it to upgrade again.
By taking current OTP structures as an example, word0 to word0012 is the 16 row words of OPT, and word0 (the first row word) is all 0, word1ring ctrl is used for calibration chip internal clocking, and Res is used for calibrating internal prevention.In Fig. 1, chip id high/ Chip id low are used to record new chip ID titles.Word 0 and word 1 are fixed contents, will not relate to OTP The renewal of program.From the initial address of word2 start recording programs.fw start address low/fw start Address high, have recorded present procedure should run from which word, such as fw start address low= 0x0a, fw start address high=0x09, it means that present procedure needs to be brought into operation from Word 0x90a.
In order to ensure that program can be run 16 times, so word 0x02~word 0x12, are reserved into 0x00, In OTP first time burnings, real program brings into operation from word 0x12, and fw start address low are written to 0x12, fw start address high are written to 0x00.Fig. 2 is a kind of OTP starting points according to a second embodiment of the present invention The schematic diagram of location record, as shown in Fig. 2 when second burning of OTP, (all being write word1 erasings as 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff), re-write new initial address in word3.
The OTP of prior art can only burning 16 times, once burning is finished will be unable to logging program initial address, cause its nothing Method is upgraded again.
For the problem that burning number of times in OTP program origins in correlation technique is limited, effective solution is not yet proposed at present Certainly scheme.
The content of the invention
It is initial with OTP programs in solving correlation technique it is a primary object of the present invention to provide a kind of program writing method The limited problem of address burning number of times.
To achieve these goals, according to an aspect of the invention, there is provided a kind of program writing method, the method bag Include:The first initial address of the first program for having been written into storage region is obtained from reserved area, wherein, the memory block Domain is the storage region in disposal programmable device, multiple reserved areas has been reserved in the storage region, each trough Domain is used to be stored in the initial address of the program stored in the storage region;Obtain in the storage region close to described The address that can write the second program after first program;The second initial address is obtained, wherein, second initial address Value meets following condition:More than or equal to the address that can write second program and by 0 in first initial address It is revised as what can be obtained after 1;0 in the first initial address in the reserved area is repaiied according to second initial address It is changed to 1;Second program is write from second initial address.
Further, obtaining the second initial address includes:Determine one or more 0 modifications in first initial address It is the modified values that can be obtained after 1;Calculate the difference of the modified values and the address that second program can be write;Really Numerical value is the modified values just and corresponding to the difference of minimum in the fixed difference;Using the corresponding modified values as institute State the second initial address.
Further, after the difference of the modified values with the address that can write second program is calculated, Methods described also includes:If the difference is negative, the storage region after the storage region of first initial address Interior write-in second initial address.
Further, the second program can be write close to after first program in the storage region obtaining Address after, methods described also includes:Default invalidation word joint number is obtained, wherein, the invalidation word joint number is disposably may be used Byte number at most idle between two initial addresses of program in storage region in programming device;Judge second starting Whether idle byte number is less than or equal to most free word joint numbers between address and first initial address;If described Idle byte number is less than or equal to most free word joint numbers between second initial address and first initial address, then from Second initial address writes second program;If empty between second initial address and first initial address Not busy byte number is more than most free word joint numbers, then the end of first initial address is wiped according to the byte number having more Position, writes second program at position after being erased.
Further, obtaining the second initial address includes:First initial address can be write described with described The address of two programs is carried out or computing, is obtained or operation result;Using described or operation result value as second starting point Location.
To achieve these goals, according to another aspect of the present invention, a kind of program writing station, the device are additionally provided Including:First acquisition unit, the first starting for obtaining the first program for having been written into storage region from reserved area Address, wherein, the storage region is the storage region in disposal programmable device, and multiple has been reserved in the storage region Reserved area, each reserved area is used to be stored in the initial address of the program stored in the storage region;Second obtains Unit, for obtaining in the storage region close to the address that can write the second program after first program;The Three acquiring units, for obtaining the second initial address, wherein, the value of second initial address meets following condition:More than etc. It is revised as what can be obtained after 1 in the address that can write second program and by 0 in first initial address; Modification unit, for 0 in the first initial address in the reserved area to be revised as into 1 according to second initial address; First writing unit, for writing second program from second initial address.
Further, the 3rd acquiring unit includes:First determining module, for determining first initial address in One or more 0 be revised as the modified values that can be obtained after 1;First computing module, for calculate the modified values with it is described The difference of the address of second program can be write;Second determining module, for determining that numerical value is for just and most in the difference The modified values corresponding to small difference;Modified module, for initial using the corresponding modified values as described second Address.
Further, described device also includes:Second writing unit, for that can be write with described in the calculating modified values After the difference of the address for entering second program, if the difference is negative, in the storage of first initial address Write-in second initial address in storage region behind region.
Further, described device also includes:4th acquiring unit, for obtaining in the storage region close to institute State after the address that can write the second program after the first program, obtain default invalidation word joint number, wherein, it is described invalid Byte number is byte numbers at most idle between two initial addresses of program in the storage region in disposal programmable device; Judging unit, for judging whether byte number idle between second initial address and first initial address is less than In most free word joint numbers;3rd writing unit, for second initial address and first initial address it Between idle byte number when being less than or equal to most free word joint numbers, write second journey from second initial address Sequence, idle byte number is more than most free word joint numbers between second initial address and first initial address When, the last bit of first initial address is wiped according to the byte number having more, described second is write at position after being erased Program.
Further, the 3rd acquiring unit includes:Second computing module, for by first initial address and institute Stating can write the address of second program and carry out or computing, obtain or operation result;Processing module, for inciting somebody to action described or fortune The value of result is calculated as second initial address.
The present invention has been written into the first initial address of the first program of storage region by the acquisition from reserved area, Wherein, storage region is the storage region in disposal programmable device, and multiple reserved areas have been reserved in storage region, each Reserved area is used to be stored in the initial address of the program stored in storage region;Obtain in storage region close to the first journey The address that can write the second program after sequence;The second initial address is obtained, wherein, the value of the second initial address meets as follows Condition:Can be obtained after being revised as 1 more than or equal to the address that can write the second program and by 0 in the first initial address 's;0 in the first initial address in reserved area is revised as 1 according to the second initial address;From the write-in of the second initial address Second program, the step of as a result of 0 in the first initial address is revised as into 1, OTP programs rise in solving correlation technique The limited problem of beginning address burning number of times, and then reached the effect for improving OTP program origin burning number of times.
Brief description of the drawings
The accompanying drawing for constituting the part of the application is used for providing a further understanding of the present invention, schematic reality of the invention Apply example and its illustrate, for explaining the present invention, not constitute inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 is a kind of schematic diagram of OTP initial addresses record according to a first embodiment of the present invention;
Fig. 2 is a kind of schematic diagram of OTP initial addresses record according to a second embodiment of the present invention;
Fig. 3 is the flow chart of program writing method according to a first embodiment of the present invention;
Fig. 4 is the flow chart of program writing method according to a second embodiment of the present invention;And
Fig. 5 is the schematic diagram of program writing station according to embodiments of the present invention.
Specific embodiment
It should be noted that in the case where not conflicting, the feature in embodiment and embodiment in the application can phase Mutually combination.Describe the present invention in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
In order that those skilled in the art more fully understand application scheme, below in conjunction with the embodiment of the present application Accompanying drawing, is clearly and completely described to the technical scheme in the embodiment of the present application, it is clear that described embodiment is only The embodiment of the application part, rather than whole embodiments.Based on the embodiment in the application, ordinary skill people The every other embodiment that member is obtained under the premise of creative work is not made, should all belong to the model of the application protection Enclose.
It should be noted that term " first ", " in the description and claims of this application and above-mentioned accompanying drawing Two " it is etc. for distinguishing similar object, without for describing specific order or precedence.It should be appreciated that so using Data can exchange in the appropriate case, so as to embodiments herein described herein.Additionally, term " including " and " tool Have " and their any deformation, it is intended that covering is non-exclusive to be included, for example, containing series of steps or unit Process, method, system, product or equipment are not necessarily limited to those steps clearly listed or unit, but may include without clear It is listing to Chu or for these processes, method, product or other intrinsic steps of equipment or unit.
The embodiment of the invention provides a kind of program writing method.
Fig. 3 is the flow chart of program writing method according to a first embodiment of the present invention, as shown in figure 3, the method includes Following steps:
Step S102:The first initial address of the first program for having been written into storage region is obtained from reserved area, Wherein, storage region is the storage region in disposal programmable device, and multiple reserved areas have been reserved in storage region, each Reserved area is used to be stored in the initial address of the program stored in storage region.
Step S104:Obtain in storage region close to the address that can write the second program after the first program.
Step S106:The second initial address is obtained, wherein, the value of the second initial address meets following condition:It is more than or equal to The address of the second program can be write and what can be obtained after 1 is revised as in 0 in the first initial address.
Step S108:0 in the first initial address in reserved area is revised as 1 according to the second initial address.
Step S110:The second program is write from the second initial address.
The embodiment has been written into the first starting point of the first program of storage region using the acquisition from reserved area Location, wherein, storage region is the storage region in disposal programmable device, and multiple reserved areas have been reserved in storage region, Each reserved area is used to be stored in the initial address of the program stored in storage region;Obtain in storage region close to the The address that can write the second program after one program;The second initial address is obtained, wherein, the value of the second initial address meets Following condition:Can after being revised as 1 more than or equal to the address that can write the second program and by 0 in the first initial address Obtain;0 in the first initial address in reserved area is revised as 1 according to the second initial address;From the second initial address The second program is write, the step of as a result of 0 in the first initial address is revised as into 1, OTP journeys in correlation technique is solved The limited problem of sequence initial address burning number of times, and then reached the effect for improving OTP program origin burning number of times.
In One Time Programmable (One Time Programmable, referred to as OTP) program, due to each secondary program Renewal, be required for record present procedure initial address, so, when updating next time, it is possible to according to record starting The length gauge of address and program calculates new initial address.Reserved area can be OTP storage region in for recording journey The specific region of the initial address of sequence, for example, the storage region of the reserved 16words of the beginning part of OTP, in the storage region During the initial address of middle first time write-in program, the starting of first time write-in program is stored since first in reserved area Address, in the initial address of second write-in program in the storage region, it is necessary in first obtaining and having been written into storage region The first program the first initial address, then obtaining can write the address of the second program in storage region, the address need Will be close to after the first program, the second initial address is the initial address of the second program, and the value of the second initial address meets two Condition:More than or equal to the address that can write the second program, be possible to write in the address of the second program 0 be modified as 1 can Obtain.Because the second initial address is required to write the second program, therefore, the second initial address can be more than or equal to energy The address of the second program is enough write, but can not be less than, if one or more in the first initial address 0 are revised as after 1 The value for obtaining is more than or equal to the address that can write the second program, then can change the first initial address and obtain the second starting point Location, without the erasing of the first initial address is write into the second initial address again, second is obtained by changing the first initial address Beginning address scheme, can reuse the storage region of program origin, improve the burning time of OTP program origins Number.
Alternatively, obtaining the second initial address can be by the following method:Determine or many in the first initial address Individual 0 is revised as the modified values that can be obtained after 1;Calculate the difference of modified values and the address that the second program can be write;It is determined that poor Numerical value is the modified values just and corresponding to the difference of minimum in value;Using corresponding modified values as the second initial address.
If 0 in first initial address, then 0 can be revised as 1, but 1 and cannot be modified as 0, therefore, if the first starting One or more in address 0 are revised as obtaining modified values after 1, also, this modified values be precisely the second initial address then Just modified values after 1 as the second initial address are modified as using 0.If to have be modified as 0 in the first address and have multiple after 1 Value is met more than the second initial address, then the value minimum with the difference of the second initial address is determined from these modified values, by this The corresponding modified values of individual minimum value are used as the second initial address.So, due to changing the value for obtaining and the second initial address gap Minimum, can save memory space, also, when changing next time, can also continue to be modified as 1 by therein 0, to obtain Three initial addresses, can at utmost utilize the first initial address.In follow-up process, the initial address for newly writing each time Before, can judge whether previous initial address can be rewritten into the initial address of this new write-in, or be written over Difference afterwards with the initial address that can write new procedures is smaller, if previous initial address can be rewritten, and will be revised Value can save storage region space as new initial address, improve modification number of times.
Alternatively, after difference of the modified values with the address that can write the second program is calculated, if difference is negative, Then the second initial address is write in the storage region after the storage region of the first initial address.
If being revised as the value obtained after 1 less than the address that can write the second program by the 0 of the first initial address, That is, difference is negative, then do not rewrite the first initial address, but in storage region after the storage region of the first initial address The second initial address is write, the second initial address can be write with adjacent first initial address, it is also possible to reserve default digit again Write-in.
Alternatively, obtain in storage region close to the address that can write the second program after the first program it Afterwards, default invalidation word joint number is obtained, wherein, invalidation word joint number is two journeys in the storage region in disposal programmable device At most idle byte number between the initial address of sequence;Judge byte idle between the second initial address and the first initial address Whether number is less than or equal to most free word joint numbers;If idle byte number is small between the second initial address and the first initial address In equal to most free word joint numbers, then the second program is write from the second initial address;If the second initial address and the first starting Idle byte number is more than most free word joint numbers between address, then the end of the first initial address is wiped according to the byte number having more Tail position, writes the second program at position after being erased.
After the address of second program that obtains, if the idle bytes between the first initial address and the second initial address Number has exceeded most free word joint numbers, then the second initial address can be write in idle bytes, if the byte number of free time is not Enough write the second initial address, then can be by the erasing of the last bit of the first initial address, position after being erased and idle bytes Position writes the second initial address.
Alternatively, obtaining the second initial address includes:First initial address is entered with the address that can write the second program Row or computing, obtain or operation result;Using or operation result value as the second initial address.
For example, after updating for the first time, fw start low=0x12, fw start high=0x00.With As a example by the program of 100words (800bytes):First time word2 content is 0x12,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00, the initial address more after new procedures is 16 (0x12)+100 (0x64)=116 (0x74), second for the second time Secondary word2 contents with 0x74's or should be worth, i.e., 00010010 for 0x12 | 01110100=01110110=0x76.
A kind of recording method of new FW initial addresses and length is the embodiment of the invention provides, such that it is able to fixed In headspace, the number of times of upgrading is lifted.
The embodiment of the present invention additionally provides a kind of preferred embodiment, and the preferred embodiment can be realized in the following way:
Error-checking code (Error Correcting Code, referred to as ECC) enters each word of OTP for verifying burning Data whether be consistent with original program, for the ripe OTP of design and craft, and do not need ECC functions, Ke Yitong Register configuration is crossed, turns off ECC.The embodiment of the present invention is applied to turn off the scene of ECC.
Initial address update mode:
Fig. 4 is the flow chart of program writing method according to a second embodiment of the present invention, and the embodiment can be as above-mentioned The preferred embodiment of first embodiment, as shown in figure 4, the method is comprised the following steps:
Step S401:Obtain the first initial address:First initial address=" byte 1 of the second row word moves to right 8 " and " the The byte 0 of two row words " or operation result.
Step S402:Judge whether the first initial address is equal to 0.If it is judged that being yes, then step S403 is performed, such as Fruit judged result is no, then perform step S404.
Step S403:The byte 1 for initializing the row word of byte 0 and second of the second row word is 0x12,0x00.
Step S404:Continue to obtain the first initial address, the first initial address=" the byte m+1 of line n word moves to right 8 " With " the byte m of line n word " or computing, wherein, the initial value of m and n is n=2, m=0.
Step S405:Whether judge the first initial address=0xFFFF.If it is judged that being yes, then step is performed S416, if it is judged that being no, then performs step S406.
Step S406:Calculate the second initial address:Second initial address=the first initial address+program size.This implementation The second initial address in example namely the address that can write the second program in above-described embodiment.
Step S407:Second address is modified, the second address correction value=the second initial address and the first starting point Location or operation result.In the present embodiment, the second address correction value is the second initial address in above-described embodiment.
Step S408:Whether judge second the-the second initial address of initial address correction value>30.30 can be it is default most Many free word joint numbers.If it is judged that being yes, then step S409 is performed, if it is judged that being no, then perform step S415.
Step S409:The byte m=0xFF, the byte m+1=0xFF of line n word of line n word are set.
Step S410:Whether judge m=6.
Step S411:The numerical value of n is increased by 1.
Step S412:Judge n whether more than 16.If it is judged that being yes, then process is exited, if it is judged that being no Then perform step S414.
Step S413:The second initial addresses of the byte m+2=correction value _ least-significant byte of line n word.The byte m+3 of line n word =the second initial address correction value _ most-significant byte.
Step S414:The second initial addresses of the byte 0=correction value _ least-significant byte of the (n+1)th row word.The word 1=of the (n+1)th row word Second initial address correction value _ most-significant byte.
Step S415:The second initial addresses of the byte m=correction value _ least-significant byte of line n word, the byte m=of line n word Two initial address correction values _ most-significant byte.
Step S416:The value of m+2 is assigned to m.
Step S417:Whether judge m>6, if it is judged that being yes, then step S418 is performed, if it is judged that being It is no, then perform step S404.
Step S418:Then making the value of m=0, n increases by 1.
Step S419:Whether judge n>16, if it is judged that being yes, then exit, if it is judged that being no, then perform Step S404.
The rule that OTP finds initial address is, since the 3rd word, it is not the byte (bytes) of 0xff to read 2 As initial address, can be without wiping word2 at once, but according to starting for the first time in word2 when second burning The content of address is updated on word 2.
For example, after updating for the first time, fw start low=0x12, fw start high=0x00.With As a example by 100words (800bytes) program, first time word2 content be 0x12,0x00,0x00,0x00,0x00,0x00, 0x00,0x00,0x00, the initial address more after new procedures is 16 (0x12)+100 (0x64)=116 (0x74), second for the second time Secondary word2 contents with 0x74's or should be worth, i.e., 00010010 for 0x12 | 01110100=01110110=0x76.After renewal Word2 be 0x76,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, so have lost 2 word (word74, word75), but word3 need not be updated, as long as updating word2 on the original basis can just complete fw startings The renewal of address, be increased in fixed headspace can be with the number of times of ROMPaq.
Initial address after third time more new procedures is 118 (0x76)+100 (0x64)=218 (0xDA), third time The content of word2 with 0xDA's or should be worth, i.e., 01110110 for 0x76 | 11011010=11111110=0xFE, after renewal Word2 be 0xFE, 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, so have lost 36 word (word DA, word FD), but word3 need not be updated, as long as updating word2 on the original basis can just complete fw initial addresses Renewal, be increased in fixed headspace can be with the number of times of ROMPaq.
Acceptable loss can be set according to the total size of OTP, so that third time is lost as an example, if OTP sizes can only Receive every time loss be no more than 30 word, then third time more new procedures, it is necessary to will third time update after initial address (0x00DA) high position (fw start high) respectively forwardly moves two bytes with low level (fw start low), then wipes Fall former initial address (being write as 0xFF).So on the premise of 30 word of maximum loss, the word2 after third time more new procedures It is 0xFF, 0xFF, 0xDA, 0x00,0x00,0x00,0x00,0x00,0x00.
It should be noted that can be in such as one group computer executable instructions the step of the flow of accompanying drawing is illustrated Performed in computer system, and, although logical order is shown in flow charts, but in some cases, can be with not The order being same as herein performs shown or described step.
A kind of program writing station is the embodiment of the invention provides, the program writing station can be used for performing the present invention in fact Apply the program writing method of example.
Fig. 5 is the schematic diagram of program writing station according to embodiments of the present invention, as shown in figure 5, the device includes:
First acquisition unit 10, for obtaining the first program for having been written into storage region from reserved area first Initial address, wherein, storage region is the storage region in disposal programmable device, has been reserved in storage region multiple reserved Region, each reserved area is used to be stored in the initial address of the program stored in storage region.
Second acquisition unit 20, the second program can be write for obtaining in storage region close to after the first program Address.
3rd acquiring unit 30, for obtaining the second initial address, wherein, the value of the second initial address meets following bar Part:It is revised as what can be obtained after 1 more than or equal to the address that can write the second program and by 0 in the first initial address.
Modification unit 40, for being revised as 0 in the first initial address in reserved area according to the second initial address 1。
First writing unit 50, for writing the second program from the second initial address.
Alternatively, the 3rd acquiring unit includes:First determining module, for determining or many in the first initial address Individual 0 is revised as the modified values that can be obtained after 1;First computing module, for calculating modified values and the second program can be write The difference of address;Second determining module, for determining that numerical value in difference is the modified values just and corresponding to the difference of minimum;Modification Module, for using corresponding modified values as the second initial address.
Alternatively, device also includes:Second writing unit, for calculating modified values and the ground that the second program can be write After the difference of location, if difference is negative, second is write in the storage region after the storage region of the first initial address Initial address.
Alternatively, device also includes:4th acquiring unit, for obtaining in storage region close to after the first program The address that can write the second program after, obtain default invalidation word joint number, wherein, invalidation word joint number is can disposably to compile Byte number at most idle between two initial addresses of program in storage region in journey device;Judging unit, for judging Whether idle byte number is less than or equal to most free word joint numbers between second initial address and the first initial address;3rd write-in Unit, most free word joint numbers are less than or equal to for idle byte number between the second initial address and the first initial address When, the second program is write from the second initial address, idle byte number is more than between the second initial address and the first initial address During most free word joint numbers, the last bit of the first initial address is wiped according to the byte number having more, write at position after being erased Enter the second program.
Alternatively, the 3rd acquiring unit includes:Second computing module, by the first initial address with can write the second program Address carry out or computing, obtain or operation result;Processing module, for using or operation result value as the second starting point Location.
The embodiment obtains the first journey for having been written into storage region using first acquisition unit 10 from reserved area First initial address of sequence, wherein, storage region is the storage region in disposal programmable device, is reserved in storage region Multiple reserved areas, each reserved area is used to be stored in the initial address of the program stored in storage region;Second obtains Unit 20 is obtained in storage region close to the address that can write the second program after the first program;3rd acquiring unit 30 The second initial address is obtained, wherein, the value of the second initial address meets following condition:More than or equal to the second program can be write Address and what can be obtained after 1 is revised as in 0 in the first initial address;Modification unit 40 will according to the second initial address In reserved area in the first initial address 0 is revised as 1;First writing unit 50 writes the second journey from the second initial address Sequence, so as to burning number of times in OTP program origins is limited in solving the problems, such as correlation technique, and then has reached raising OTP journeys The effect of sequence initial address burning number of times.
In the above embodiment of the present invention, the description to each embodiment all emphasizes particularly on different fields, and does not have in certain embodiment The part of detailed description, may refer to the associated description of other embodiment.
Obviously, those skilled in the art should be understood that above-mentioned of the invention each module or each step can be with general Computing device realize that they can be concentrated on single computing device, or be distributed in multiple computing devices and constituted Network on, alternatively, the program code that they can be can perform with computing device be realized, it is thus possible to they are stored Performed by computing device in the storage device, or they be fabricated to each integrated circuit modules respectively, or by they In multiple modules or step single integrated circuit module is fabricated to realize.So, the present invention is not restricted to any specific Hardware and software is combined.
The preferred embodiments of the present invention are the foregoing is only, is not intended to limit the invention, for the skill of this area For art personnel, the present invention can have various modifications and variations.It is all within the spirit and principles in the present invention, made any repair Change, equivalent, improvement etc., should be included within the scope of the present invention.

Claims (10)

1. a kind of program writing method, it is characterised in that including:
The first initial address of the first program for having been written into storage region is obtained from reserved area, wherein, the storage Region is the storage region in disposal programmable device, and multiple reserved areas have been reserved in the storage region, and each is reserved Region is used to be stored in the initial address of the program stored in the storage region;
Obtain in the storage region close to the address that can write the second program after first program;
The second initial address is obtained, wherein, the value of second initial address meets following condition:More than or equal to institute can be write State the address of the second program and what can be obtained after 1 is revised as in 0 in first initial address;
0 in the first initial address in the reserved area is revised as 1 according to second initial address;
Second program is write from second initial address.
2. method according to claim 1, it is characterised in that obtaining the second initial address includes:
One or more for determining in first initial address 0 are revised as the modified values that can be obtained after 1;
Calculate the difference of the modified values and the address that second program can be write;
Determine that numerical value in the difference is the modified values just and corresponding to the difference of minimum;
Using the corresponding modified values as second initial address.
3. method according to claim 2, it is characterised in that can write described the with described the modified values are calculated After the difference of the address of two programs, methods described also includes:
If the difference is negative, described the is write in the storage region after the storage region of first initial address Two initial addresses.
4. method according to claim 3, it is characterised in that obtaining in the storage region close to first journey After the address that can write the second program after sequence, methods described also includes:
Default invalidation word joint number is obtained, wherein, the invalidation word joint number is in the storage region in disposal programmable device At most idle byte number between two initial addresses of program;
Judge between second initial address and first initial address idle byte number whether less than or equal to it is described most Many free word joint numbers;
If idle byte number is less than or equal to most skies between second initial address and first initial address Not busy byte number, then write second program from second initial address;
If idle byte number is more than most free words between second initial address and first initial address Joint number, then wipe the last bit of first initial address according to the byte number having more, and is write at position after being erased described Second program.
5. method according to claim 1, it is characterised in that obtaining the second initial address includes:
First initial address is carried out or computing with the address that can write second program, is obtained or computing knot Really;
Using described or operation result value as second initial address.
6. a kind of program writing station, it is characterised in that including:
First acquisition unit, the first starting point for obtaining the first program for having been written into storage region from reserved area Location, wherein, the storage region is the storage region in disposal programmable device, has been reserved in the storage region multiple pre- Region is stayed, each reserved area is used to be stored in the initial address of the program stored in the storage region;
Second acquisition unit, the second journey can be write for obtaining in the storage region close to after first program The address of sequence;
3rd acquiring unit, for obtaining the second initial address, wherein, the value of second initial address meets following condition: Can be obtained after being revised as 1 more than or equal to the address that can write second program and by 0 in first initial address Arrive;
Modification unit, for being changed 0 in the first initial address in the reserved area according to second initial address It is 1;
First writing unit, for writing second program from second initial address.
7. device according to claim 6, it is characterised in that the 3rd acquiring unit includes:
First determining module, for determine in first initial address one or more 0 be revised as being obtained after 1 repair Revaluate;
First computing module, the difference for calculating the modified values and the address that second program can be write;
Second determining module, for determining that numerical value in the difference is the modified values just and corresponding to the difference of minimum;
Modified module, for using the corresponding modified values as second initial address.
8. device according to claim 7, it is characterised in that described device also includes:
Second writing unit, for calculate the modified values and the address that second program can be write difference it Afterwards, if the difference is negative, described the is write in the storage region after the storage region of first initial address Two initial addresses.
9. device according to claim 8, it is characterised in that described device also includes:
4th acquiring unit, for second can be write close to after first program in the storage region obtaining After the address of program, default invalidation word joint number is obtained, wherein, the invalidation word joint number is in disposal programmable device Byte number at most idle between two initial addresses of program in storage region;
Whether judging unit, the byte number for judging idle between second initial address and first initial address is small In equal to most free word joint numbers;
3rd writing unit, is less than for idle byte number between second initial address and first initial address During equal to most free word joint numbers, second program is write from second initial address,
Idle byte number is more than most free word joint numbers between second initial address and first initial address When, the last bit of first initial address is wiped according to the byte number having more, described second is write at position after being erased Program.
10. device according to claim 6, it is characterised in that the 3rd acquiring unit includes:
Second computing module, for first initial address to be carried out with the address that can write second program or Computing, obtains or operation result;
Processing module, for using described or operation result value as second initial address.
CN201611075581.0A 2016-11-28 2016-11-28 Program writing method and device Active CN106802811B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611075581.0A CN106802811B (en) 2016-11-28 2016-11-28 Program writing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611075581.0A CN106802811B (en) 2016-11-28 2016-11-28 Program writing method and device

Publications (2)

Publication Number Publication Date
CN106802811A true CN106802811A (en) 2017-06-06
CN106802811B CN106802811B (en) 2020-03-10

Family

ID=58984588

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611075581.0A Active CN106802811B (en) 2016-11-28 2016-11-28 Program writing method and device

Country Status (1)

Country Link
CN (1) CN106802811B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107766058A (en) * 2017-10-27 2018-03-06 信利光电股份有限公司 A kind of method and device of data recording
CN110716725A (en) * 2018-07-12 2020-01-21 广东德昌电机有限公司 Actuator system, vehicle system, and updating method thereof
CN113805926A (en) * 2021-09-14 2021-12-17 上汽通用五菱汽车股份有限公司 Software upgrading method, vehicle and computer readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070109655A (en) * 2006-05-12 2007-11-15 주식회사 하이닉스반도체 Reading and program method of semiconductor memory device
CN101354678A (en) * 2008-09-10 2009-01-28 浪潮齐鲁软件产业有限公司 Data accumulation method based on NorFlash
CN102364430A (en) * 2010-09-17 2012-02-29 杭州士兰微电子股份有限公司 Microcontroller for supporting multi-programming on one time programmable memory and programming method
CN102486937A (en) * 2010-12-06 2012-06-06 慧荣科技股份有限公司 Datum programming circuit for one-time programmable memory and method thereof
CN103064638A (en) * 2012-12-24 2013-04-24 华为技术有限公司 Method, device and system for processing data
US9455045B1 (en) * 2015-04-20 2016-09-27 Integrated Device Technology, Inc. Controlling operation of a timing device using an OTP NVM to store timing device configurations in a RAM

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20070109655A (en) * 2006-05-12 2007-11-15 주식회사 하이닉스반도체 Reading and program method of semiconductor memory device
CN101354678A (en) * 2008-09-10 2009-01-28 浪潮齐鲁软件产业有限公司 Data accumulation method based on NorFlash
CN102364430A (en) * 2010-09-17 2012-02-29 杭州士兰微电子股份有限公司 Microcontroller for supporting multi-programming on one time programmable memory and programming method
CN102486937A (en) * 2010-12-06 2012-06-06 慧荣科技股份有限公司 Datum programming circuit for one-time programmable memory and method thereof
CN103064638A (en) * 2012-12-24 2013-04-24 华为技术有限公司 Method, device and system for processing data
US9455045B1 (en) * 2015-04-20 2016-09-27 Integrated Device Technology, Inc. Controlling operation of a timing device using an OTP NVM to store timing device configurations in a RAM

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
黎旺星: "OTP单片机的多次编程方法", 《电子世界》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107766058A (en) * 2017-10-27 2018-03-06 信利光电股份有限公司 A kind of method and device of data recording
CN110716725A (en) * 2018-07-12 2020-01-21 广东德昌电机有限公司 Actuator system, vehicle system, and updating method thereof
CN113805926A (en) * 2021-09-14 2021-12-17 上汽通用五菱汽车股份有限公司 Software upgrading method, vehicle and computer readable storage medium

Also Published As

Publication number Publication date
CN106802811B (en) 2020-03-10

Similar Documents

Publication Publication Date Title
US5363334A (en) Write protection security for memory device
CN105096860B (en) A kind of TFTLCD drive circuits communication means, communicator and system
CN106802811A (en) program writing method and device
US20150154110A1 (en) Data Storage Device and Flash Memory Control Method
CN104246727B (en) Data handling system and the method for operating data processing system
DE102007016460A1 (en) Non-volatile memory device, non-volatile memory system and reading method for a nonvolatile memory device
CN104679672B (en) Data memory device and method for controlling flash memory
JPH08235887A (en) Electrically programmable memory and write method of data into memory
CN104731522A (en) Data storage device and data maintenance method thereof
US6563734B2 (en) Non-volatile semiconductor memory device capable of executing erasable, writable and readable functions simultaneously
US20090006765A1 (en) Method and system for reducing cache conflicts
CN110297603A (en) Random write performance method for improving, device and computer equipment based on solid state hard disk
CN108563590A (en) OTP controller based on piece FLASH memory and control method
CN103370746B (en) The method of storer and programmable memory
US9786373B2 (en) EEPROM backup method and device
CN103593252B (en) The memory detected with dynamic error and corrected
CN107678977B (en) Reading and writing method and device of counter
US20130019056A1 (en) Data Storing Method and Apparatus Applied to Flash Memory Storage Device
CN113314180B (en) Multiple programming electronic fuse device
CN105653332A (en) MCU system and burning method capable of correcting OTP (One Time Programmable) burning problem
EP3176789A1 (en) Memory control method and apparatus
CN102750235A (en) Method for performing data storage to nonvolatile memory and control device
CN109597639B (en) Software upgrading method, device, equipment and medium
US20120008393A1 (en) Nonvolatile memory device and operation method thereof
CN113129983A (en) Method, apparatus and computer storage medium for calibrating threshold voltage set

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
TR01 Transfer of patent right

Effective date of registration: 20210507

Address after: 1801, building 4, 209 Zhuyuan Road, high tech Zone, Suzhou City, Jiangsu Province

Patentee after: Silicon Valley digital analog (Suzhou) Semiconductor Co.,Ltd.

Patentee after: ANALOGIX INTERNATIONAL LLC

Address before: 100086 28th floor, block a, digital building, 2 Zhongguancun South Street, Haidian District, Beijing

Patentee before: ANALOGIX (CHINA) SEMICONDUCTOR, Inc.

Patentee before: ANALOGIX INTERNATIONAL LLC

TR01 Transfer of patent right
CP03 Change of name, title or address

Address after: 1801, building 4, 209 Zhuyuan Road, high tech Zone, Suzhou City, Jiangsu Province

Patentee after: Silicon Valley Analog (Suzhou) Semiconductor Co.,Ltd.

Patentee after: ANALOGIX INTERNATIONAL LLC

Address before: Room 1801, building 4, No. 209, Zhuyuan Road, high tech Zone, Suzhou, Jiangsu 215010

Patentee before: Silicon Valley digital analog (Suzhou) Semiconductor Co.,Ltd.

Patentee before: ANALOGIX INTERNATIONAL LLC

CP03 Change of name, title or address