CN104239097B - A kind of method, system and mobile terminal by updating mobile terminal accessory - Google Patents
A kind of method, system and mobile terminal by updating mobile terminal accessory Download PDFInfo
- Publication number
- CN104239097B CN104239097B CN201410445897.9A CN201410445897A CN104239097B CN 104239097 B CN104239097 B CN 104239097B CN 201410445897 A CN201410445897 A CN 201410445897A CN 104239097 B CN104239097 B CN 104239097B
- Authority
- CN
- China
- Prior art keywords
- accessory
- mobile terminal
- firmware
- uart
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Landscapes
- Stored Programmes (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The present invention is applied to upgrade technique field, provide a kind of method, system and mobile terminal by updating mobile terminal accessory, the mobile terminal includes CPU, the mobile terminal also includes a change-over switch being connected with the CPU, pass through the change-over switch, the OTG adapters or the D+/D for the USB line being connected with the mobile terminal being connected with the mobile terminal are connected with the i2c/uart of the CPU, and methods described includes:The firmware of accessory is stored into mobile terminal;Mobile terminal is established with accessory and connected;Mobile terminal sends firmware to accessory by the D+/D of OTG adapters and the USB line being connected with the OTG adapters according to i2c/uart agreements;Or mobile terminal sends firmware to accessory by the D+/D of USB line according to i2c/uart agreements.The present invention, after accessory dispatches from the factory, if meet serious bug or subsequently need to add New function, updating mobile terminal firmware can be passed through, it is not necessary to which by accessory return-to-factory, user can operate in locality, and simple portable.
Description
Technical field
The invention belongs to upgrade technique field, more particularly to it is a kind of by the method for updating mobile terminal accessory, system and
Mobile terminal.
Background technology
With the popularization of intelligent mobile terminal, various accessories occur like the mushrooms after rain, such as fast charge adapter, mobile electricity
Source, healthy bracelet, intelligent glasses etc..
Because the universal smaller, major part of the memory space of accessory does not have Wireless Fidelity WIFI function, and without complete text
Part system, storage file is unable to, therefore equally passes through over the air (Over-the-Air without image of Buddha mobile terminal
Technology, OTA) accessory is upgraded.If meeting great bug or needing to increase New function, factory can only be returned, by manufacturer
Accessory is taken apart, the circuit board of accessory is placed on tool, firmware is carried out to the chip inside circuit board by specific instrument
Upgrading.
The content of the invention
The embodiments of the invention provide a kind of method, system and mobile terminal by updating mobile terminal accessory, it is intended to
Solves the upgrade method for the accessory that prior art provides, it is necessary to the problem of returning factory's upgrading.
On the one hand, there is provided a kind of method by updating mobile terminal accessory, the mobile terminal include CPU, the shifting
Dynamic terminal also includes a change-over switch being connected with the CPU, by the change-over switch, is connected with the mobile terminal
The D+/D- of OTG adapters or the USB line being connected with the mobile terminal is connected with the i2c/uart of the CPU, methods described
Including:
The firmware of accessory is stored into mobile terminal;
Mobile terminal is established with accessory and connected;
Mobile terminal is by the D+/D- of OTG adapters and the USB line being connected with the OTG adapters according to i2c/
Uart agreements send firmware to accessory;Or
Mobile terminal sends firmware to accessory by the D+/D- of USB line according to i2c/uart agreements.
Further, before mobile terminal sends firmware to accessory according to i2c/uart agreements, in addition to:
Mobile terminal receives the upgrading accessory instruction of input;
Mobile terminal controls the change-over switch according to the upgrading accessory instruction, by the change-over switch, control with
The OTG adapters of mobile terminal connection or the D+/D-'s and the CPU of the USB line being connected with the mobile terminal
I2c/uart connections.
Further, mobile terminal sends firmware to accessory according to i2c/uart agreements and included:
Step A, mobile terminal sends erasing order to accessory, the data of notice accessory erasing ROM Space;
Step B, mobile terminal sends the order of firmware write request to the writing address to be received such as accessory, notice accessory;
Step C, mobile terminal sends writing address to the firmware to be received such as accessory, notice accessory;
Step D, mobile terminal sends the data of N number of byte in firmware according to i2c/uart agreements to accessory, with by with
The data of N number of byte are stored in the appropriate address of ROM Space by part, and N is 16 or 8;
Step E, return to step C, until the data in firmware are all sent.
Further, after mobile terminal sends firmware to accessory according to i2c/uart agreements, in addition to:
Step A, mobile terminal sends the order of firmware read requests to the reading address to be received such as accessory, notice accessory;
Step B, mobile terminal, which is sent, reads address to accessory, notifies accessory to read N number of byte since the reading address
Data;
Step C, mobile terminal receives the data for N number of byte that accessory is sent according to i2c/uart agreements;
Step D, mobile terminal is contrasted the data of the data of N number of byte N number of byte corresponding with firmware,
If identical, return to step B, until all data checks in firmware finish, if it is not the same, then performing step E;
Step E, mobile terminal sends firmware to accessory according to i2c/uart agreements.
On the other hand, there is provided a kind of mobile terminal, the mobile terminal include CPU, it is characterised in that the mobile terminal
Also include a change-over switch being connected with the CPU, by the change-over switch, the OTG being connected with the mobile terminal turns
The D+/D- of joint or the USB line being connected with the mobile terminal is connected with the i2c/uart of the CPU;
The mobile terminal also includes:
Firmware memory cell, for storing the firmware of accessory into the mobile terminal;
The CPU includes:
Connection establishment unit, connected for being established with accessory;
Firmware transmitting element, for being pressed by the D+/D- of OTG adapters and the USB line being connected with the OTG adapters
Firmware is sent to accessory according to i2c/uart agreements;Or
Firmware is sent to accessory according to i2c/uart agreements by the D+/D- of USB line.
Further, the CPU also includes:
Upgrade command receiving unit, for receiving the upgrading accessory instruction of input;
Control unit is connected, for controlling the change-over switch according to the upgrading accessory instruction, is opened by the conversion
Close, control D+/D- and the institute of the OTG adapters being connected with the mobile terminal or the USB line being connected with the mobile terminal
State CPU i2c/uart connections.
Further, the firmware transmitting element includes:
Erasing instruction sending module, for sending erasing order to accessory, the data of notice accessory erasing ROM Space;
Write request sending module, for sending the order of firmware write request to the write-in to be received such as accessory, notice accessory
Address;
Writing address sending module, for sending writing address to the firmware to be received such as accessory, notice accessory;
Firmware sending module, for sending the data of N number of byte in firmware according to i2c/uart agreements to accessory, with by
The data of N number of byte are stored in the appropriate address of ROM Space by accessory, repeat to call writing address sending module, until
Data in firmware are all sent, and N is 16 or 8.
Further, the CPU also includes:
Read requests transmitting element, read ground to accessory, notice accessory etc. is to be received for sending the order of firmware read requests
Location;
Address transmitting element is read, address is read to accessory for sending, notifies accessory to read N number of word since the reading address
The data of section;
Data receipt unit, the data of the N number of byte sent for receiving accessory according to i2c/uart agreements;
Data comparison unit, for the data of the data of N number of byte N number of byte corresponding with firmware to be carried out pair
Than if identical, calling and reading address transmitting element, until all data checks in firmware finish, if it is not the same, then adjusting
With firmware transmitting element, firmware is sent to accessory according to i2c/uart agreements.
Another aspect, there is provided a kind of system by updating mobile terminal accessory, including accessory, the system are also included such as
Upper described mobile terminal, after the mobile terminal plugs OTG interfaces, is connected by USB line with the accessory;Or
The mobile terminal is connected by USB line with the accessory.
In the embodiment of the present invention, in advance by the firmware storage of accessory in the terminal, needing to upgrade accessory
When, mobile terminal and accessory are connected by USB line or OTG joints and USB line, while make to connect with the mobile terminal
After the OTG adapters or the D+/D- for the USB line being connected with the mobile terminal connect is connected with the i2c/uart of the CPU, move
Dynamic terminal can send data in firmware to matching somebody with somebody according to i2c/uart agreements by the line between mobile terminal and accessory
Part, complete the firmware upgrade of accessory.After accessory dispatches from the factory, if meet serious bug or subsequently need to add New function, Ke Yitong
Cross updating mobile terminal firmware, it is not necessary to which by accessory return-to-factory, user can operate in locality, and simple portable.
Brief description of the drawings
Fig. 1 is the implementation process figure of the upgrade method for the accessory that the embodiment of the present invention one provides;
Fig. 2 is the first connected mode schematic diagram between the mobile terminal and accessory that the embodiment of the present invention one provides;
Fig. 3 is the interface diagram for the change-over switch that the embodiment of the present invention one provides;
Fig. 4 is the particular flow sheet for the accessory upgrading that the embodiment of the present invention one provides;
Fig. 5 is the implementation process figure of the upgrade method for the accessory that the embodiment of the present invention two provides;
Fig. 6 is the structured flowchart for the mobile terminal that the embodiment of the present invention three provides;
Fig. 7 is being preferable to carry out of providing of the embodiment of the present invention three, has the CPU of upgrade checkout function structured flowchart.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used in the restriction present invention.
In embodiments of the present invention, the firmware of accessory is stored into mobile terminal, after mobile terminal establishes connection with accessory,
Firmware is sent extremely according to i2c/uart agreements by the D+/D- of OTG adapters and the USB line being connected with the OTG adapters
Accessory;Or firmware is sent to accessory according to i2c/uart agreements by the D+/D- of USB line, complete the firmware upgrade of accessory.
It is described in detail below in conjunction with realization of the specific embodiment to the present invention:
Embodiment one
Fig. 1 shows the implementation process of the upgrade method for the accessory that the embodiment of the present invention one provides, and details are as follows:
In step S101, the firmware of accessory is stored into mobile terminal.
Accessory typically by micro-control unit (Micro Controller Unit, MCU) come what is realized, MCU internal memory
Typically small (typically only 2k byte or 4k byte), therefore, most of accessory does not have Wireless Fidelity WIFI function, and does not have
Perfect file system, so, accessory can not download firmware by WIFI as mobile terminal and complete upgrade job to local,
Can not be as storage card, it is possible to achieve the random copy of firmware.
In view of the above-mentioned self-condition limitation of accessory, in embodiments of the present invention, first stores the firmware of accessory to movement
In the storage card of terminal, then it is connected by mobile terminal with accessory by USB line or by OTG adapters and USB line, by moving
Dynamic terminal gradually sends data in firmware into accessory, completes the upgrading of accessory.
Wherein, the storage card mentioned in the embodiment of the present invention can include SD card, miniSD cards, TF card, MS cards etc..
The mobile terminal mentioned in the embodiment of the present invention includes but is not limited to mobile phone, tablet personal computer, laptop computer, music and broadcast
Putting device (such as MP3) etc. has the electronic equipment of USB interface.
In step s 102, mobile terminal is established with accessory and connected.
In embodiments of the present invention, it can be established and connected by two ways between mobile terminal and accessory, one kind connection
Mode is as shown in Figure 2.
Specifically, in fig. 2, the terminal of left side signal is mobile terminal, the white OTG before this being connected with mobile terminal
Adapter, what is be connected with OTG adapters is USB line, and the terminal for the rightmost being connected with USB line is accessory.
Another connected mode is:Mobile terminal is directly connected with accessory by USB line.In this case, accessory is suitable
Orchestration or portable power source.
In step s 103, mobile terminal by the D+ of OTG adapters and the USB line being connected with the OTG adapters/
D- sends firmware to accessory according to i2c/uart agreements, or mobile terminal by the D+/D- of USB line according to i2c/uart agreements
Firmware is sent to accessory.
In embodiments of the present invention, mobile terminal includes a change-over switch, and the change-over switch is arranged in mobile terminal
Usb communication circuit on, be connected with the CPU of mobile terminal, by the change-over switch, the OTG switchings that are connected with mobile terminal
The D+/D- of head or the USB line being connected with mobile terminal is connected with the i2c/uart of the CPU.
Specifically, the interface of the change-over switch is as shown in figure 3, including 9 pins, 2 D+, 2 D-, 1 VDD, 1
GND, 1 CTRL, a SCL/UARTTX, 1 SDA/UARTRX.
Wherein, VCC/GND is power supply and ground, and the D+/D- on the left side can be connected with OTG adapters or USB line in figure, right
The D+/D- and CPU on side D+/D- contact portions, the SCL/UARTTX and SDA/UARTRX on the right one group of i2c/ with CPU respectively
Uart contact portions, CTRL are also connected with CPU, under the control of cpu, by the right in the D+/D- and figure on the left side in figure
SCL/UARTTX connects with SDA/UARTRX.
CTRL is control signal, and during CTRL=1, the D+/D- on the left side is connected to the D+/D- on the right in figure in figure;CTRL=0
When, the D+/D- on the left side is connected to the SCL/UARTTX and SDA/UARTRX on the right in figure.It has been achieved in that in different demands
Under, the D+/D- on the left side realizes different functions from different contact portions.For example the D+/D- on the left side is connected to the right in figure
SCL/UARTTX and SDA/UARTRX, accessory firmware updating can be given by i2c/uart agreements;The D+/D- connections on the left side in figure
To the right D+/D- when, the D+/D- on the left side is connected to CPU USB functions in figure, it is impossible to which accessory is upgraded.
So before upgrading to accessory, following step before mobile terminal also needs to:
Step 1, the upgrading accessory instruction for receiving input.
Specifically, have the icon of one " to accessory firmware updating " on the interface of mobile terminal, after user clicks on the icon,
CPU can receive a upgrading accessory instruction.
Step 2, mobile terminal control the change-over switch according to the upgrading accessory instruction, by the change-over switch,
Control the D+/D- of the OTG adapters that are connected with the mobile terminal or the USB line being connected with the mobile terminal with it is described
CPU i2c/uart connections.
Specifically, after CPU receives the instruction of upgrading accessory, you can change-over switch is controlled by control signal CTRL=0,
The D+/D- on the left side in Fig. 3 is set to be connected to the SCL/UARTTX and SDA/UARTRX on the right.
In addition, before upgrading to accessory, accessory is also first set to enter firmware upgrade pattern.Wherein, accessory can pass through
Specific mode, for example instantaneous short circuit, press the modes such as the several combination buttons of certain predetermined and enter firmware upgrade pattern.
After accessory is carried out firmware upgrade pattern, mobile terminal is established with accessory and connected, and mobile terminal receives
After the instruction to accessory firmware updating of user's input, you can the upgrading of accessory is completed by following steps, specific steps are such as
Shown in Fig. 4, including:
Step 1, mobile terminal send erasing order to accessory, the data of notice accessory erasing ROM Space.
Specifically, mobile terminal sends ERASE orders to accessory, the data of notice accessory erasing ROM Space.Fitment receiver
To after ERASE orders, the data of its ROM Space are all wiped.
Step 2, mobile terminal send the order of firmware write request to the writing address to be received such as accessory, notice accessory.
Specifically, mobile terminal sends WRITE_CMD orders to the writing address to be received such as accessory, notice accessory.Accessory
WRITE_CMD orders are received, wait the arrival of writing address.
Step 3, mobile terminal send writing address to the firmware to be received such as accessory, notice accessory.
Consolidate specifically, mobile terminal sends WRITE_ADDR to what the mobile terminal to be received such as accessory, notice accessory was sent
Part.Fitment receiver waits the arrival of the data in firmware to after WRITE_ADDR.
Step 4, mobile terminal send the data of N number of byte in firmware according to i2c/uart agreements to accessory, with by with
The data of N number of byte are stored in the appropriate address of ROM Space by part.
Specifically, data to accessory, the accessory that mobile terminal sends N number of byte in firmware according to i2c/uart agreements will
The data deposit ROM Space of this N number of byte, the address being specifically stored in is (WRITE_ADDR~WRITE_ADDR+ of ROM Space
N-1)。
Step 5, return to step 3, until the data in firmware are all sent.
Specifically, the writing address that mobile terminal is sent every time is last writing address+N.For example send for the first time
Writing address be WRITE_ADDR, second writing address sent is WRITE_ADDR+N.Wherein, N be 16 or 8, this with
I2c/uart agreements are relevant, are prior arts, will not be repeated here.
The present embodiment, in advance by the firmware storage of accessory in the terminal, when needing to upgrade accessory, pass through
USB line or OTG joints and USB line connect mobile terminal and accessory, while make the OTG being connected with the mobile terminal
After the D+/D- of adapter or the USB line being connected with the mobile terminal is connected with the i2c/uart of the CPU, mobile terminal
It can send the data in firmware according to i2c/uart agreements by the line between mobile terminal and accessory to accessory, complete
The firmware upgrade of accessory.After accessory dispatches from the factory, if meet serious bug or subsequently need to add New function, movement can be passed through
Terminal staging firmware, it is not necessary to which by accessory return-to-factory, user can operate in locality, and simple portable.
Can one of ordinary skill in the art will appreciate that realizing that all or part of step in the various embodiments described above method is
To instruct the hardware of correlation to complete by program, corresponding program can be stored in a computer read/write memory medium
In, described storage medium, such as ROM/RAM, disk or CD.
Embodiment two
Fig. 5 shows the implementation process of the upgrade method for the accessory that the embodiment of the present invention two provides, and details are as follows:
The present embodiment two is carried out on the basis of embodiment one, in order to ensure mobile terminal transmission in embodiment one
Burning has entered accessory, it is necessary to be verified to the firmware in the accessory after upgrading to firmware like clockwork, if by verifying, no
Carry out updating operation again, if not over, need call embodiment one in step S103, accessory is upgraded again
Operation.Specifically, the process of verification comprises the following steps:
In step S501, mobile terminal sends the order of firmware read requests and reads ground to accessory, notice accessory etc. is to be received
Location.
Specifically, mobile terminal, which is sent, reads address READ_CMD orders to accessory, after fitment receiver to READ_CMD orders,
The reading address sent etc. mobile terminal to be received.
In step S502, mobile terminal, which is sent, reads address to accessory, and it is N number of to notify that accessory is read since the reading address
The data of byte.
Specifically, mobile terminal, which is sent, reads address READ_ADDR to accessory, after fitment receiver to READ_ADDR, read
The data stored on (READ_ADDR~READ_ADDR+N-1) address, and the data that read are returned to mobile terminal.
In step S503, mobile terminal receives the data for N number of byte that accessory is sent according to i2c/uart agreements.
Specifically, accessory according to i2c/uart agreements, sends the data of the N number of byte read to mobile terminal every time.
In step S504, mobile terminal enters the data of the data of N number of byte N number of byte corresponding with firmware
Row contrast, if identical, return to step S502, until all data checks in firmware finish, if it is not the same, then returning
The step S103 in embodiment one is performed, firmware is sent to accessory according to i2c/uart agreements.
Specifically, after mobile terminal receives the data of N number of byte of accessory transmission, by the data of this N number of byte and this
Corresponding N number of data are contrasted in the firmware of ground storage, if both contents are identical, then it represents that this for being sent to accessory is N number of
Data are correct, return to step S502, continue to contrast next N number of data, until all data checks in firmware are complete
Finish, if middle find there are the data differed, then it represents that accessory upgrading failure, then accessory is upgraded again.
Furthermore it is preferred that after accessory upgrading is correct, mobile terminal sends and exits upgrade command to accessory, accessory
Exit firmware upgrade pattern.Instructed specifically, mobile terminal sends JUMP_TO_APP to accessory, fitment receiver to JUMP_TO_
After APP instructions, firmware upgrade pattern is exited.
The present embodiment, after being completed by mobile terminal to the upgrading of accessory, the data in accessory are verified, if school
Failure is tested, then accessory is upgraded again, ensure that the firmware in mobile terminal like clockwork enter in accessory by burning.
Embodiment three
Fig. 6 shows the concrete structure block diagram for the mobile terminal that the embodiment of the present invention three provides, and for convenience of description, only shows
The part related to the embodiment of the present invention is gone out.After the mobile terminal 6 plugs OTG interfaces, it is connected by USB line with accessory, or
Person's mobile terminal 6 is connected one system by updating mobile terminal accessory of composition, mobile terminal hair by USB line with accessory
The firmware for being stored in local accessory is sent to complete the upgrading of accessory into accessory, the mobile terminal 6 includes:CPU61 in addition to
One change-over switch 62 being connected with the CPU, by the change-over switch 62, the OTG adapters being connected with mobile terminal 6 or
The D+/D- for the USB line that person is connected with mobile terminal 6 is connected with the i2c/uart of the CPU61.
The mobile terminal 6 also includes:
Firmware memory cell 63, for storing the firmware of accessory into the mobile terminal;
The CPU61 includes:
Connection establishment unit 611, connected for being established with accessory;
Firmware transmitting element 612, for by the D+ of OTG adapters and the USB line being connected with the OTG adapters/
D- sends firmware to accessory according to i2c/uart agreements;Or sent admittedly according to i2c/uart agreements by the D+/D- of USB line
Part is to accessory.
Further, the CPU61 also includes:
Upgrade command receiving unit, for receiving the upgrading accessory instruction of input;
Control unit is connected, for controlling the change-over switch according to the upgrading accessory instruction, is opened by the conversion
Close, control D+/D- and the institute of the OTG adapters being connected with the mobile terminal or the USB line being connected with the mobile terminal
State CPU i2c/uart connections.
Specifically, the firmware transmitting element 612 includes:
Erasing instruction sending module, for sending erasing order to accessory, the data of notice accessory erasing ROM Space;
Write request sending module, for sending the order of firmware write request to the write-in to be received such as accessory, notice accessory
Address;
Writing address sending module, for sending writing address to the firmware to be received such as accessory, notice accessory;
Firmware sending module, for sending the data of N number of byte in firmware according to i2c/uart agreements to accessory, with by
The data of N number of byte are stored in the appropriate address of ROM Space by accessory, repeat to call writing address sending module, until
Data in firmware are all sent.
Preferably, in order to ensure that accessory has been entered in burning to the firmware of mobile terminal transmission like clockwork, the mobile terminal 6
CPU61 also includes read requests transmitting element 711, reads address transmitting element 712, data receipt unit 713 and data comparison list
Member 714, as shown in Figure 7.
Wherein, read requests transmitting element 711, waited for sending firmware read requests order to accessory, notice accessory
Receive and read address;
Address transmitting element 712 is read, address is read to accessory for sending, notifies accessory to read N since the reading address
The data of individual byte;
Data receipt unit 713, the data of the N number of byte sent for receiving accessory according to i2c/uart agreements;
Data comparison unit 714, for the data of the data of N number of byte N number of byte corresponding with firmware to be entered
Row contrast, if identical, call and read address transmitting element 712, until all data checks in firmware finish, if not phase
Together, then firmware transmitting element 612 is called, firmware is sent to accessory according to i2c/uart agreements.
Mobile terminal provided in an embodiment of the present invention can be applied in foregoing corresponding embodiment of the method one and embodiment two
In, details will not be repeated here referring to the description of above-described embodiment one and embodiment two.
It is worth noting that, in above-mentioned mobile terminal embodiment, included unit simply enters according to function logic
Row division, but above-mentioned division is not limited to, as long as corresponding function can be realized;In addition, each functional unit
Specific name is also only to facilitate mutually distinguish, the protection domain being not intended to limit the invention.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all essences in the present invention
All any modification, equivalent and improvement made within refreshing and principle etc., should be included in the scope of the protection.
Claims (7)
1. a kind of method by updating mobile terminal accessory, the mobile terminal includes CPU, it is characterised in that the movement
Terminal also includes a change-over switch being connected with the CPU;The OTG adapters that are connected with the mobile terminal or with it is described
The D+/D- of the USB line of mobile terminal connection is connected by the change-over switch with the i2c/uart of the CPU;The conversion is opened
Pass includes:First D+/D- pins, the 2nd D+/D- pins, i2c/uart pins and CTRL pins;Wherein, the first D+/
D- pins are connected with OTG adapters or USB line;The D+/D- contact portions of the 2nd D+/D- pins and the CPU;It is described
The i2c/uart contact portions of i2c/uart pins and the CPU;The CTRL pins are connected with the CPU;Work as CTRL signal
When=1, the first D+/D- pins are connected to the 2nd D+/D- pins, so that accessory is connected to the USB work(of the CPU
Energy;When CTRL signal=0, the first D+/D- pins are connected to the i2c/uart pins, so that the mobile terminal leads to
I2c/uart agreements are crossed to the accessory firmware updating;Wherein, the CTRL signal be the CTRL pins input signal, institute
The method of stating includes:
The firmware of accessory is stored into mobile terminal;
Mobile terminal is established with accessory and connected;
Mobile terminal receives the upgrading accessory instruction of input;
Mobile terminal controls the change-over switch according to the upgrading accessory instruction, so that the OTG adapters or USB line
D+/D- is connected by the change-over switch with the i2c/uart of the CPU;
Mobile terminal is by the D+/D- of the OTG adapters and the USB line being connected with the OTG adapters according to i2c/
Uart agreements send firmware to accessory;Or
Mobile terminal sends firmware to accessory by the D+/D- of the USB line according to i2c/uart agreements;
Wherein, mobile terminal transmission firmware to accessory is specially:The data in the firmware are gradually sent into the accessory, with
The accessory is set to complete upgrading.
2. the method as described in claim 1, it is characterised in that mobile terminal sends firmware to accessory according to i2c/uart agreements
Including:
Step A, mobile terminal sends erasing order to accessory, the data of notice accessory erasing ROM Space;
Step B, mobile terminal sends the order of firmware write request to the writing address to be received such as accessory, notice accessory;
Step C, mobile terminal sends writing address to the firmware to be received such as accessory, notice accessory;
Step D, mobile terminal sends the data of N number of byte in firmware according to i2c/uart agreements to accessory, with will by accessory
In the appropriate address of the data deposit ROM Space of N number of byte, N is 16 or 8;
Step E, return to step C, until the data in firmware are all sent.
3. method as claimed in claim 1 or 2, it is characterised in that send firmware according to i2c/uart agreements in mobile terminal
To accessory, in addition to:
Step A, mobile terminal sends the order of firmware read requests to the reading address to be received such as accessory, notice accessory;
Step B, mobile terminal, which is sent, reads address to accessory, notifies accessory to read the data of N number of byte since the reading address;
Step C, mobile terminal receives the data for N number of byte that accessory is sent according to i2c/uart agreements;
Step D, mobile terminal is contrasted the data of the data of N number of byte N number of byte corresponding with firmware, if
Identical, then return to step B, all data checks in firmware finish, if it is not the same, then performing step E;
Step E, mobile terminal sends firmware to accessory according to i2c/uart agreements.
4. a kind of mobile terminal, it is characterised in that the mobile terminal includes CPU, it is characterised in that the mobile terminal also wraps
Include a change-over switch being connected with the CPU;The OTG adapters that are connected with the mobile terminal or with the mobile terminal
The D+/D- of the USB line of connection is connected by the change-over switch with the i2c/uart of the CPU;The change-over switch includes:The
One D+/D- pins, the 2nd D+/D- pins, i2c/uart pins and CTRL pins;Wherein, the first D+/D- pins with
OTG adapters or USB line connection;The D+/D- contact portions of the 2nd D+/D- pins and the CPU;The i2c/uart
The i2c/uart contact portions of pin and the CPU;The CTRL pins are connected with the CPU;When CTRL signal=1, institute
State the first D+/D- pins and be connected to the 2nd D+/D- pins, so that accessory is connected to the USB functions of the CPU;Work as CTRL
During signal=0, the first D+/D- pins are connected to the i2c/uart pins, so that the mobile terminal passes through i2c/
Uart agreements give the accessory firmware updating;Wherein, the CTRL signal is the input signal of the CTRL pins;
The mobile terminal also includes:
Firmware memory cell, for storing the firmware of accessory into the mobile terminal;
The CPU includes:
Connection establishment unit, connected for being established with accessory;
Upgrade command receiving unit, for receiving the upgrading accessory instruction of input;
Connect control unit, for controlling the change-over switch according to the upgrading accessory instruction so that with the OTG adapters
Or it is connected with the D+/D- of the USB line by the change-over switch with the i2c/uart of the CPU;
Firmware transmitting element, pressed for the D+/D- by OTG adapters and the USB line being connected with the OTG adapters
Firmware is sent to accessory according to i2c/uart agreements;Or
Firmware is sent to accessory according to i2c/uart agreements by the D+/D- of the USB line;
Wherein, the firmware transmitting element is specifically used for:The data in the firmware are gradually sent into the accessory, so that institute
State accessory and complete upgrading.
5. mobile terminal as claimed in claim 4, it is characterised in that the firmware transmitting element includes:
Erasing instruction sending module, for sending erasing order to accessory, the data of notice accessory erasing ROM Space;
Write request sending module, for sending the order of firmware write request to the writing address to be received such as accessory, notice accessory;
Writing address sending module, for sending writing address to the firmware to be received such as accessory, notice accessory;
Firmware sending module, for the data according to N number of byte in i2c/uart agreements transmission firmware to accessory, with by accessory
The data of N number of byte are stored in the appropriate address of ROM Space, repeat to call writing address sending module, until firmware
In data be all sent, N be 16 or 8.
6. the mobile terminal as described in claim 4 or 5, it is characterised in that the CPU also includes:
Read requests transmitting element, for sending the order of firmware read requests to the reading address to be received such as accessory, notice accessory;
Address transmitting element is read, address is read to accessory for sending, notifies accessory to read N number of byte since the reading address
Data;
Data receipt unit, the data of the N number of byte sent for receiving accessory according to i2c/uart agreements;
Data comparison unit, for the data of the data of N number of byte N number of byte corresponding with firmware to be contrasted,
If identical, call and read address transmitting element, until all data checks in firmware finish, if it is not the same, then calling
Firmware transmitting element, firmware is sent to accessory according to i2c/uart agreements.
7. a kind of system by updating mobile terminal accessory, including accessory, it is characterised in that the system also includes such as right
It is required that the mobile terminal described in 4 to 6 any one, after the mobile terminal plugs OTG interfaces, is connected by USB line and the accessory
Connect;Or
The mobile terminal is connected by USB line with the accessory.
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 CN104239097A (en) | 2014-12-24 |
CN104239097B true 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) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017049548A1 (en) * | 2015-09-24 | 2017-03-30 | 广东欧珀移动通信有限公司 | Mobile terminal, power supply adapter, and upgrading method thereof |
CN106471789B (en) * | 2015-09-24 | 2021-02-02 | Oppo广东移动通信有限公司 | Adapter upgrading method, device and system |
WO2017049549A1 (en) * | 2015-09-24 | 2017-03-30 | 广东欧珀移动通信有限公司 | Mobile terminal, power supply adapter, and upgrading method thereof |
CN108028767B (en) | 2015-09-24 | 2020-03-20 | Oppo广东移动通信有限公司 | Method for upgrading adapter, mobile terminal and adapter |
CN111209026B (en) * | 2015-09-24 | 2023-07-04 | Oppo广东移动通信有限公司 | Mobile terminal, power adapter and upgrading 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 |
CN111381853B (en) * | 2020-03-16 | 2024-01-30 | Oppo广东移动通信有限公司 | Adapter upgrading method and device, electronic equipment and computer readable storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101110040A (en) * | 2007-09-05 | 2008-01-23 | 威盛电子股份有限公司 | Firmware updating method |
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 |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20060070112A (en) * | 2004-12-20 | 2006-06-23 | 삼성전자주식회사 | Method of programming/updating by usb otg |
CN101625648B (en) * | 2009-08-18 | 2013-04-24 | 华为终端有限公司 | Plug and play equipment, firmware upgrade method and firmware upgrade device |
TW201432568A (en) * | 2013-02-04 | 2014-08-16 | Keystone Semiconductor Corp | Updating method for audio playback firmware and audio playback device using the same |
-
2014
- 2014-09-03 CN CN201410445897.9A patent/CN104239097B/en not_active Expired - Fee Related
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101110040A (en) * | 2007-09-05 | 2008-01-23 | 威盛电子股份有限公司 | Firmware updating method |
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 |
Also Published As
Publication number | Publication date |
---|---|
CN104239097A (en) | 2014-12-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104239097B (en) | A kind of method, system and mobile terminal by updating mobile terminal accessory | |
CN107409056B (en) | Apparatus, system, method and device for facilitating data communication | |
US11113226B2 (en) | Firmware burning apparatus and system | |
JP4896450B2 (en) | Storage device | |
JP4817836B2 (en) | Card and host equipment | |
US20110153888A1 (en) | Cascade-able serial bus device with clock and management and cascade methods using the same | |
CN105095118B (en) | The application method and device of equipment | |
US20080244127A1 (en) | Computer interface controller for portable plug-and-play peripherals | |
TWM243761U (en) | Memory disk with wireless data transmitting and rceiving function | |
CN102591827A (en) | Apparatus for peripheral device connection using SPI in portable terminal and method for data transmission using the same | |
CN103258173A (en) | Wearable device, write-in system and write-in method for card | |
CN107463341A (en) | Method for deleting, device and the mobile terminal of FLASH chip | |
CN101196819A (en) | Method for chip self-adapting start equipment of system on chip | |
JP4588427B2 (en) | Memory system and data transmission speed setting method between host and memory card | |
CN1331037C (en) | Storing card with multi-interfae function and transmitting mode selective method | |
US9990027B2 (en) | Status switching method | |
KR100783158B1 (en) | The expansion device of USB memory apparatus and method thereof | |
TW201344444A (en) | Motherboard and data processing method thereof | |
US20200183589A1 (en) | Method and electronic device for initializing storage | |
US20100017554A1 (en) | System and method for managing a plugged device | |
CN102033713A (en) | Electronic system, controller and data transmission method | |
CN101311914B (en) | Electronic device and peripheral device matching system and its matching method | |
US20140375433A1 (en) | Electronic apparatus and control method thereof | |
CN115373540A (en) | Electronic device recognizing touch and performing display | |
CN114141291A (en) | Memory, memory control method and system |
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 |