The processing method of communication terminal and Nonvolatile data thereof
Technical field
The present invention relates to the communications field, particularly the processing method of a kind of communication terminal and Nonvolatile data thereof.
Background technology
At present, along with the rise of smart mobile phone in the communications field, " AP+Modem " scheme is prevailing, wherein AP(Application Processor) application processing unit can be called, be responsible for the process of all application programs, Modem(Modulation demodulation) modulation /demodulation processing unit can be called, be responsible for the execution of all communication softwares.AP part is separated from each other with Modem part, is communicated between the two by AT order, and such as: when calling, AP is by AT order control Modem, and when having an incoming call, Modem notifies AP by AT order.
In order to cost-saving, the scheme of " without NAND Modem " has been there is in " AP+Modem " scheme, namely in Modem, nonvolatile memory is not set, and the firmware (Firmware) of Modem is comprised non-volatile (NV, Not Volatile) data and be all stored in the nonvolatile memory of AP side.
On the production line of mobile phone, it is a very important link that radio frequency parameter carries out calibration, when calibration after radio frequency parameter as the NV data of Modem a part write AP side nonvolatile memory after, the radio frequency parameter after calibration how is backed up when the firmware upgrade without NAND Modem, how to ensure that the NV data of Modem can be recovered after disruption automatically, how preventing the radio frequency parameter after calibrating from losing is the problem that must solve.
Current existing scheme is preserve NV data (subregion preserving NV data can referred to as NV subregion) in AP side with two subregions mostly, and these two subregions backup each other, once the NV data of certain subregion are destroyed, and can from another partition recovery.The NV data of Modem parse the radio frequency parameter after calibration by AP when upgrading from NV subregion, write NV subregion again after backup.
But the NV data of Modem should be transparent concerning AP, and AP does not need to be concerned about its form and structure.Existing scheme " parses the radio frequency parameter after calibration by AP when the NV data of Modem are upgraded, writes NV subregion again after backup " from NV subregion needs the data structure of AP side to the NV data of Modem to resolve, and adds both couplings.
In prior art, although two the mutually redundant subregions in AP side preserve NV data, recover with the data in another subregion after the data can guaranteeing in certain subregion are destroyed.But, these two subregions all can be write in the normal operation of communication terminal, once there is the situations such as illegal power down in the process write, NV data can be caused to be destroyed, the hardware-related supplemental characteristic of some outbalances such as the radio frequency parameter after calibration just cannot be recovered, thus affects communication terminal radio-frequency performance.
Therefore, the present embodiment increases a NV subregion (i.e. the 4th subregion) again in the nonvolatile memory of AP side, for preserving the supplemental characteristic relevant to hardware device such as radio frequency parameter, IMEI etc. after as calibration, this NV subregion is only complete to communication terminal calibration on a production line, write once when preserving the radio frequency parameter after calibration, after this communication terminal can not be write in normally running, and can ensure the correctness of described supplemental characteristic like this.
As shown in Figure 6, on the communication terminal basis that embodiment one provides, the nonvolatile memory 10 applying processing unit 1 described in the present embodiment also comprises the 4th subregion 104, be suitable for storing supplemental characteristic relevant to the hardware of described communication terminal in the Nonvolatile data of described modulation /demodulation processing unit 2, described supplemental characteristic comprises the radio frequency parameter after calibration; The write operation of described 4th subregion 104 in the normal work of described communication terminal is restricted.When the data that the supplemental characteristic stored in described 4th subregion 104 can store in the first subregion 101 and the second subregion 102 are all destroyed, the first subregion 101 and the second subregion 102 are recovered.
Continue to consult Fig. 6, correspondingly, the volatile memory 20 of described modulation /demodulation processing unit 2 also comprises the 4th storage area 204 being suitable for the Nonvolatile data storing described 4th subregion 104.
In the present embodiment, described supplemental characteristic comprises the radio frequency parameter after calibration, in other embodiments, described supplemental characteristic can also comprise the MAC(Media Access Control of Wireless Telecom Equipment in IMEI, communication terminal (such as bluetooth, WLAN)) address etc.
It should be noted that, described 4th subregion 104 is not increase the 3rd subregion similar with the 26S Proteasome Structure and Function of described first subregion 101 and the second subregion 102 simply, but to the embodiment that the NV data hierarchy of Modem backs up, namely carry out the backup operation of different modes according to the significance level of NV data.In described 4th subregion 104 backup be generally in NV data those once determine the data just never revised, the parameter that these data are normally relevant to the hardware of communication terminal, and the 4th subregion 104 only can perform write operation when write parameters data first, write operation is not supported in communication terminal normally runs, supplemental characteristic can be prevented like this to be destroyed, and the correctness of supplemental characteristic is guaranteed.
As shown in Figure 7, the processing method of the Nonvolatile data of communication terminal that the present embodiment provides comprises:
The NV data of the first subregion, the second subregion and the 3rd subregion, after AP powers on, if the first subregion and the second subregion are not empty, are then copied to the first storage area, the second storage area and the 3rd storage area by step S701 respectively;
Step S702, after radio frequency parameter is calibrated, writes the first storage area and the second storage area by Modem by the radio frequency parameter after calibration;
Step S703, after the radio frequency parameter after calibration is write the first storage area and the second storage area, upgrades the checking data of the radio frequency parameter corresponding data item after described calibration;
Step S704, by all data Replicas in the first storage area to the 4th storage area;
The NV data upgrading rear first storage area, the second storage area and the 4th storage area are synchronized to the first subregion, the second subregion and the 4th subregion by step S705, Modem respectively;
Step S706, after Modem is by the NV data syn-chronization of the 4th storage area to the 4th subregion, AP reads the data synchronously from described 4th subregion and verifies, and Modem verifies the data in the 4th storage area;
Step S707, whether the result after the result compared after AP verification verifies with Modem is consistent;
If both check results are inconsistent, then perform step S708, point out the backup failure of the radio frequency parameter after to calibration.When reality is implemented, the check results of AP and the inconsistent synchronization failure normally caused because physical interface has problems of the check results of Modem, now need to point out the backup failure of the radio frequency parameter after to calibration, again to back up it after the problem solving physical interface generation.
Perform the process of " verification " of above-mentioned steps S706 and " comparison " of step S707, ensure that the data in the 4th storage area are synchronized to the 4th subregion correctly, complete the backup of the radio frequency parameter after to described calibration.
The processing method of above-mentioned Nonvolatile data is applicable to the backup procedure of described communication terminal NV data after radio frequency parameter is calibrated, and is described further this below in conjunction with Fig. 8 and Fig. 7.
After first time downloads Modem firmware, first subregion 101 stores NV data " FIX_NV ", second subregion 102 stores NV data " PRO_NV ", owing to including the radio frequency parameter without calibration in " FIX_NV " and " PRO_NV " now, therefore, on the production line of communication terminal, also need radio frequency parameter to calibrate, and the 4th subregion 104 does not store any data temporarily, as shown in Figure 8, the storage condition in the 4th subregion 104 is expressed as " RFBK_NV NULL ".
In step S701, after AP powers on, " DL_NV " that " PRO_NV " that " FIX_NV " that stored by first subregion 101, the second subregion 102 store, the 3rd subregion 103 store passes to Modem by physical communication interface such as SDIO, SPI etc. of AP and Modem, be put into Modem RAM relevant range, i.e. the first storage area 201, second storage area 202 and the 3rd storage area 203.
In order to carry out calibration process to default radio frequency parameter, Modem enters calibration mode after powering on and running, calibration process is carried out to the radio frequency parameter without calibration, and by step S702, the radio frequency parameter after the calibration of the complete preservation of calibration is write the first storage area 201 and the second storage area 202.Consult Fig. 8, Modem is by the Code Image in executive storage area territory 200, radio frequency parameter after calibration is write the first storage area 201 and the second storage area 202, after completing write, the data stored in first storage area 201 are changed to by " FIX_NV " " FIX_NV(Cali) ", the data stored in second storage area 202 are changed to by " PRO_NV " " PRO_NV(Cali) ", " FIX_NV(Cali) " and " PRO_NV(Cali) " what all represent is the NV data writing the radio frequency parameter after calibrating.
After radio frequency parameter after calibration is write the first storage area 201 and the second storage area 202, because the radio frequency parameter in the first storage area 201 and the second storage area 202 upgrades, therefore be necessary the checking data redefining corresponding data item, namely upgraded the checking data of the radio frequency parameter corresponding data item after described calibration by step S703.In the present embodiment, described in the checking data that regenerates be specifically CRC data equally, the position of depositing remains the rear 1K byte place of the first storage area 201.
Complete by calibration after radio frequency parameter write the first storage area 201 after, just need, by step S704, all data in the first storage area 201 (are comprised the described checking data after renewal, the CRC data at concrete i.e. rear 1K byte place) copy to the 4th storage area 204, so that follow-up when carrying out simultaneous operation, by radio frequency parameter write the 4th subregion 104 after calibration, thus the backup of the radio frequency parameter after to calibration can be completed.As shown in Figure 8, Modem is by the Code Image in executive storage area territory 200, after all data writes the 4th storage area 204 of the first storage area 201, the storage condition in the 4th storage area 204 is changed to " RFBK_NV " by " RFBK_NV NULL ".
After completing the data write to the 4th storage area 204, by step S705, all data stored in the first storage area 201, second storage area 202 after renewal and the 4th storage area 204 are synchronized to AP by bottom physical communication interface, then are kept at the first subregion 101, second subregion 102 and the 4th subregion 104 of AP Flash respectively by AP.As shown in Figure 8, after completing data syn-chronization, the data stored in the first subregion 101 in AP Flash are expressed as " FIX_NV(Cali) ", the data stored in the second subregion 102 are expressed as " PRO_NV(Cali) ", the data stored in the 4th subregion 104 are expressed as " RFBK_NV ".
Because the data write operation in the normal operation of communication terminal writing the 4th subregion 104 can be restricted, therefore need to guarantee that simultaneous operation does not make a mistake, correctness when such guarantee is destroyed subregion with the date restoring of the 4th subregion 104 later.The data then can guaranteed in the 4th storage area 204 by the execution of step S706 to S708 write the 4th subregion 104 like clockwork.
Step S706 in the specific implementation, after the data syn-chronization in the 4th storage area 204 is preserved to AP, the data of the 4th subregion 104 can read out by AP from AP Flash again, all data are done School Affairs (checksum), Modem end also can be checksum to all data in the 4th storage area 204, both checksum results are compared, if consistent, then think that the data in the 4th subregion 104 are preserved correct, complete the backup of the radio frequency parameter after to calibration, the data guaranteed in the 4th subregion 104 with this are definitely reliably correct.
It should be noted that, communication terminal in embodiment one or embodiment two also can comprise above-mentioned 4th subregion, but the reading that can not relate in the backup procedure due to NV data when downloading Modem firmware the 4th subregion and write operation, the backup procedure therefore adding the NV data of the communication terminal after the 4th subregion still can the concrete enforcement of reference example one or embodiment two; In addition, some correlative details of the present embodiment such as storage area 100, storage area 200 and " the Code Image " that store etc., can related description in reference example one, repeats no more herein.
Summary of the invention
The problem that the present invention solves is when downloading the firmware of Modem, needs the data structure of AP side to the NV data of Modem to resolve, adds both couplings.
For solving the problem, technical solution of the present invention provides a kind of communication terminal, comprise modulation /demodulation processing unit and application processing unit, described modulation /demodulation processing unit does not arrange nonvolatile memory, the nonvolatile memory that described application processing unit is arranged comprises mutually redundant first subregion and the second subregion, the non-volatile data storage of described modulation /demodulation processing unit is in described first subregion and the second subregion, the nonvolatile memory of described application processing unit also comprises: the 3rd subregion, be suitable for storing the corresponding Nonvolatile data obtained after downloading the firmware of described modulation /demodulation processing unit.
Optionally, the nonvolatile memory of described application processing unit also comprises the 4th subregion, be suitable for storing supplemental characteristic relevant to the hardware of described communication terminal in the Nonvolatile data of described modulation /demodulation processing unit, described supplemental characteristic comprises the radio frequency parameter after calibration; The write operation of described 4th subregion in the normal work of described communication terminal is restricted.
For solving the problem, technical solution of the present invention also provides a kind of processing method of Nonvolatile data of communication terminal, and described process comprises backup, the treating method comprises:
After the firmware downloading described modulation /demodulation processing unit, by the corresponding non-volatile data storage of acquisition in described 3rd subregion;
After described application processing unit powers on, if described first subregion and the second subregion are empty, then the Nonvolatile data in described 3rd subregion is copied to the 3rd storage area of the volatile memory of described modulation /demodulation processing unit;
The volatile memory of described modulation /demodulation processing unit also comprises the first storage area being suitable for the Nonvolatile data storing described first subregion and the second storage area being suitable for the Nonvolatile data storing described second subregion, when described modulation /demodulation processing unit carries out system initialization, if described first storage area and the second storage area are empty, then the Nonvolatile data in described 3rd storage area is copied to described first storage area;
By all data Replicas in described first storage area to described second storage area;
When after the initialization of described modulation /demodulation processing unit completion system, the data in described first storage area and the second storage area are synchronized to described first subregion and the second subregion respectively.
Optionally, the processing method of the Nonvolatile data of described communication terminal also comprises: before by all data Replicas in described first storage area to described second storage area, generate corresponding checking data to each data item copied to from described 3rd storage area in the Nonvolatile data of described first storage area, described checking data is stored in the predetermined storage location in described first storage area.
Optionally, the processing method of the Nonvolatile data of described communication terminal also comprises:
After described application processing unit powers on, if described first subregion and the second subregion are not empty, then the Nonvolatile data of described first subregion, the second subregion and the 3rd subregion is copied to described first storage area, the second storage area and the 3rd storage area respectively;
When described modulation /demodulation processing unit carries out system initialization, if the timestamp of the Nonvolatile data of the Nonvolatile data of described first storage area and described 3rd storage area is inconsistent, whether the data structure of the described supplemental characteristic then in the Nonvolatile data of more described first storage area and the Nonvolatile data of the 3rd storage area is consistent, parse described supplemental characteristic from the Nonvolatile data in the first storage area, and synthesize with other data except described supplemental characteristic in described 3rd storage area, with the Nonvolatile data of the first storage area described in the Data Update after synthesis, otherwise the Nonvolatile data of described first storage area is directly upgraded with the Nonvolatile data of described 3rd storage area,
With the second storage area described in all Data Update in the first storage area after renewal;
When after the initialization of described modulation /demodulation processing unit completion system, the Nonvolatile data of the first storage area after renewal and the second storage area is synchronized to described first subregion and the second subregion respectively.
Optionally, the processing method of the Nonvolatile data of described communication terminal also comprises: described with described in all Data Update in the first storage area after upgrading before the second storage area, regenerates corresponding checking data to each data item of the Nonvolatile data in described first storage area after upgrading.
Optionally, the nonvolatile memory of described application processing unit also comprises the 4th subregion, be suitable for storing supplemental characteristic relevant to the hardware of described communication terminal in the Nonvolatile data of described modulation /demodulation processing unit, described supplemental characteristic comprises the radio frequency parameter after calibration, and the write operation of described 4th subregion in the normal work of described communication terminal is restricted; The volatile memory of described modulation /demodulation processing unit also comprises the 4th storage area being suitable for the Nonvolatile data storing described 4th subregion; Described processing method also comprises:
After described application processing unit powers on, if described first subregion and the second subregion are not empty, then the Nonvolatile data of described first subregion, the second subregion and the 3rd subregion is copied to described first storage area, the second storage area and the 3rd storage area respectively;
After radio frequency parameter is calibrated, by described modulation /demodulation processing unit, the radio frequency parameter after calibration is write described first storage area and the second storage area, and by all data Replicas in described first storage area to described 4th storage area;
The Nonvolatile data upgrading rear first storage area, the second storage area and the 4th storage area is synchronized to described first subregion, the second subregion and the 4th subregion by described modulation /demodulation processing unit respectively.
Optionally, the processing method of the Nonvolatile data of described communication terminal also comprises:
After the Nonvolatile data of described 4th storage area is synchronized to described 4th subregion by described modulation /demodulation processing unit, described application processing unit from described 4th subregion read synchronous after data verify, and the result after verification and described modulation /demodulation processing unit to be compared the result after the data in described 4th storage area verify;
If both check results are inconsistent, then point out the backup failure of the radio frequency parameter after to described calibration.
Optionally, the processing method of the Nonvolatile data of described communication terminal also comprises: after by radio frequency parameter described first storage area of write after calibration and the second storage area, before all data Replicas in described first storage area to described 4th storage area, upgrade the checking data of the radio frequency parameter corresponding data item after described calibration.
Optionally, described all data Replicas in described first storage area to be comprised to described 4th storage area: the described checking data after upgrading is copied to described 4th storage area.
Optionally, described process also comprises recovery, and described processing method also comprises:
When described modulation /demodulation processing unit carries out system initialization, carry out error checking by the Nonvolatile data of described checking data to described first subregion and the second subregion;
If not the checking data of the arbitrary data item in volatile data makes a mistake, then the subregion identifying this Nonvolatile data place is destroyed;
The Nonvolatile data of destroyed subregion is recovered with the Nonvolatile data of not destroyed partitioned storage.
Optionally, the described Nonvolatile data with the destroyed subregion of the Nonvolatile data of not destroyed partitioned storage recovery comprises:
If described destroyed subregion is described first subregion, then recover the Nonvolatile data of described first subregion with the Nonvolatile data of described second subregion;
If described destroyed subregion is described second subregion, then recover the Nonvolatile data of described second subregion with the Nonvolatile data of described first subregion;
If described destroyed subregion is described first subregion and the second subregion, then recover the Nonvolatile data of described first subregion and the second subregion with the Nonvolatile data of described 4th subregion.
Compared with prior art, technical scheme of the present invention at least has the following advantages:
By increasing by the 3rd subregion in the nonvolatile memory of AP side, when making the firmware (comprising NV data) downloading Modem, NV data only need be write into described 3rd subregion by AP, do not need to carry out any parsing, the backup of the upgrading of NV data and supplemental characteristic is carried out voluntarily when being started shooting by Modem, usually by AP, NV data are upgraded and supplemental characteristic backup relative in existing scheme, decrease the coupling between AP and Modem.
Further, increase by the 4th subregion by the nonvolatile memory in AP side, for preserving the supplemental characteristic relevant to the hardware of communication terminal of some outbalances such as the radio frequency parameter after such as calibration, and it is complete only to carry out calibration to communication terminal on a production line, write once when preserving supplemental characteristic, write operation for described 4th subregion in the normal operation of after this communication terminal is restricted, the correctness of supplemental characteristic can be ensured like this, thus reach the object of accurately backup supplemental characteristic and Fault recovery.
Accompanying drawing explanation
Fig. 1 is the structural representation of the communication terminal of the embodiment of the present invention one;
Fig. 2 is the schematic flow sheet of the processing method of the Nonvolatile data of the communication terminal of the embodiment of the present invention one;
The process schematic of NV data backup when Fig. 3 is the first time download Modem firmware of the embodiment of the present invention one;
Fig. 4 is the schematic flow sheet of the processing method of the Nonvolatile data of the communication terminal of the embodiment of the present invention two;
The process schematic of NV data backup when Fig. 5 is the Modem firmware upgrade of the embodiment of the present invention two;
Fig. 6 is the structural representation of the communication terminal of the embodiment of the present invention three;
Fig. 7 is the schematic flow sheet of the processing method of the Nonvolatile data of the communication terminal of the embodiment of the present invention three;
Fig. 8 is the process schematic backed up the radio frequency parameter after calibration of the embodiment of the present invention three.
Embodiment
For enabling above-mentioned purpose of the present invention, feature and advantage more become apparent, and are described in detail specific embodiments of the invention below in conjunction with accompanying drawing.
Embodiment one
As stated in the Background Art, existing scheme is normally upgraded and supplemental characteristic backup to NV data by AP, the data structure of AP side to the NV data of Modem is needed to resolve in the process, but, the NV data of Modem should be transparent concerning AP, AP does not need to be concerned about its form and structure, and therefore existing scheme adds the coupling between AP and Modem.
For this shortcoming, in the nonvolatile memory of AP side, a NV subregion (i.e. the 3rd subregion) is increased in the present embodiment, when downloading the NV data of Modem, NV data only need be write into this NV subregion by AP, do not need to carry out any parsing, carry out the upgrading of NV data and supplemental characteristic backup when being started shooting by Modem voluntarily, thus the coupling between AP and Modem can be reduced.
As shown in Figure 1, the communication terminal that the present embodiment provides comprises modulation /demodulation processing unit 2 and application processing unit 1, described modulation /demodulation processing unit 2 does not arrange nonvolatile memory, the nonvolatile memory 10 that described application processing unit 1 is arranged comprises mutually redundant first subregion 101 and the second subregion 102, the non-volatile data storage of described modulation /demodulation processing unit 2 is in described first subregion 101 and the second subregion 102, the nonvolatile memory 10 of described application processing unit 1 also comprises: the 3rd subregion 103, be suitable for storing the corresponding Nonvolatile data obtained after downloading the firmware of described modulation /demodulation processing unit 2.
Continue to consult Fig. 1, in the present embodiment, described modulation /demodulation processing unit 2 is provided with volatile memory 20, and described volatile memory 20 comprises the first storage area 201 being suitable for the Nonvolatile data storing described first subregion 101, the second storage area 202 being suitable for the Nonvolatile data storing described second subregion 102 and is suitable for the 3rd storage area 203 of the Nonvolatile data storing described 3rd subregion 103.
In the specific implementation, described communication terminal can be specifically the smart mobile phone adopting " AP+Modem " framework; Described nonvolatile memory 10 can be flash memory (Flash), such as NAND, NOR etc., and also can be embedded multi-media card (eMMC, embeded Multi Media Card), can also be read-only memory (ROM, Read-Only Memory); Described volatile memory 20 can be random asccess memory (RAM, Random Access Memory), such as synchronous DRAM (SDRAM, Synchronous Dynamic Random Access Memory).In the embodiment of the present invention, with described nonvolatile memory 10 specifically NAND Flash, described volatile memory 20 specifically SDRAM is that example is described.
Based on above-mentioned communication terminal, the present embodiment also provides a kind of processing method of Nonvolatile data of communication terminal, and described process comprises backup.As shown in Figure 2, the processing method of described Nonvolatile data specifically comprises the steps:
The corresponding NV data obtained, after the firmware downloading Modem, are stored in the 3rd subregion by step S101;
Step S102, after AP powers on, if the first subregion and the second subregion are empty, then by three storage area of the NV data Replica in the 3rd subregion to Modem;
Step S103, when Modem powers on and carries out system initialization, if the first storage area and the second storage area are empty, then by the NV data Replica in the 3rd storage area to the first storage area;
Step S104, generate corresponding checking data to each data item copied to from the 3rd storage area in the NV data of the first storage area, described checking data is stored in the predetermined storage location in the first storage area;
Step S105, by all data Replicas in the first storage area to the second storage area;
Data in first storage area and the second storage area, when after the initialization of Modem completion system, are synchronized to the first subregion and the second subregion by step S106 respectively.
The processing method of above-mentioned Nonvolatile data is applicable to the backup procedure of described communication terminal NV data when first time downloads Modem firmware and start, is described in detail to this below in conjunction with Fig. 3, Fig. 2 and Fig. 1.
It should be noted that, each square frame in Fig. 3 is the memory device of the communication terminal shown in corresponding diagram 1 and the subregion of memory device or storage area respectively, in order to embody the change of each subregion or each storage area store data inside, the content identified in the square frame of Fig. 3 is the data that in Fig. 1, respective partition or storage area store in varied situations; In addition, specifically be expressed as AP Flash in nonvolatile memory 10(the present embodiment of described application processing unit 1) and described modulation /demodulation processing unit 2 volatile memory 20(the present embodiment in be specifically expressed as Modem RAM) between the transmission of the data thick arrow of filling with vertical line represent, the thick arrow that between the inner each storage area of Modem RAM, process operation data is filled with oblique line represents.
In step S101, to the firmware of Modem carry out first time download time, corresponding Modem NV data can be kept at AP Flash(and described nonvolatile memory 10 by AP) the 3rd subregion 103, the NV data now stored in the 3rd subregion 103 are the NV data downloaded first, represent with " DL_NV ", when Modem firmware is downloaded first, DL_NV had both comprised the default supplemental characteristic relevant to the hardware of described communication terminal, such as without the radio frequency parameter calibrated (uncalibrated RFparameter), International Mobile Equipment Identity identification code (IMEI, International Mobile EquipmentIdentity) etc., also comprise default supplemental characteristic incoherent with the hardware of described communication terminal, the default setting parameter of such as some softwares, then do not store any data in first subregion 101 and the second subregion 102, namely the first subregion 101 and the second subregion 102 are empty, represent respectively with " FIX_NV NULL " and " PRO_NV NULL ".
In addition, the storage area 100 that AP Flash comprises is also show in Fig. 3, the image file that its " CodeImage " stored is some executable codes, for performing in Modem running, at least can realize that data write is carried out to each storage area of Modem, write out and the operation such as reading, thus complete download and the escalation process of Modem firmware.Those skilled in the art, it is understood that storage area 100 can be independently memory space in AP Flash, also as a part for described 3rd subregion 103, can be not described in detail herein.
In the present embodiment, when after the firmware downloading Modem, just can be carried out the backup of NV data when communication terminal is started shooting by Modem voluntarily, and no longer need the data structure of AP to NV data to resolve.
In step s 102, after AP powers on, if judge, the first subregion 101 and the second subregion 102 are for empty, then show that Modem firmware downloads first time, now only need by the DL_NV that stores in the 3rd subregion 103 by the physical communication interface of AP and Modem as secure digital input/output interface (SDIO, Secure Digital Input and Output), Serial Peripheral Interface (SPI) (SPI, Serial Peripheral Interface) etc. send Modem to, be put into Modem RAM(and described volatile memory 20) relevant range (the 3rd storage area 203).Wherein, judge whether the first subregion 101 and the second subregion 102 are that sky by reading front 4 bytes of the data that section post stores, if be 0xFFFFFFFF, then can think that this subregion is for empty.
It should be noted that, AP is except being sent to the 3rd storage area 203 of ModemRAM by the DL_NV stored in the 3rd subregion 103, also the Code Image in storage area 100 can be sent in the storage area 200 of Modem RAM, Modem reads Code Image and performs from storage area 200, thus realizes corresponding operating.
In step s 103, after Modem powers on and runs, judge that when system initialization the first storage area 201, second storage area 202 is that sky (equally can by reading front 4 bytes storing data, if be 0xFFFFFFFF, then think that this storage area is for empty), then by all data Replicas in the 3rd storage area 203 to the first storage area 201.As shown in Figure 3, by the Code Image in executive storage area territory 200, realize NV data copying by the 3rd storage area 203 to the first storage area 201, complete after copying, the NV data that first storage area 201 stores represent with " FIX_NV ", and are no longer " FIX_NV NULL ".
Step S104 in the specific implementation, each NV data item (NV item) in the NV data store the first storage area 201 generates the rear 1K byte place that a cyclic redundancy check (CRC) code (CRC, Cyclic RedundancyCheck) is put into the first storage area 201.Add CRC to each NV data item to be herein used to verify to verify its correctness to NV data, if the CRC check failure of the data item that certain NV data is corresponding, then show that this NV data place subregion is destroyed, need the recovery carrying out NV data, concrete restoration methods will describe in detail in embodiment four.
In the present embodiment, checking data described in step S104 is specially CRC data, and the predetermined storage location in described first storage area specifically refers to the rear 1K byte place of the first storage area 201.In other embodiments, can generate the checking data of other types, the predetermined storage location of described checking data also can be other memory locations.
Step S105 is the process data in the first storage area 201 being carried out backing up.Particularly, by the Code Image in executive storage area territory 200, all data (comprising the CRC data at rear 1K byte place) in the first storage area 201 are all copied to the second storage area 202.Consult Fig. 3, after completing and copying, the expression of the second storage area 202 store data inside is changed to " PRO_NV " by " PRO_NV NULL ".
In step S106, after the initialization of Modem completion system (now communication terminal is in holding state), the all data stored in the first newly-generated storage area 201 and the second storage area 202 can be synchronized to AP by bottom physical communication interface, the respective partition of AP Flash is kept at again, i.e. the first subregion 101 and the second subregion 102 by AP.As shown in Figure 3, after completing data syn-chronization, the data stored in the first subregion 101 in AP Flash are expressed as " FIX_NV ", and the data stored in the second subregion 102 are expressed as " PRO_NV ".
So far, backup for NV data during first time download Modem firmware completes, after NV data due to download Modem, these NV data only need directly be write into the 3rd subregion by AP, do not need to carry out any parsing, carry out NV Data Analysis and backup voluntarily when being started shooting by Modem, the coupling between AP and Modem is reduced greatly.
Embodiment two
On the basis of embodiment one, the present embodiment is described the backup procedure of NV data during Modem firmware upgrade.
As shown in Figure 4, the processing method of the Nonvolatile data of communication terminal that the present embodiment provides comprises:
The NV data of the first subregion, the second subregion and the 3rd subregion, after AP powers on, if the first subregion and the second subregion are not empty, are then copied to first storage area of Modem, the second storage area and the 3rd storage area by step S300 respectively;
When Modem carries out system initialization, perform step S301, judge that whether the NV data of the first storage area are consistent with the timestamp of the NV data of the 3rd storage area, be, show that Modem firmware is without the need to upgrading, otherwise perform step S302.
Perform step S302, judging that whether the NV data of the first storage area are consistent with the data structure of the described supplemental characteristic in the NV data of the 3rd storage area, is perform step S303, otherwise performs step S304.
When the judged result of step S302 is "Yes", perform step S303, from the NV data in the first storage area, parse described supplemental characteristic, and synthesize with other data except described supplemental characteristic in the 3rd storage area.
After step S303, perform step S305, with the NV data of Data Update first storage area after synthesizing.
When the judged result of step S302 is "No", perform step S304, directly with the NV data of NV Data Update first storage area of the 3rd storage area.
After step S305 or step S304 is finished, perform step S306, corresponding checking data is regenerated to each data item of the NV data in the first storage area after renewal.
After step S306, perform step S307, with all Data Update second storage area in the first storage area after upgrading;
When after the initialization of Modem completion system, perform step S308, the NV data of the first storage area after renewal and the second storage area are synchronized to the first subregion and the second subregion respectively.
The processing method of above-mentioned Nonvolatile data is applicable to the backup procedure of described communication terminal NV data when Modem firmware upgrade, is described further this below in conjunction with Fig. 5 and Fig. 4.
It should be noted that, due to after first time downloads Modem firmware, NV data " DL_NV " have been had in 3rd subregion 103, when needs are upgraded to Modem firmware, still newly downloaded NV data can be kept at the 3rd subregion 103(and replace the NV data stored before this), in order to be different from " DL_NV " in embodiment one, as shown in Figure 5, in the present embodiment, the NV data after the upgrading stored in the 3rd subregion 103 are expressed as " DL_NV(NEW) ", in addition, after first time downloads Modem firmware, first subregion 101 stores NV data " FIX_NV ", second subregion 102 stores NV data " PRO_NV ", owing to including the radio frequency parameter without calibration in " FIX_NV " and " PRO_NV " now, therefore on the production line of communication terminal, radio frequency parameter is also needed to calibrate, and when usually needing to upgrade to Modem firmware, the radio frequency parameter that what the NV data stored in the first subregion 101 and the second subregion 102 comprised is all after calibration, in order to show difference, still Fig. 5 is consulted, in the present embodiment, the NV data that the first subregion 101 stores are expressed as " FIX_NV(Cali) ", the NV data that second subregion 102 stores are expressed as " PRO_NV(Cali) ", to describe in detail in embodiment three as the process backed up the radio frequency parameter after calibration.
In step S300, after AP powers on, if judge the first subregion 101 and the second subregion 102 not for empty, then show that Modem firmware is not download first time, now need respectively by FIX_NV(Cali that the first subregion 101 stores), the PRO_NV(Cali that second subregion 102 stores) and the DL_NV(NEW of the 3rd subregion 103 storage) by the physical communication interface of AP and Modem as SDIO, SPI etc. pass to Modem, be put into the associated memory region of Modem RAM, i.e. the first storage area 201, second storage area 202 and the 3rd storage area 203, consult Fig. 5, the data stored in these three storage areas are respectively FIX_NV(Cali), PRO_NV(Cali) and DL_NV(NEW).
In the present embodiment, timestamp described in step S301 is specially front 4 bytes of NV data, automatically added by instrument when NV data genaration, therefore step S301 judges that whether the NV data of the first storage area 201 are consistent with the timestamp of the NV data of the 3rd storage area 203, only needs front 4 bytes reading respective NV data to compare and can realize.
When the timestamp of the NV data of the NV data and the 3rd storage area 203 of being judged the first storage area 201 by step S301 is inconsistent, then also need the data structure comparing the described supplemental characteristic (comprising the radio frequency parameter after calibration) in the NV data of the first storage area 201 and the NV data of the 3rd storage area 203 further by step S302 whether consistent, if both data structures are inconsistent, then can point out " supplemental characteristic loss ", and by performing step S304 with the NV data of NV Data Update first storage area 201 of the 3rd storage area 203, if both data structures are consistent, then need not all data in the first storage area 201 all be upgraded, described supplemental characteristic is without the need to upgrading, radio frequency parameter after the calibration particularly wherein comprised, therefore described supplemental characteristic can be parsed by step S303 from the NV data in the first storage area 201, and synthesize with interior other data except described supplemental characteristic of the 3rd storage area 203, then by performing step S305 with the NV data of Data Update first storage area 201 after synthesis.
Fig. 5 shows Modem by the Code Image in executive storage area territory 200, with the process of the NV data of Data Update first storage area 201 after described synthesis, after completing renewal, the NV data that first storage area 201 stores represent with " FIX_NV(Cali+N) ", and be no longer " FIX_NV(Cali) ", show to complete the renewal to other NV data in the first storage area 201 except supplemental characteristic.
After completing the renewal to NV data in the first storage area 201, regenerate corresponding checking data by step S306 each data item to the NV data in the first storage area 201 after renewal.In the present embodiment, described in the checking data that regenerates be specifically CRC data equally, the position of depositing remains the rear 1K byte place of the first storage area 201.
In the first storage area 201, NV Data Update is complete and after regenerating checking data, just can back up the data of the first storage area 201, namely perform step S307, upgrade the second storage area 202 with all data (comprising the CRC data at rear 1K byte place) in the first storage area 201 after upgrading.The execution of step S307 also can consult Fig. 5, Modem is by the Code Image in executive storage area territory 200, with the data of Data Update second storage area 202 of the first storage area 201, after completing renewal, " PRO_NV(Cali+N) " is changed to by " PRO_NV(Cali) " to the expression of the second storage area 202 store data inside.
In step S308, after the initialization of Modem completion system (now communication terminal is in holding state), the all data stored in the first storage area 201 after renewal and the second storage area 202 can be synchronized to AP by bottom physical communication interface, then be kept at first subregion 101 and second subregion 102 of AP Flash respectively by AP.As shown in Figure 5, after completing data syn-chronization, the data stored in the first subregion 101 in AP Flash are expressed as " FIX_NV(Cali+N) ", the data stored in the second subregion 102 are expressed as " PRO_NV(Cali+N) ".
So far, during Modem firmware upgrade, the backup of NV data completes, when downloading Modem with first time, the backup of NV data is similar, the NV data that firmware upgrade is relevant only need directly be write into the 3rd subregion by AP, do not need to carry out any parsing, carry out the upgrading of NV data and backup voluntarily when being started shooting by Modem, the coupling between AP and Modem is reduced greatly.
It should be noted that, some correlative details of the present embodiment such as judge that whether certain subregion or storage area be empty, storage area 100 and " the Code Image " that store etc. thereof, can related description in reference example one, repeat no more herein.
Embodiment three
On the basis of embodiment one, the backup procedure of the present embodiment to the radio frequency parameter after calibration is described.
Embodiment four
On the basis of embodiment three, the present embodiment also relates to and recovering the Nonvolatile data of destroyed subregion.
The processing method of the Nonvolatile data of the communication terminal that the present embodiment provides comprises: when described modulation /demodulation processing unit carries out system initialization, carries out error checking by the Nonvolatile data of described checking data to described first subregion and the second subregion; If not the checking data of the arbitrary data item in volatile data makes a mistake, then the subregion identifying this Nonvolatile data place is destroyed; The Nonvolatile data of destroyed subregion is recovered with the Nonvolatile data of not destroyed partitioned storage.
In the specific implementation, when Modem carries out system initialization, error checking can be carried out by the CRC data that in each storage area, below 1K byte place preserves to NV data, once the crc error of certain NV data item, then think that subregion corresponding to this storage area is destroyed.
Can consult Fig. 6, when reality is implemented, the described Nonvolatile data with the destroyed subregion of the Nonvolatile data of not destroyed partitioned storage recovery can carry out in the following way:
If destroyed subregion is the first subregion 101, then with the NV data of NV date restoring first subregion 101 of the second subregion 102;
If destroyed subregion is the second subregion 102, then with the NV data of NV date restoring second subregion 102 of the first subregion 101;
If destroyed subregion is the first subregion 101 and the second subregion 102, then with the NV data of NV date restoring first subregion 101 of the 4th subregion 104 and the second subregion 102.
Because the 4th storage area 204 only writes once in the calibration mode, other time usually all can not write, and after the data syn-chronization in the 4th storage area 204 is preserved to AP by Modem in the calibration mode, AP and Modem can do checksum verification to the data stored separately, if check results unanimously, illustrates that the data in the 4th subregion are preserved correct.Therefore can think that the data of the 4th partitioned storage storage are always correct, can accurately recover destroyed subregion.
To sum up, the processing method of the NV data without NAND Modem that the embodiment of the present invention provides, holds the NV data of store M odem on NAND or eMMC at AP, conveniently download backup and Fault recovery, store with 4 different subregions.After start, the data of 4 NV subregions are passed to Modem by bottom physical communication interface by AP, are kept at respectively in the different address areas of SDRAM.Can resolve these NV partition datas after Modem start, thus reach the object of backup supplemental characteristic and Fault recovery, solve the problem of the radio frequency parameter after without backup calibration after NAND Modem firmware upgrade, and the problem automatically recovered after NV data corruption.
Although the present invention discloses as above, the present invention is not defined in this.Any those skilled in the art, without departing from the spirit and scope of the present invention, all can make various changes or modifications, and therefore protection scope of the present invention should be as the criterion with claim limited range.