CN104239097A - Method and system for upgrading fitting by virtue of mobile terminal, and mobile terminal - Google Patents

Method and system for upgrading fitting by virtue of mobile terminal, and mobile terminal Download PDF

Info

Publication number
CN104239097A
CN104239097A CN201410445897.9A CN201410445897A CN104239097A CN 104239097 A CN104239097 A CN 104239097A CN 201410445897 A CN201410445897 A CN 201410445897A CN 104239097 A CN104239097 A CN 104239097A
Authority
CN
China
Prior art keywords
accessory
mobile terminal
firmware
data
uart
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
CN201410445897.9A
Other languages
Chinese (zh)
Other versions
CN104239097B (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201410445897.9A priority Critical patent/CN104239097B/en
Publication of CN104239097A publication Critical patent/CN104239097A/en
Application granted granted Critical
Publication of CN104239097B publication Critical patent/CN104239097B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention is applied to the technical field of upgrading, and provides a method and a system for upgrading a fitting by virtue of a mobile terminal, and the mobile terminal. The mobile terminal comprises a CPU (central processing unit) and a changeover switch connected with the CPU, wherein an OTG (On-The-Go) adapter connected with the mobile terminal or the D+/D- of a USB (universal serial bus) connected with the mobile terminal is connected with the i2c/uart (inter-integrated circuit/universal asynchronous receiver/transmitter) of the CPU through the changeover switch. The method comprises the following steps that the firmware of the fitting is stored in the mobile terminal; the mobile terminal establishes connection with the fitting; the mobile terminal transmits the firmware to the fitting through the OTG adapter and the D+/D- of the USB connected with the OTG adapter according to an i2c/uart protocol; or the mobile terminal transmits the firmware to the fitting through the D+/D- of the USB according to the i2c/uart protocol. According to the method, the system and the mobile terminal, if a serious bug appears or the fitting is subsequently required to be added with a new function after the fitting is released, the firmware can be locally upgraded by a user by virtue of the mobile terminal, the fitting is not required to be returned to a manufacturer, and the mobile terminal is simple and portable.

Description

A kind of method by updating mobile terminal accessory, system and mobile terminal
Technical field
The invention belongs to upgrade technique field, particularly relate to a kind of method by updating mobile terminal accessory, system and mobile terminal.
Background technology
Along with popularizing of intelligent mobile terminal, various accessory occurs like the mushrooms after rain, as filled adapter, portable power source, healthy bracelet, intelligent glasses etc. soon.
General less, the major part of storage space due to accessory does not have Wireless Fidelity WIFI function, and do not have complete file system, can not storage file, therefore cannot pass through over the air (Over-the-Air Technology, OTA) to upgrade to accessory as mobile terminal.If meet great bug or need to increase New function, can only factory be returned, by manufacturer, accessory be taken apart, the circuit board of accessory is placed on tool, by specific instrument, firmware upgrade be carried out to the chip inside circuit board.
Summary of the invention
Embodiments provide a kind of method by updating mobile terminal accessory, system and mobile terminal, be intended to the upgrade method solving the accessory that prior art provides, the problem of factory's upgrading must be returned.
On the one hand, a kind of method by updating mobile terminal accessory is provided, described mobile terminal comprises CPU, described mobile terminal also comprises a switch be connected with described CPU, by described switch, the OTG adapter be connected with described mobile terminal or the D+/D-of USB line be connected with described mobile terminal are connected with the i2c/uart of described CPU, and described method comprises:
Store the firmware of accessory in mobile terminal;
Mobile terminal and accessory connect;
Mobile terminal sends firmware to accessory by OTG adapter and the D+/D-of USB line that is connected with described OTG adapter according to i2c/uart agreement; Or
Mobile terminal sends firmware to accessory by the D+/D-of USB line according to i2c/uart agreement.
Further, before mobile terminal sends firmware to accessory according to i2c/uart agreement, also comprise:
Mobile terminal receives the upgrading accessory instruction of input;
Mobile terminal controls described switch according to the instruction of described upgrading accessory, by described switch, controls the OTG adapter that is connected with described mobile terminal or the D+/D-of USB line that is connected with described mobile terminal is connected with the i2c/uart of described CPU.
Further, mobile terminal comprises to accessory according to i2c/uart agreement transmission firmware:
Steps A, mobile terminal send erase command to accessory, the data in notice accessory erasing ROM space;
Step B, mobile terminal send the order of firmware write request to accessory, notice accessory wait-receiving mode writing address;
Step C, mobile terminal send writing address to accessory, notice accessory wait-receiving mode firmware;
Step D, mobile terminal send the data of the N number of byte in firmware to accessory according to i2c/uart agreement, with by accessory by the appropriate address of the data of described N number of byte stored in ROM space, N is 16 or 8;
Step e, return step C, until the data in firmware are all sent.
Further, after mobile terminal sends firmware to accessory according to i2c/uart agreement, also comprise:
Steps A, mobile terminal send the order of firmware read requests to accessory, and notice accessory wait-receiving mode reads address;
Step B, mobile terminal send and read address to accessory, notice accessory from described read address read the data of N number of byte;
Step C, mobile terminal receive the data of described N number of byte that accessory sends according to i2c/uart agreement;
The data of N number of byte corresponding with firmware for the data of described N number of byte contrast by step D, mobile terminal, if identical, then return step B, until all data checks in firmware are complete, if not identical, then perform step e;
Step e, mobile terminal send firmware to accessory according to i2c/uart agreement.
On the other hand, a kind of mobile terminal is provided, described mobile terminal comprises CPU, it is characterized in that, described mobile terminal also comprises a switch be connected with described CPU, by described switch, the OTG adapter be connected with described mobile terminal or the D+/D-of USB line be connected with described mobile terminal are connected with the i2c/uart of described CPU;
Described mobile terminal also comprises:
Firmware stores unit, for storing the firmware of accessory to described mobile terminal;
Described CPU comprises:
Connection establishment unit, for connecting with accessory;
Firmware transmitting element, for sending firmware to accessory by OTG adapter and the D+/D-of USB line that is connected with described OTG adapter according to i2c/uart agreement; Or
Firmware is sent to accessory according to i2c/uart agreement by the D+/D-of USB line.
Further, described CPU also comprises:
Upgrade receiving element, for receiving the upgrading accessory instruction of input;
Connection control unit, for controlling described switch according to the instruction of described upgrading accessory, by described switch, control the OTG adapter that is connected with described mobile terminal or the D+/D-of USB line that is connected with described mobile terminal is connected with the i2c/uart of described CPU.
Further, described firmware transmitting element comprises:
Erasing instruction sending module, for sending erase command to accessory, the data in notice accessory erasing ROM space;
Write request sending module, for sending the order of firmware write request to accessory, notice accessory wait-receiving mode writing address;
Writing address sending module, for sending writing address to accessory, notice accessory wait-receiving mode firmware;
Firmware sending module, for sending the data of the N number of byte in firmware to accessory according to i2c/uart agreement, with by accessory by the appropriate address of the data of described N number of byte stored in ROM space, repeat to call writing address sending module, until the data in firmware are all sent, N is 16 or 8.
Further, described CPU also comprises:
Read requests transmitting element, for sending the order of firmware read requests to accessory, notice accessory wait-receiving mode reads address;
Reading address transmitting element, reading address to accessory for sending, notice accessory from described read address read the data of N number of byte;
Data receipt unit, for receiving the data of described N number of byte that accessory sends according to i2c/uart agreement;
Data Comparison unit, for the data of N number of byte corresponding with firmware for the data of described N number of byte are contrasted, if identical, then call and read address transmitting element, until all data checks in firmware are complete, if not identical, then call firmware transmitting element, send firmware to accessory according to i2c/uart agreement.
Another aspect, provide a kind of system by updating mobile terminal accessory, comprise accessory, described system also comprises mobile terminal as above, after described mobile terminal plugs OTG interface, is connected with described accessory by USB line; Or
Described mobile terminal is connected with described accessory by USB line.
In the embodiment of the present invention, in advance by the firmware stores of accessory in the terminal, when needs are upgraded to accessory, by USB line or OTG joint and USB line, mobile terminal and accessory are coupled together, make simultaneously the OTG adapter that is connected with described mobile terminal or the D+/D of USB line that is connected with described mobile terminal ?be connected with the i2c/uart of described CPU after, mobile terminal can according to i2c/uart agreement by the line between mobile terminal and accessory, data in transmission firmware, to accessory, complete the firmware upgrade of accessory.After accessory dispatches from the factory, if meet serious bug or follow-up need add New function time, can pass through updating mobile terminal firmware, do not need accessory return-to-factory, user can operate in locality, and simply portable.
Accompanying drawing explanation
Fig. 1 is the realization flow figure of the upgrade method of the accessory that the embodiment of the present invention one provides;
Fig. 2 is the first the connected mode schematic diagram between the mobile terminal that provides of the embodiment of the present invention one and accessory;
Fig. 3 is the interface diagram of the switch that the embodiment of the present invention one provides;
Fig. 4 is the particular flow sheet of the accessory upgrading that the embodiment of the present invention one provides;
Fig. 5 is the realization flow figure of the upgrade method of the accessory that the embodiment of the present invention two provides;
Fig. 6 is the structured flowchart of the mobile terminal that the embodiment of the present invention three provides;
Fig. 7 is in the preferred enforcement that provides of the embodiment of the present invention three, has the structured flowchart of the CPU of upgrade checkout function.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearly understand, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein only in order to explain the present invention, be not intended to limit the present invention.
In embodiments of the present invention, store the firmware of accessory in mobile terminal, after mobile terminal and accessory connect, send firmware to accessory by OTG adapter and the D+/D-of USB line that is connected with described OTG adapter according to i2c/uart agreement; Or send firmware to accessory by the D+/D-of USB line according to i2c/uart agreement, complete the firmware upgrade of accessory.
Below in conjunction with specific embodiment, realization of the present invention is described in detail:
Embodiment one
Fig. 1 shows the realization flow of the upgrade method of the accessory that the embodiment of the present invention one provides, and details are as follows:
In step S101, store the firmware of accessory in mobile terminal.
Accessory is normally by micro-control unit (Micro Controller Unit, MCU) realize, the internal memory general less (generally only having 2k byte or 4k byte) of MCU, therefore, most of accessory does not have Wireless Fidelity WIFI function, and does not have perfect file system, so, accessory can not complete upgrade job by WIFI download firmware to this locality as mobile terminal, as storage card, can not can realize the random copy of firmware.
In view of the above-mentioned self-condition restriction of accessory, in embodiments of the present invention, first by the firmware stores of accessory in the storage card of mobile terminal, then mobile terminal is connected by USB line or by OTG adapter and USB line with accessory, successively send data in firmware in accessory by mobile terminal, complete the upgrading of accessory.
Wherein, the storage card mentioned in the embodiment of the present invention can comprise SD card, miniSD card, TF card, MS card etc.
The mobile terminal mentioned in the embodiment of the present invention includes but not limited to that mobile phone, panel computer, laptop computer, music player (such as MP3) etc. have the electronic equipment of USB interface.
In step s 102, mobile terminal and accessory connect.
In embodiments of the present invention, can be connected by two kinds of modes between mobile terminal and accessory, a kind of connected mode as shown in Figure 2.
Concrete, in fig. 2, the terminal of left side signal is mobile terminal, and the adapter of OTG before this of the white be connected with mobile terminal, what be connected with OTG adapter is USB line, and the rightmost terminal be connected with USB line is accessory.
Another kind of connected mode is: mobile terminal is directly connected by USB line with accessory.In this case, accessory is adapter or portable power source.
In step s 103, mobile terminal sends firmware to accessory by OTG adapter and the D+/D-of USB line that is connected with described OTG adapter according to i2c/uart agreement, or mobile terminal pass through USB line D+/D-according to i2c/uart agreement transmission firmware to accessory.
In embodiments of the present invention, mobile terminal comprises a switch, this switch is arranged on the usb communication circuit of mobile terminal, be connected with the CPU of mobile terminal, by described switch, the OTG adapter be connected with mobile terminal or the D+/D-of USB line be connected with mobile terminal are connected with the i2c/uart of described CPU.
Concrete, the interface of this switch as shown in Figure 3, comprises 9 pins, 2 D+, 2 D-, 1 VDD, 1 GND, 1 CTRL, SCL/UARTTX, 1 SDA/UARTRX.
Wherein, VCC/GND is VDD-to-VSS, in figure, the D+/D-on the left side can be connected with OTG adapter or USB line, the D+/D-contact of D+/D-and the CPU on the right connects, SCL/UARTTX with SDA/UARTRX on the right is connected with one group of i2c/uart contact of CPU respectively, CTRL is also connected with CPU, under the control of cpu, is connected by SCL/UARTTX with SDA/UARTRX on the right in D+/D-and the figure on the left side in figure.
CTRL is control signal, and during CTRL=1, in figure, the D+/D-on the left side is connected to the D+/D-on the right in figure; During CTRL=0, in figure, the D+/D-on the left side is connected to SCL/UARTTX and SDA/UARTRX on the right.Achieve like this under different demands, the D+/D-on the left side connects from different contacts and realizes different functions.Such as, in figure, the D+/D-on the left side is connected to SCL/UARTTX and SDA/UARTRX on the right, can by i2c/uart agreement to accessory firmware updating; When in figure, the D+/D-on the left side is connected to the D+/D-on the right, in figure, the D+/D-on the left side is connected to the USB function of CPU, can not upgrade to accessory.
So before will upgrading to accessory, mobile terminal is following step before also needing:
The upgrading accessory instruction of step 1, reception input.
Concrete, the interface of mobile terminal has the icon of " to accessory firmware updating ", after user clicks this icon, CPU can receive the instruction of a upgrading accessory.
Step 2, mobile terminal control described switch according to the instruction of described upgrading accessory, by described switch, control the OTG adapter that is connected with described mobile terminal or the D+/D-of USB line that is connected with described mobile terminal is connected with the i2c/uart of described CPU.
Concrete, after CPU receives the instruction of upgrading accessory, namely control switch by control signal CTRL=0, make the D+/D-on the left side in Fig. 3 be connected to SCL/UARTTX and SDA/UARTRX on the right.
In addition, before to accessory upgrading, accessory also will be first made to enter firmware upgrade pattern.Wherein, accessory can by specific mode, such as instantaneous short circuit, press the modes such as certain predetermined several combination button and enter firmware upgrade pattern.
After making accessory carry out firmware upgrade pattern, mobile terminal and accessory connect, and mobile terminal receive user input give accessory firmware updating instruction after, namely complete the upgrading of accessory by following step, concrete steps as shown in Figure 4, comprising:
Step 1, mobile terminal send erase command to accessory, the data in notice accessory erasing ROM space.
Concrete, mobile terminal sends ERASE order to accessory, the data in notice accessory erasing ROM space.After fitment receiver to ERASE order, the data in its ROM space are all wiped.
Step 2, mobile terminal send the order of firmware write request to accessory, notice accessory wait-receiving mode writing address.
Concrete, mobile terminal sends WRITE_CMD order to accessory, notice accessory wait-receiving mode writing address.Fitment receiver, to WRITE_CMD order, waits for the arrival of writing address.
Step 3, mobile terminal send writing address to accessory, notice accessory wait-receiving mode firmware.
Concrete, mobile terminal sends WRITE_ADDR to accessory, the firmware that notice accessory wait-receiving mode mobile terminal sends.After fitment receiver to WRITE_ADDR, wait for the arrival of the data in firmware.
Step 4, mobile terminal send the data of the N number of byte in firmware to accessory according to i2c/uart agreement, with by accessory by the appropriate address of the data of described N number of byte stored in ROM space.
Concrete, mobile terminal sends the data of the N number of byte in firmware to accessory according to i2c/uart agreement, accessory by the data of this N number of byte stored in ROM space, specifically stored in address be (WRITE_ADDR ~ WRITE_ADDR+N-1) in ROM space.
Step 5, return step 3, until the data in firmware are all sent.
Concrete, the writing address that mobile terminal sends at every turn is last writing address+N.Such as, the writing address that first time sends is WRITE_ADDR, and the writing address that second time sends is WRITE_ADDR+N.Wherein, N is 16 or 8, and this is relevant with i2c/uart agreement, is prior art, does not repeat them here.
The present embodiment, in advance by the firmware stores of accessory in the terminal, when needs are upgraded to accessory, by USB line or OTG joint and USB line, mobile terminal and accessory are coupled together, after making the OTG adapter that is connected with described mobile terminal or the D+/D-of USB line that is connected with described mobile terminal be connected with the i2c/uart of described CPU simultaneously, mobile terminal can according to i2c/uart agreement by the line between mobile terminal and accessory, data in transmission firmware, to accessory, complete the firmware upgrade of accessory.After accessory dispatches from the factory, if meet serious bug or follow-up need add New function time, can pass through updating mobile terminal firmware, do not need accessory return-to-factory, user can operate in locality, and simply portable.
One of ordinary skill in the art will appreciate that all or part of step realized in the various embodiments described above method is that the hardware that can carry out instruction relevant by program has come, corresponding program can be stored in a computer read/write memory medium, described storage medium, as ROM/RAM, disk or CD etc.
Embodiment two
Fig. 5 shows the realization flow of the upgrade method of the accessory that the embodiment of the present invention two provides, and details are as follows:
The present embodiment two carries out on the basis of embodiment one, in order to ensure that accessory has been entered in the firmware burning like clockwork that in embodiment one, mobile terminal sends, the firmware in the accessory after to upgrading is needed to verify, if by verification, then no longer carry out updating operation, if do not passed through, then need to call the step S103 in embodiment one, again updating operation is carried out to accessory.Concrete, the process of verification comprises the following steps:
In step S501, mobile terminal sends the order of firmware read requests to accessory, and notice accessory wait-receiving mode reads address.
Concrete, mobile terminal sends and reads address READ_CMD order to accessory, and after fitment receiver to READ_CMD order, what wait-receiving mode mobile terminal sent reads address.
In step S502, mobile terminal sends and reads address to accessory, notice accessory from described read address read the data of N number of byte.
Concrete, mobile terminal sends and reads address READ_ADDR to accessory, after fitment receiver to READ_ADDR, reads the data that (READ_ADDR ~ READ_ADDR+N-1) address stores, and returns the data that read to mobile terminal.
In step S503, mobile terminal receives the data of described N number of byte that accessory sends according to i2c/uart agreement.
Concrete, accessory, according to i2c/uart agreement, sends the data of the N number of byte read to mobile terminal at every turn.
In step S504, the data of N number of byte corresponding with firmware for the data of described N number of byte contrast by mobile terminal, if identical, then return step S502, until all data checks in firmware are complete, if not identical, then return the step S103 performed in embodiment one, send firmware to accessory according to i2c/uart agreement.
Concrete, after mobile terminal receives the data of N number of byte that accessory sends, N number of data that the data of this N number of byte are corresponding with the firmware that this locality stores contrast, if both contents are identical, then represent and send to these N number of data of accessory correct, return step S502, continue to contrast the N number of data of the next one, until all data checks in firmware are complete, if centre finds that there is not identical data, then represent that accessory is upgraded unsuccessfully, then upgrade to accessory again.
In addition, preferably, after accessory upgrading is correct, mobile terminal sends and exits upgrade to accessory, and accessory exits firmware upgrade pattern.Concrete, mobile terminal sends JUMP_TO_APP instruction to accessory, after fitment receiver to JUMP_TO_APP instruction, exits firmware upgrade pattern.
The present embodiment, after completing the upgrading to accessory, verifies the data in accessory, if verify unsuccessfully, then again upgrade to accessory by mobile terminal, ensure that the firmware burning like clockwork in mobile terminal is entered in accessory.
Embodiment three
Fig. 6 shows the concrete structure block diagram of the mobile terminal that the embodiment of the present invention three provides, and for convenience of explanation, illustrate only the part relevant to the embodiment of the present invention.After this mobile terminal 6 plugs OTG interface, be connected with accessory by USB line, or this mobile terminal 6 connects to form a system by updating mobile terminal accessory by USB line and accessory, mobile terminal sends the firmware of the accessory being stored in this locality in accessory, complete the upgrading of accessory, this mobile terminal 6 comprises: CPU61, also comprise a switch 62 be connected with described CPU, by described switch 62, the OTG adapter be connected with mobile terminal 6 or the D+/D-of USB line be connected with mobile terminal 6 are connected with the i2c/uart of described CPU61.
Described mobile terminal 6 also comprises:
Firmware stores unit 63, for storing the firmware of accessory to described mobile terminal;
Described CPU61 comprises:
Connection establishment unit 611, for connecting with accessory;
Firmware transmitting element 612, for sending firmware to accessory by OTG adapter and the D+/D-of USB line that is connected with described OTG adapter according to i2c/uart agreement; Or, send firmware to accessory by the D+/D-of USB line according to i2c/uart agreement.
Further, described CPU61 also comprises:
Upgrade receiving element, for receiving the upgrading accessory instruction of input;
Connection control unit, for controlling described switch according to the instruction of described upgrading accessory, by described switch, control the OTG adapter that is connected with described mobile terminal or the D+/D-of USB line that is connected with described mobile terminal is connected with the i2c/uart of described CPU.
Concrete, described firmware transmitting element 612 comprises:
Erasing instruction sending module, for sending erase command to accessory, the data in notice accessory erasing ROM space;
Write request sending module, for sending the order of firmware write request to accessory, notice accessory wait-receiving mode writing address;
Writing address sending module, for sending writing address to accessory, notice accessory wait-receiving mode firmware;
Firmware sending module, for sending the data of the N number of byte in firmware to accessory according to i2c/uart agreement, with by accessory by the appropriate address of the data of described N number of byte stored in ROM space, repeat to call writing address sending module, until the data in firmware are all sent.
Preferably, in order to ensure that accessory has been entered in the firmware burning like clockwork that mobile terminal sends, the CPU61 of this mobile terminal 6 also comprises read requests transmitting element 711, reads address transmitting element 712, data receipt unit 713 and Data Comparison unit 714, as shown in Figure 7.
Wherein, read requests transmitting element 711, for sending the order of firmware read requests to accessory, notice accessory wait-receiving mode reads address;
Reading address transmitting element 712, reading address to accessory for sending, notice accessory from described read address read the data of N number of byte;
Data receipt unit 713, for receiving the data of described N number of byte that accessory sends according to i2c/uart agreement;
Data Comparison unit 714, for the data of N number of byte corresponding with firmware for the data of described N number of byte are contrasted, if identical, then call and read address transmitting element 712, until all data checks in firmware are complete, if not identical, then call firmware transmitting element 612, send firmware to accessory according to i2c/uart agreement.
In the embodiment of the method one that the mobile terminal that the embodiment of the present invention provides can be applied in aforementioned correspondence and embodiment two, details, see the description of above-described embodiment one and embodiment two, do not repeat them here.
It should be noted that in above-mentioned mobile terminal embodiment, included unit is carry out dividing according to function logic, but is not limited to above-mentioned division, as long as can realize corresponding function; In addition, the concrete title of each functional unit, also just for the ease of mutual differentiation, is not limited to protection scope of the present invention.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any amendments done within the spirit and principles in the present invention, equivalent replacement and improvement etc., all should be included within protection scope of the present invention.

Claims (9)

1. the method by updating mobile terminal accessory, described mobile terminal comprises CPU, it is characterized in that, described mobile terminal also comprises a switch be connected with described CPU, by described switch, the OTG adapter be connected with described mobile terminal or the D+/D-of USB line be connected with described mobile terminal are connected with the i2c/uart of described CPU, and described method comprises:
Store the firmware of accessory in mobile terminal;
Mobile terminal and accessory connect;
Mobile terminal sends firmware to accessory by OTG adapter and the D+/D-of USB line that is connected with described OTG adapter according to i2c/uart agreement; Or
Mobile terminal sends firmware to accessory by the D+/D-of USB line according to i2c/uart agreement.
2. the method for claim 1, is characterized in that, before mobile terminal sends firmware to accessory according to i2c/uart agreement, also comprises:
Mobile terminal receives the upgrading accessory instruction of input;
Mobile terminal controls described switch according to the instruction of described upgrading accessory, by described switch, controls the OTG adapter that is connected with described mobile terminal or the D+/D-of USB line that is connected with described mobile terminal is connected with the i2c/uart of described CPU.
3. the method for claim 1, is characterized in that, mobile terminal sends firmware according to i2c/uart agreement and comprises to accessory:
Steps A, mobile terminal send erase command to accessory, the data in notice accessory erasing ROM space;
Step B, mobile terminal send the order of firmware write request to accessory, notice accessory wait-receiving mode writing address;
Step C, mobile terminal send writing address to accessory, notice accessory wait-receiving mode firmware;
Step D, mobile terminal send the data of the N number of byte in firmware to accessory according to i2c/uart agreement, with by accessory by the appropriate address of the data of described N number of byte stored in ROM space, N is 16 or 8;
Step e, return step C, until the data in firmware are all sent.
4. the method as described in claim 1,2 or 3, is characterized in that, after mobile terminal sends firmware to accessory according to i2c/uart agreement, also comprises:
Steps A, mobile terminal send the order of firmware read requests to accessory, and notice accessory wait-receiving mode reads address;
Step B, mobile terminal send and read address to accessory, notice accessory from described read address read the data of N number of byte;
Step C, mobile terminal receive the data of described N number of byte that accessory sends according to i2c/uart agreement;
The data of N number of byte corresponding with firmware for the data of described N number of byte contrast by step D, mobile terminal, if identical, then return step B, until all data checks in firmware are complete, if not identical, then perform step e;
Step e, mobile terminal send firmware to accessory according to i2c/uart agreement.
5. a mobile terminal, it is characterized in that, described mobile terminal comprises CPU, it is characterized in that, described mobile terminal also comprises a switch be connected with described CPU, by described switch, the OTG adapter be connected with described mobile terminal or the D+/D-of USB line be connected with described mobile terminal are connected with the i2c/uart of described CPU;
Described mobile terminal also comprises:
Firmware stores unit, for storing the firmware of accessory to described mobile terminal;
Described CPU comprises:
Connection establishment unit, for connecting with accessory;
Firmware transmitting element, for sending firmware to accessory by OTG adapter and the D+/D-of USB line that is connected with described OTG adapter according to i2c/uart agreement; Or
Firmware is sent to accessory according to i2c/uart agreement by the D+/D-of USB line.
6. mobile terminal as claimed in claim 5, it is characterized in that, described CPU also comprises:
Upgrade receiving element, for receiving the upgrading accessory instruction of input;
Connection control unit, for controlling described switch according to the instruction of described upgrading accessory, by described switch, control the OTG adapter that is connected with described mobile terminal or the D+/D-of USB line that is connected with described mobile terminal is connected with the i2c/uart of described CPU.
7. mobile terminal as claimed in claim 5, it is characterized in that, described firmware transmitting element comprises:
Erasing instruction sending module, for sending erase command to accessory, the data in notice accessory erasing ROM space;
Write request sending module, for sending the order of firmware write request to accessory, notice accessory wait-receiving mode writing address;
Writing address sending module, for sending writing address to accessory, notice accessory wait-receiving mode firmware;
Firmware sending module, for sending the data of the N number of byte in firmware to accessory according to i2c/uart agreement, with by accessory by the appropriate address of the data of described N number of byte stored in ROM space, repeat to call writing address sending module, until the data in firmware are all sent, N is 16 or 8.
8. the mobile terminal as described in claim 5,6 or 7, is characterized in that, described CPU also comprises:
Read requests transmitting element, for sending the order of firmware read requests to accessory, notice accessory wait-receiving mode reads address;
Reading address transmitting element, reading address to accessory for sending, notice accessory from described read address read the data of N number of byte;
Data receipt unit, for receiving the data of described N number of byte that accessory sends according to i2c/uart agreement;
Data Comparison unit, for the data of N number of byte corresponding with firmware for the data of described N number of byte are contrasted, if identical, then call and read address transmitting element, until all data checks in firmware are complete, if not identical, then call firmware transmitting element, send firmware to accessory according to i2c/uart agreement.
9., by a system for updating mobile terminal accessory, comprise accessory, it is characterized in that, described system also comprises the mobile terminal as described in any one of claim 5 to 8, after described mobile terminal plugs OTG interface, is connected with described accessory by USB line; Or
Described mobile terminal is connected with described accessory by USB line.
CN201410445897.9A 2014-09-03 2014-09-03 A kind of method, system and mobile terminal by updating mobile terminal accessory Expired - Fee Related CN104239097B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410445897.9A CN104239097B (en) 2014-09-03 2014-09-03 A kind of method, system and mobile terminal by updating mobile terminal accessory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410445897.9A CN104239097B (en) 2014-09-03 2014-09-03 A kind of method, system and mobile terminal by updating mobile terminal accessory

Publications (2)

Publication Number Publication Date
CN104239097A true CN104239097A (en) 2014-12-24
CN104239097B CN104239097B (en) 2018-01-16

Family

ID=52227232

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410445897.9A Expired - Fee Related CN104239097B (en) 2014-09-03 2014-09-03 A kind of method, system and mobile terminal by updating mobile terminal accessory

Country Status (1)

Country Link
CN (1) CN104239097B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106415490A (en) * 2015-09-24 2017-02-15 广东欧珀移动通信有限公司 Mobile terminal, power supply adapter and upgrading method thereof
CN106416196A (en) * 2015-09-24 2017-02-15 广东欧珀移动通信有限公司 Mobile terminal, power adapter and updating method thereof
CN106471789A (en) * 2015-09-24 2017-03-01 广东欧珀移动通信有限公司 The methods, devices and systems of adapter upgrade
CN106791162A (en) * 2017-01-07 2017-05-31 广州瑞新教育科技有限公司 OMR apparatus for marking examinating paper Internet of Things modernization systems and technology are realized using Android mobile phone
CN107148715A (en) * 2015-09-24 2017-09-08 广东欧珀移动通信有限公司 Mobile terminal, power supply adaptor and its upgrade method
CN108028767A (en) * 2015-09-24 2018-05-11 广东欧珀移动通信有限公司 For the method for adapter upgrade, mobile terminal and adapter
CN109960524A (en) * 2019-03-22 2019-07-02 威海优微科技有限公司 A kind of method and its equipment carrying out online software upgrade by I2C
CN111381853A (en) * 2020-03-16 2020-07-07 Oppo广东移动通信有限公司 Adapter upgrading method and device, electronic equipment and computer readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060136899A1 (en) * 2004-12-20 2006-06-22 Samsung Electronics Co., Ltd. Method for programming/updating software using USB OTG
CN101110040A (en) * 2007-09-05 2008-01-23 威盛电子股份有限公司 Firmware updating method
CN101625648A (en) * 2009-08-18 2010-01-13 深圳华为通信技术有限公司 Plug and play equipment, firmware upgrade method and firmware upgrade device
CN101980159A (en) * 2010-10-18 2011-02-23 中颖电子有限公司 Updating device and updating method for firmware of U disk
CN103729213A (en) * 2013-12-18 2014-04-16 杭州华为数字技术有限公司 Flash online upgrade method and device
CN103970561A (en) * 2013-02-04 2014-08-06 成一电子股份有限公司 Updating method of audio playing firmware and audio playing device applied by same

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060136899A1 (en) * 2004-12-20 2006-06-22 Samsung Electronics Co., Ltd. Method for programming/updating software using USB OTG
CN101110040A (en) * 2007-09-05 2008-01-23 威盛电子股份有限公司 Firmware updating method
CN101625648A (en) * 2009-08-18 2010-01-13 深圳华为通信技术有限公司 Plug and play equipment, firmware upgrade method and firmware upgrade device
CN101980159A (en) * 2010-10-18 2011-02-23 中颖电子有限公司 Updating device and updating method for firmware of U disk
CN103970561A (en) * 2013-02-04 2014-08-06 成一电子股份有限公司 Updating method of audio playing firmware and audio playing device applied by same
CN103729213A (en) * 2013-12-18 2014-04-16 杭州华为数字技术有限公司 Flash online upgrade method and device

Cited By (27)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10318270B2 (en) 2015-09-24 2019-06-11 Guangdong Oppo Mobile Telecommunications Corp, Ltd. Method for upgrading firmware of adapter, apparatus, and system thereof
CN106415490B (en) * 2015-09-24 2020-03-13 Oppo广东移动通信有限公司 Mobile terminal, power adapter and upgrading method thereof
CN106415490A (en) * 2015-09-24 2017-02-15 广东欧珀移动通信有限公司 Mobile terminal, power supply adapter and upgrading method thereof
WO2017049549A1 (en) * 2015-09-24 2017-03-30 广东欧珀移动通信有限公司 Mobile terminal, power supply adapter, and upgrading method thereof
CN111209026B (en) * 2015-09-24 2023-07-04 Oppo广东移动通信有限公司 Mobile terminal, power adapter and upgrading method thereof
CN107148715A (en) * 2015-09-24 2017-09-08 广东欧珀移动通信有限公司 Mobile terminal, power supply adaptor and its upgrade method
EP3171484A4 (en) * 2015-09-24 2017-12-27 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Mobile terminal, power supply adapter, and upgrading method thereof
EP3171245A4 (en) * 2015-09-24 2018-02-14 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method, apparatus, and system for upgrading adapter
EP3258737A4 (en) * 2015-09-24 2018-02-21 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Mobile terminal, power supply adapter, and upgrading method thereof
CN108028767A (en) * 2015-09-24 2018-05-11 广东欧珀移动通信有限公司 For the method for adapter upgrade, mobile terminal and adapter
US9971591B2 (en) 2015-09-24 2018-05-15 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Mobile terminal, power adapter, and upgrade method thereof
EP3322122A4 (en) * 2015-09-24 2019-05-01 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Adapter upgrade method, mobile terminal, and adapter
CN106471789A (en) * 2015-09-24 2017-03-01 广东欧珀移动通信有限公司 The methods, devices and systems of adapter upgrade
US10908894B2 (en) 2015-09-24 2021-02-02 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Method for upgrading firmware of adapter, mobile terminal, and adapter thereof
CN111209026A (en) * 2015-09-24 2020-05-29 Oppo广东移动通信有限公司 Mobile terminal, power adapter and upgrading method thereof
US10412207B2 (en) 2015-09-24 2019-09-10 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Mobile terminal, power adapter, and upgrade method thereof
CN107148715B (en) * 2015-09-24 2019-10-22 Oppo广东移动通信有限公司 Mobile terminal, power supply adaptor and its upgrade method
US10474452B2 (en) 2015-09-24 2019-11-12 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Firmware upgrade through GPIO port via UART protocol
CN106416196B (en) * 2015-09-24 2020-02-11 Oppo广东移动通信有限公司 Mobile terminal, power adapter and upgrading method thereof
CN106416196A (en) * 2015-09-24 2017-02-15 广东欧珀移动通信有限公司 Mobile terminal, power adapter and updating method thereof
CN106416196B8 (en) * 2015-09-24 2020-04-21 Oppo广东移动通信有限公司 Mobile terminal, power adapter and upgrading method thereof
EP3518383A1 (en) * 2015-09-24 2019-07-31 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Mobile terminal, power adapter, and upgrading method thereof
EP3726925A1 (en) 2015-09-24 2020-10-21 Guangdong Oppo Mobile Telecommunications Corp., Ltd. Mobile terminal, power adapter, and upgrade method thereof
CN106791162A (en) * 2017-01-07 2017-05-31 广州瑞新教育科技有限公司 OMR apparatus for marking examinating paper Internet of Things modernization systems and technology are realized using Android mobile phone
CN109960524A (en) * 2019-03-22 2019-07-02 威海优微科技有限公司 A kind of method and its equipment carrying out online software upgrade by I2C
CN111381853A (en) * 2020-03-16 2020-07-07 Oppo广东移动通信有限公司 Adapter upgrading method and device, electronic equipment and computer readable storage medium
CN111381853B (en) * 2020-03-16 2024-01-30 Oppo广东移动通信有限公司 Adapter upgrading method and device, electronic equipment and computer readable storage medium

Also Published As

Publication number Publication date
CN104239097B (en) 2018-01-16

Similar Documents

Publication Publication Date Title
CN104239097A (en) Method and system for upgrading fitting by virtue of mobile terminal, and mobile terminal
US8417864B2 (en) Cascade-able serial bus device with clock and management and cascade methods using the same
US11581673B2 (en) Card holder and mobile terminal
CN102483728A (en) Device-dependent selection between modes for asymmetric serial protocols
CN101454746A (en) Method for communication with a multi-function memory card
US20080244127A1 (en) Computer interface controller for portable plug-and-play peripherals
CN102591827A (en) Apparatus for peripheral device connection using SPI in portable terminal and method for data transmission using the same
CN213069787U (en) Read-write control system of memory card
CN109451098A (en) FPGA accelerator card MAC Address configuration method, device and accelerator card
EP2704017A2 (en) Interface arbitration for a wired tag
CN104834619A (en) I2C (Inter-Integrated Circuit) bus circuit, implementation method and electronic equipment
JP2016524771A (en) Method and device for updating program data
CN103744478A (en) Bluetooth wireless display and control method thereof
CN103092648A (en) Method and system of mirror image upgrade and user device and personal computer
CN102654857A (en) Communication method capable of simulating SPI protocol by adopting GPIO interface
CN101667133B (en) Method for updating firmware and chip updating firmware by using same
US9990027B2 (en) Status switching method
CN103761135A (en) Firmware write-in method of embedded device
CN112306937B (en) Setting selection circuit, method, device and medium for mainboard device in server
JP2005174337A (en) Memory system, and method for setting data transmission speed between host and memory card
CN116431546B (en) Parameter configuration method, electronic device, storage medium, and program product
CN105740015A (en) Upgrade method for firmware of HMD device
CN108628621A (en) It is a kind of from the firmware upgrade method of equipment and slave equipment, the system of firmware upgrade
CN108933841A (en) A kind of control method and device of radio-frequency front-end equipment
CN101311914B (en) Electronic device and peripheral device matching system and its matching method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before: Changan town in Guangdong province Dongguan 523841 usha Beach Road No. 18

Patentee before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20180116