US9804832B2 - Method, apparatus, and communication device for updating firmware - Google Patents

Method, apparatus, and communication device for updating firmware Download PDF

Info

Publication number
US9804832B2
US9804832B2 US14/896,492 US201414896492A US9804832B2 US 9804832 B2 US9804832 B2 US 9804832B2 US 201414896492 A US201414896492 A US 201414896492A US 9804832 B2 US9804832 B2 US 9804832B2
Authority
US
United States
Prior art keywords
update
file
firmware
interface
communication device
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.)
Active
Application number
US14/896,492
Other languages
English (en)
Other versions
US20160132315A1 (en
Inventor
Jingjing Yu
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.)
Huawei Device Co Ltd
Original Assignee
Huawei Device Co 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 Huawei Device Co Ltd filed Critical Huawei Device Co Ltd
Assigned to HUAWEI DEVICE CO., LTD. reassignment HUAWEI DEVICE CO., LTD. ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: YU, JINGJING
Publication of US20160132315A1 publication Critical patent/US20160132315A1/en
Application granted granted Critical
Publication of US9804832B2 publication Critical patent/US9804832B2/en
Assigned to HUAWEI DEVICE (SHENZHEN) CO., LTD. reassignment HUAWEI DEVICE (SHENZHEN) CO., LTD. CHANGE OF NAME (SEE DOCUMENT FOR DETAILS). Assignors: HUAWEI DEVICE CO.,LTD.
Assigned to HUAWEI DEVICE CO., LTD. reassignment HUAWEI DEVICE CO., LTD. ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: HUAWEI DEVICE (SHENZHEN) CO., LTD.
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/16Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
    • G06F15/163Interprocessor communication
    • G06F15/167Interprocessor communication using a common memory, e.g. mailbox
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/61Installation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 

Definitions

  • This application relates to the field of device update technologies, and in particular, to a method, an apparatus, and a communication device for updating firmware.
  • SD Secure Digital
  • the mobile terminals can support an SD card.
  • the SD card has features of a small size, large capacity, and plug-and-play
  • the SD card is generally used as an external storage device of a mobile terminal for storing data.
  • the mobile terminal may use the SD card to update firmware.
  • the process of using the SD card to update firmware by the mobile terminal may be as follows. After a firmware update file is copied to the SD card, the SD card is inserted into an SD interface, so that the SD card is connected to the mobile terminal. The mobile terminal reads the firmware update file in the SD card to update software of the mobile terminal.
  • the mobile terminal may further insert a communication device having an SD interface into the SD interface.
  • the communication device having the SD interface may support access to a Second Generation (2G), Third Generation (3G), or wireless network. Therefore, the mobile terminal can perform wireless Internet access through the communication device having the SD interface.
  • the communication device having the SD interface can write a firmware update file in the mobile terminal to an SD memory of the mobile terminal. After reading an update start command in the mobile terminal, the communication device having the SD interface runs the firmware update file in the SD memory to complete a firmware update.
  • SDIO Secure Digital Input and Output
  • SD interfaces do not support the SDIO function.
  • a communication device having such an SD interface cannot know, through the SD interface, whether data read by the communication device from the mobile terminal is an update start command, and further, the communication device having the SD interface cannot start a firmware update.
  • the present disclosure provides a method for updating firmware, so as to solve the problem in the prior art that when an SD interface does not support an SDIO function, a communication device having an SD interface cannot start a firmware update after the communication device is inserted into the SD interface.
  • This application further provides an apparatus for updating firmware and a communication device, so as to ensure that the method can be implemented and applied practically.
  • this application provides a method for updating firmware, applied to a communication device having a secure data interface through which the communication device having the secure data interface performs data communication with a mobile terminal, where the communication device having the secure data interface includes a secure data memory and a Flash memory, and the secure data memory stores a command swap file, where the secure data memory is a memory accessed by the mobile terminal through the secure data interface, the Flash memory is a memory storing the firmware in the communication device having the secure data interface, the method including obtaining an update start command from the command swap file, where the update start command is written by the mobile terminal to the command swap file; after the update start command is obtained, reading, from the secure data memory, a firmware update file storing update data, where the firmware update file is downloaded by the mobile terminal and written by the mobile terminal to the secure data memory, and the update data includes program codes for updating the firmware of the communication device having the secure data interface; and writing the firmware update file to the Flash memory.
  • the secure data memory further stores a result swap file
  • the method further includes, in the process of writing the firmware update file to the Flash memory, writing update progress to the result swap file; and after the firmware update file is written to the Flash memory, writing the update result to the result swap file.
  • the update progress and update result are written to the result swap file by using a small computer system interface command.
  • the method further includes obtaining an update status query command from the command swap file; and after the update status query command is obtained, sending the result swap file to the mobile terminal, where the update progress and update result are written in the result swap file.
  • the method further includes, after the firmware update file is written to the Flash memory completely, deleting the update start command from the command update file.
  • the method further includes, after the update start command is obtained, restarting the communication device having the secure data interface, entering an update mode of the communication device having the secure data interface, and in the update mode, reading, from the secure data memory, the firmware update file storing the update data; and after the firmware update file is written to the Flash memory completely, restarting the communication device having the secure data interface, and entering a common running mode of the communication device having the secure data interface.
  • the method before the firmware update file storing the update data is read from the secure data memory, the method further includes checking the firmware update file; and after it is checked that the firmware update file is a valid file, reading, from the secure data memory, the firmware update file storing the update data.
  • this application provides a method for updating firmware, applied to a mobile terminal which performs data communication through a secure digital interface with a communication device having a secure data interface, where the communication device having the secure data interface includes a secure data memory and a Flash memory, and the secure data memory stores a command swap file, where the secure data memory is a memory accessed by the mobile terminal through the secure data interface, the Flash memory is a memory storing the firmware in the communication device having the secure data interface, the method including downloading a firmware update file storing update data; writing the firmware update file to the secure data memory; and after the firmware update file is written to the secure data memory completely, writing an update start command in the mobile terminal to the command swap file, so that the communication device having the secure data interface obtains the update start command to perform firmware update.
  • the method further includes writing an update status query command in the mobile terminal to the command swap file.
  • the secure data memory further stores a result swap file
  • the method further includes receiving the result swap file sent by the communication device having the secure data interface, where the result swap file is sent after the communication device having the secure data interface obtains the update status query command, and the update progress and update result are written in the result swap file; and displaying the update progress and update result on the mobile terminal.
  • the update start command and update status query command are written to the command swap file by using a small computer system interface command.
  • this application further provides an apparatus for updating firmware, applied to a communication device having a secure data interface through which the communication device having the secure data interface performs data communication with a mobile terminal, where the communication device having the secure data interface includes a secure data memory and a Flash memory, and the secure data memory stores a command swap file, where the secure data memory is a memory accessed by the mobile terminal through the secure data interface, the Flash memory is a memory storing the firmware in the communication device having the secure data interface, the apparatus including a first obtaining unit configured to obtain an update start command from the command swap file, where the update start command is written by the mobile terminal to the command swap file; a reading unit configured to, after the update start command is obtained, read, from the secure data memory, a firmware update file storing update data, where the firmware update file is downloaded by the mobile terminal and written by the mobile terminal to the secure data memory, and the update data includes program codes for updating the firmware of the communication device having the secure data interface; and a first writing unit configured to write the firmware update file to the
  • the secure data memory further stores a result swap file
  • the apparatus further includes a second writing unit configured to write update progress to the result swap file in the process of writing the firmware update file to the Flash memory; and a third writing unit configured to write the update result to the result swap file after the firmware update file is written to the Flash memory.
  • the second writing unit writes the update progress to the result swap file by using a small computer system interface command; and the third writing unit writes the update result to the result swap file by using a small computer system interface command.
  • the apparatus further includes a second obtaining unit configured to obtain an update status query command from the command swap file; and a sending unit configured to send the result swap file to the mobile terminal after the update status query command is obtained, where the update progress and update result are written in the result swap file.
  • the apparatus further includes a deleting unit configured to delete the update start command from the command update file after the firmware update file is written to the Flash memory completely.
  • the apparatus further includes a starting unit configured to, after the update start command is obtained, restart the communication device having the secure data interface, and enter an update mode of the communication device having the secure data interface, and after the firmware update file is written to the Flash memory completely, restart the communication device having the secure data interface, and enter a common running mode of the communication device having the secure data interface; and the reading unit is configured to read, in the update mode from the secure data memory, the firmware update file storing the update data.
  • the apparatus further includes a checking unit configured to check the firmware update file; where the reading unit is configured to, after it is checked that the firmware update file is a valid file, read, from the secure data memory, the firmware update file storing the update data.
  • this application further provides a communication device having a secure data interface, where the communication device having the secure data interface includes a secure data memory, a Flash memory, and the apparatus for updating firmware according to the third aspect of this application, where the apparatus for updating firmware performs data communication with the secure data memory and the Flash memory respectively, and the secure data memory stores a command swap file, where the secure data memory is a memory accessed by the mobile terminal through the secure data interface, and the Flash memory is a memory storing the firmware in the communication device having the secure data interface.
  • this application provides an apparatus for updating firmware, applied to a mobile terminal which performs data communication through a secure digital interface with a communication device having a secure data interface, where the communication device having the secure data interface includes a secure data memory and a Flash memory, and the secure data memory stores a command swap file, where the secure data memory is a memory accessed by the mobile terminal through the secure data interface, the Flash memory is a memory storing the firmware in the communication device having the secure data interface, the apparatus including a downloading unit configured to download a firmware update file storing update data; a fourth writing unit configured to write the firmware update file to the secure data memory; and a fifth writing unit configured to write an update start command in the mobile terminal to the command swap file after the firmware update file is written to the secure data memory completely, so that the communication device having the secure data interface obtains the update start command to perform firmware update.
  • the apparatus further includes a sixth writing unit configured to write an update status query command in the mobile terminal to the command swap file.
  • the secure data memory further stores a result swap file
  • the apparatus further includes a receiving unit configured to receive the result swap file sent by the communication device having the secure data interface, where the result swap file is sent after the communication device having the secure data interface obtains the update status query command, and the update progress and update result are written in the result swap file; and a displaying unit configured to display the update progress and update result on the mobile terminal.
  • the fifth writing unit writes the update start command to the command swap file by using a small computer system interface command; and the sixth writing unit writes the update status query command to the command swap file by using a small computer system interface command.
  • a mobile terminal and a communication device having an SD interface can only read and write data in a secure data memory in units of files.
  • special files may be defined in the secure data memory to store an update start command and update data in different files, so that the mobile terminal and the communication device having the SD interface can know, by identifying the file names, whether data stored in the files is an update start command or update data.
  • the secure data memory stores two special files: a command swap file and a firmware update file.
  • the command swap file stores an update start command written by the mobile terminal
  • the firmware update file stores update data.
  • the communication device having the SD interface may obtain, by identifying the file names, data required in a firmware update process from the corresponding files.
  • the communication device having the SD interface When the communication device having the SD interface obtains the update start command from the command swap file, it indicates that the communication device having the SD interface starts to perform firmware update. Therefore, the communication device having the SD interface further reads, from the secure data memory, the firmware update file storing the update data, and then writes the firmware update file to the Flash memory to complete the firmware update.
  • FIG. 1 is a flowchart of a method for updating firmware according to this application
  • FIG. 2 is another flowchart of a method for updating firmware according to this application
  • FIG. 3 is still another flowchart of a method for updating firmware according to this application.
  • FIG. 4 is still another flowchart of a method for updating firmware according to this application.
  • FIG. 5 is a schematic structural diagram of an apparatus for updating firmware according to this application.
  • FIG. 6 is a schematic structural diagram of another apparatus for updating firmware according to this application.
  • FIG. 7 is a schematic structural diagram of another apparatus for updating firmware according to this application.
  • FIG. 8 is a schematic structural diagram of another apparatus for updating firmware according to this application.
  • FIG. 9 is a schematic structural diagram of another apparatus for updating firmware according to this application.
  • FIG. 10 is a schematic structural diagram of another apparatus for updating firmware according to this application.
  • FIG. 11 is a schematic structural diagram of another apparatus for updating firmware according to this application.
  • FIG. 12 is a schematic structural diagram of another apparatus for updating firmware according to this application.
  • FIG. 13 is a schematic structural diagram of a communication device having an SD interface according to this application.
  • FIG. 14 is a schematic diagram of a connection between a communication device having an SD interface and a mobile terminal according to this application;
  • FIG. 15 is a schematic diagram of software integrated in a communication device having an SD interface according to this application.
  • FIG. 16 is a schematic diagram of an information interaction between a communication device having an SD interface and integrated software in a mobile terminal according to this application.
  • This application may be applied to environments or configurations of many universal or dedicated computing apparatuses, for example, a personal computer, a server computer, a handheld device or a portable device, a flat panel device, a multi-processor apparatus, and a distributed computing environment including any one of the above apparatuses or devices.
  • a method for updating firmware according to Embodiment 1 of this application is applied to a communication device having an SD interface through which the communication device having the SD interface performs data communication with a mobile terminal, where the communication device having the SD interface includes an SD memory and a Flash memory, and the SD memory stores a command swap file, where the SD memory is a memory accessed by the mobile terminal through the SD interface, and the Flash memory is a memory storing the firmware in the communication device having the SD interface.
  • the firmware refers to program codes written in an Erasable Programmable Read Only Memory (EPROM) or an Eraseable Read Only Memory (EROM). More simply, the firmware is software of a Basic Input Output System (BIOS), is program codes fixed in integrated circuits, and is responsible for controlling and coordinating functions of the integrated circuits.
  • BIOS Basic Input Output System
  • the mobile terminal cannot directly access the Flash memory, and therefore, the mobile terminal cannot directly change data in the Flash memory.
  • the SD memory and Flash memory may be two different chips on physical hardware, or may also share one chip.
  • the SD interface in the embodiment of this application does not support an SDIO function.
  • the mobile terminal can only read and write data in the SD memory in units of files. Therefore, special files may be defined in the SD memory to store an update start command and update data in different files, so that the communication device having the SD interface can know, by identifying the file names, whether data in the files is an update start command or update data.
  • the special files in the SD memory are respectively two special files: a command swap file and a firmware update file. In the two special files, the command swap file stores an update start command written by the mobile terminal, and the firmware update file stores update data. The communication device having the SD interface obtains data required in a firmware update process from the corresponding files.
  • FIG. 1 is a flowchart of a method for updating firmware according to Embodiment 1 of this application, where the method may include the following steps.
  • Step 101 Obtain an update start command from the command swap file.
  • the mobile terminal performing data communication with the communication device having the SD interface detects whether a version number of the firmware in the communication device having the SD interface is consistent with a version number of the firmware program of the communication device having the SD interface which is stored on a server, and when detecting that the version numbers are inconsistent, determines that the firmware program of the communication device having the SD interface needs to be updated, and therefore the mobile terminal writes the update start command to the command swap file.
  • the format of the command swap file may be customized in any way, for example, the command swap file is defined as a binary file.
  • the update start command in the command swap file may be written by the mobile terminal to the command swap file by using a small computer system interface (SCSI) command.
  • SCSI small computer system interface
  • the SCSI command used to write the update start command to the command swap file may be: REQ 1 u.
  • REQ indicates that the command is an update start command
  • 1 indicates a command sequence number
  • u indicates starting of an update command.
  • update start commands may be written to the command swap file.
  • different command sequence numbers are used to identify update start commands. For example, REQ 1 u indicates a first update start command, and REQ 2 u indicates a second update start command.
  • This embodiment only enumerates a manner of writing an update start command and a format of the update start command. Other writing manners and command formats also fall within the protection scope of this embodiment, and are not further enumerated one by one in this embodiment.
  • Step 102 After the update start command is obtained, read, from the SD memory, a firmware update file storing update data.
  • the firmware update file is downloaded by the mobile terminal from the server and written by the mobile terminal to the SD memory.
  • the update data includes program codes for updating the firmware of the communication device having the SD interface.
  • the firmware update file is a binary file, and may include a file information header, firmware data, and check information.
  • the format of the firmware update file is the same as the format of an existing binary file, and is not further described in this embodiment.
  • the communication device having the SD interface After the communication device having the SD interface obtains the update start command, it indicates that the communication device having the SD interface starts to perform firmware update, and therefore, the communication device having the SD interface obtains the firmware update file from the SD memory.
  • the mobile terminal in a case where the mobile terminal detects that the version number of the firmware program in the communication device having the SD interface is inconsistent with the version number of the firmware program of the communication device having the SD interface which is stored on the server, the mobile terminal first downloads the firmware update file and then writes it to the SD memory. After writing the firmware update file completely, the mobile terminal writes the update start command to the command swap file in the SD memory to ensure that the firmware update file has been written to the SD memory completely when the communication device having the SD interface starts to perform firmware update, thereby avoiding update failure caused by incomplete update data in the file.
  • Step 103 Write the firmware update file to the Flash memory.
  • the firmware update principle is to write program codes in a new firmware update file to the Flash memory to replace the program codes that are stored in the Flash memory and read when the communication device having the SD interface is started. Therefore, after obtaining the firmware update file, the communication device having the SD interface further writes the firmware update file to the Flash memory, so as to change the program codes previously stored in the Flash memory to the program codes that are currently written to the firmware update file in the Flash memory, and complete the firmware update for the communication device having the SD interface.
  • the mobile terminal can write different data to corresponding files by identifying file names, and the communication device having the SD interface can know, by identifying the file names, whether the data written by the mobile terminal is an update start command or update data.
  • the communication device having the SD interface obtains the update start command from the command swap file, it indicates that the communication device having the SD interface starts to perform firmware update. Therefore, the communication device having the SD interface further reads, from the secure data memory, the firmware update file storing the update data, and then writes the firmware update file to the Flash memory to complete the firmware update.
  • some SD interfaces may support the SDIO function.
  • the communication device having the SD interface can use the method for updating firmware according to this embodiment, or can also use the existing firmware update method based on the SDIO function.
  • Embodiment 1 solves the firmware update problem of a communication device having an SD interface when the SD interface does not support the SDIO function.
  • the communication device having the SD interface does not have an interface that may be used for man-machine interactions, a firmware update progress and status cannot be displayed in the communication device having the SD interface.
  • a mobile terminal may display the firmware update progress and status.
  • a method for updating firmware according to Embodiment 2 of this application is applied to a communication device having an SD interface through which the communication device having the SD interface performs data communication with a mobile terminal, where the communication device having the SD interface includes an SD memory and a Flash memory, and the SD memory stores a command swap file and a result swap file, where the SD memory is a memory accessed by the mobile terminal through the SD interface, and the Flash memory is a memory storing the firmware in the communication device having the SD interface.
  • FIG. 2 is another flowchart of a method for updating firmware according to Embodiment 2 of this application, where the method may include the following steps.
  • Step 201 Obtain an update start command from the command swap file, where the update start command is written by the mobile terminal to the command swap file.
  • Step 202 After the update start command is obtained, read, from the SD memory, a firmware update file storing update data, where the firmware update file is downloaded by the mobile terminal and written by the mobile terminal to the secure data memory.
  • Step 203 Write the firmware update file to the Flash memory.
  • step 201 to step 203 is the same as the specific implementation process of step 101 to step 103 , and is not further described in this embodiment.
  • Step 204 In the process of writing the firmware update file to the Flash memory, write update progress to the result swap file.
  • Step 205 After the firmware update file is written to the Flash memory, write an update result to the result swap file.
  • the update progress indicates current progress of writing the firmware update file to the Flash memory. For example, the percentage of the size of the file written in the Flash memory to the total size of the firmware update file is used to indicate the update progress.
  • the update result indicates the final result of the update, for example, update success or update failure.
  • the communication device having the SD interface may use different identifiers to indicate update success or update failure.
  • the update progress and update result may be written to the result swap file by using an SCSI command.
  • the SCSI command used to write the update progress to the result swap file may be: RSQ 1 m %, where 1 indicates a command sequence number and corresponds to the command sequence number of the update start command, and m % indicates progress.
  • the communication device having the SD interface may periodically change the update progress every time when a firmware update is performed.
  • the SCSI command used to write the update result to the result swap file may be: RSP 1 s, where 1 indicates a command sequence number and corresponds to the command sequence number of the update start command, and s indicates that the update is successful. If the update fails, f is returned to indicate update failure.
  • the result swap file may be obtained from the SD memory.
  • the mobile terminal After the mobile terminal obtains the result swap file, the mobile terminal further obtains the update progress and update result from the result swap file, and thereby displays the firmware update progress and status on the mobile terminal, so as to solve the problem that the firmware update progress and status cannot be displayed because the communication device having the SD interface does not include a display.
  • the method for updating firmware according to Embodiment 2 of this application may further display the firmware update progress and status on the mobile terminal while implementing a firmware update.
  • the specific process of obtaining the result swap file from the SD memory by the mobile terminal may be, after obtaining an update status query command from the command swap file, sending, by the communication device having the SD interface, the result swap file to the mobile terminal, where the update status query is written by the mobile terminal to the command swap file, and indicates that the mobile terminal needs to query the firmware update process.
  • the communication device having the SD interface needs to send the result swap file to the mobile terminal.
  • the update status query command may also be written to the command swap file by using an SCSI, for example, REP 1 q.
  • REP indicates that the command is an update status query command
  • 1 indicates a command sequence number
  • u indicates starting of status query.
  • the format of the result swap file may be customized in any way, for example, the result swap file may use the format of an existing binary file.
  • Multiple update results may be written in the result swap file.
  • different command sequence numbers are used to identify update results, and furthermore, a same command sequence number is used to identify an update start command and a corresponding update result.
  • REQ 1 u indicates a first update start command
  • the corresponding update result may be RSP 1 s
  • REQ 2 u indicates a second update start command
  • the corresponding update result may be RSP 2 s.
  • This embodiment only enumerates a manner of writing an update status query command and a format of the update status query command. Other writing manners and command formats also fall within the protection scope of this embodiment, and are not further enumerated one by one in this embodiment.
  • FIG. 3 is another schematic structural diagram of a method for updating firmware according to Embodiment 3 of this application.
  • the method is applied to a communication device having an SD interface through which the communication device having the SD interface performs data communication with a mobile terminal, where the communication device having the SD interface includes an SD memory and a Flash memory, and the SD memory stores a command swap file, where the SD memory is a memory accessed by the mobile terminal through the SD interface, and the Flash memory is a memory storing the firmware in the communication device having the SD interface.
  • the method for updating firmware shown in FIG. 3 may include the following steps.
  • Step 301 Obtain an update start command from the command swap file, where the update start command is written by the mobile terminal to the command swap file.
  • Step 302 After the update start command is obtained, read, from the secure data memory, a firmware update file storing update data, where the firmware update file is downloaded by the mobile terminal and written by the mobile terminal to the secure data memory.
  • Step 303 Write the firmware update file to the Flash memory.
  • step 301 to step 303 is the same as the specific implementation process of step 101 to step 103 , and is not further described in this embodiment.
  • Step 304 After the firmware update file is written to the Flash memory completely, delete the update start command from the command update file.
  • the SD memory further stores a result swap file, where the result swap file may store update progress and an update result, and the result swap file may be further sent to the mobile terminal.
  • the update progress and update result are displayed on the mobile terminal.
  • the methods for updating firmware according to all the above method embodiments need to be implemented in the update mode of the communication device having the SD interface, but the communication device having the SD interface runs in the common running mode after power-on. Therefore, after the communication device having the SD interface obtains the update start command, it is necessary to restart the communication device having the secure data interface, enter the update mode of the communication device having the secure data interface, and then in the update mode, read, from the secure data memory, the firmware update file storing the update data. After the firmware update file is written to the Flash memory completely, the communication device having the secure data interface is restarted to enter the common running mode of the communication device having the secure data interface.
  • the common running mode is a running mode in which an operating system that the communication device having the SD interface runs may provide various service functions for a user
  • the update mode is a running mode in which an operating system that the communication device having the SD interface runs may provide only an update service function for a user.
  • the writing the firmware update file to the Flash memory by the communication device having the SD interface may include writing mirroring data of the firmware update file to the Flash memory, that is, using new program codes in the firmware update file to replace the program codes that are originally stored in the Flash memory.
  • the firmware update of the communication device having the SD interface is completed.
  • the communication device having the SD interface runs again, the new program codes in the Flash memory can be directly run.
  • the communication device having the SD interface needs to further check the firmware update file to determine whether the firmware update file is a valid file, so that running errors of the communication device having the SD interface, which are caused by writing an invalid file to the Flash memory, are avoided, where the valid file indicates that the firmware update file is a file that can be used and is not changed by other users than an operator.
  • the communication device having the SD interface may use an existing checking method for checking, which is not further described in this embodiment.
  • a method for updating firmware according to Embodiment 4 of this application is applied to a mobile terminal, where the mobile terminal performs data communication through an SD interface with a communication device having an SD interface, where the communication device having the SD interface includes an SD memory and a Flash memory, and the SD memory stores a command swap file, where the SD memory is a memory accessed by the mobile terminal through the SD interface, and the Flash memory is a memory storing the firmware in the communication device having the SD interface.
  • the firmware is a program written in an EPROM or EROM.
  • the mobile terminal cannot directly access the Flash memory, and therefore, the mobile terminal cannot directly change data in the Flash memory.
  • the SD memory and Flash memory may be two different chips on physical hardware, or may also share one chip.
  • the SD interface in the embodiment of this application does not support an SDIO function.
  • the mobile terminal can only read and write data in the SD memory in units of files. Therefore, special files may be defined in the SD memory to store an update start command and update data in different files, so that the communication device having the SD interface can know whether data stored in the files is an update start command or update data.
  • the special files in the SD memory are respectively two special files: a command swap file and a firmware update file.
  • the mobile terminal may respectively write the update start command and update data to the two special files, and the communication device having the SD interface obtains data required in the firmware update process from the corresponding files.
  • FIG. 4 is a flowchart of a method for updating firmware according to Embodiment 4 of this application, where the method may include the following steps.
  • Step 401 Download a firmware update file storing update data.
  • the mobile terminal detects whether a version number of the firmware program in the communication device having the SD interface is consistent with a version number of the firmware program of the communication device having the SD interface which is stored on a server, and when detecting that the version numbers are inconsistent, determines that the firmware program of the communication device having the SD interface needs to be updated, and therefore the mobile terminal downloads, from the server, the firmware update file storing the update data.
  • the firmware update file is a binary file, and may include a file information header, firmware data, and check information.
  • the format of the firmware update file is the same as the format of an existing binary file, and is not further described in this embodiment.
  • Step 402 Write the firmware update file to the SD memory.
  • Step 403 After the firmware update file is written to the SD memory completely, write an update start command in the mobile terminal to the command swap file, so that the communication device having the SD interface obtains the update start command to perform firmware update.
  • the mobile terminal After the firmware update file is written to the SD memory completely, the mobile terminal further writes an update start command in the command swap file.
  • the communication device having the SD interface can know, by identifying a file name, that the command swap file stores an update start command. Therefore, the communication device having the SD interface polls the command update file to obtain the update start command after the update start command is written completely. Polling the command update file means periodically querying whether the complete update start command is written in the command update file.
  • the communication device having the SD interface After the communication device having the SD interface obtains the update start command, it indicates that the communication device having the SD interface starts to perform firmware update. Therefore, the communication device having the SD interface further obtains the firmware update file, and writes the firmware update file to the Flash memory to complete the firmware update.
  • writing of the firmware update file is better than writing of the update start command, so as to ensure integrity of the firmware update file written in the SD memory, thereby avoiding update failure caused by an incomplete firmware update file in the SD memory when the update start command is executed.
  • the mobile terminal further writes an update status query command to the command swap file.
  • the communication device having the SD interface sends a result swap file to the mobile terminal.
  • the update progress and update result are written in the result swap file. Therefore, when receiving the result swap file, the mobile terminal can display the update progress and update result on the mobile terminal.
  • the mobile terminal may periodically write the update status query command to the command swap file in each firmware update process. Every time when obtaining the update status query command, the communication device having the SD interface sends, to the mobile terminal, the result swap file in which update progress is written, so that the mobile terminal can monitor the update progress in real time.
  • the communication device having the SD interface obtains the final update status query command in a firmware update process
  • the communication device having the SD interface may send, to the mobile terminal, the result swap file in which the final update progress and update result are written, thereby displaying the final update result on the mobile terminal.
  • update start command and update status query command in this embodiment may be written by using an SCSI command.
  • SCSI command For the format of the SCSI command, reference may be made to the method for updating firmware which is described from the perspective of the communication device having the SD interface, which is not further introduced in this embodiment. Formats of the command swap file and result swap file may be customized in any way, for example, the command swap file and result swap file may use the format of an existing binary file.
  • this embodiment provides an apparatus for updating firmware.
  • the apparatus for updating firmware is applied to a communication device having an SD interface through which the communication device having the SD interface performs data communication with a mobile terminal, where the communication device having the SD interface includes an SD memory and a Flash memory, and the SD memory stores a command swap file, where the SD memory is a memory accessed by the mobile terminal through the SD interface, and the Flash memory is a memory storing the firmware in the communication device having the SD interface.
  • the firmware is program codes written in an EPROM or EROM.
  • the SD memory and Flash memory may be two different chips on physical hardware, or may also share one chip.
  • the SD interface does not support an SDIO function.
  • the mobile terminal can only read and write data in the SD memory in units of files. Therefore, special files may be defined in the SD memory to store an update start command and update data in different files, so that the communication device having the SD interface can know, by identifying the file names, whether the data in the files is an update start command or update data.
  • the special files in the SD memory are respectively two special files: a command swap file and a firmware update file. In the two special files, the command swap file stores an update start command written by the mobile terminal, and the firmware update file stores update data. The communication device having the SD interface obtains data required in a firmware update process from the corresponding files.
  • FIG. 5 is a schematic structural diagram of an apparatus for updating firmware according to an embodiment of this application.
  • the apparatus may include a first obtaining unit 11 , a reading unit 12 , and a first writing unit 13 .
  • the first obtaining unit 11 is configured to obtain an update start command from the command swap file, where the update start command is written by the mobile terminal to the command swap file.
  • the mobile terminal When the mobile terminal detects that a version number of the firmware program in the communication device having the SD interface is inconsistent with a version number of the firmware program of the communication device having the SD interface which is stored on a server, the mobile terminal determines that the firmware program of the communication device having the SD interface needs to be updated, and the mobile terminal writes the update start command to the command swap file.
  • the update start command indicates that the firmware in the communication device having the SD interface needs to be updated.
  • firmware update is started.
  • the format of the command swap file is customized in any way, for example, the command swap file is defined as a binary file.
  • the update start command in the command swap file may be written by the mobile terminal to the command swap file by using an SCSI command.
  • SCSI command For the specific format, reference may be made to the command format enumerated in Embodiment 1.
  • the reading unit 12 is configured to, after the update start command is obtained, read, from the SD memory, a firmware update file storing update data.
  • the firmware update file is downloaded by the mobile terminal and written by the mobile terminal to the SD memory.
  • the update data includes program codes for updating the firmware of the communication device having the SD interface.
  • the firmware update file is a binary file, and may include a file information header, firmware data, and check information.
  • the format of the firmware update file is the same as that of an existing binary file, and is not further described in this embodiment.
  • the obtaining unit 12 After the obtaining unit 12 obtains the update start command, it indicates that the communication device having the SD interface starts to perform firmware update, and therefore, the communication device having the SD interface obtains the firmware update file from the SD memory.
  • the mobile terminal in a case where the mobile terminal detects that the version number of the firmware program in the communication device having the SD interface is inconsistent with the version number of the firmware program of the communication device having the SD interface which is stored on the server, the mobile terminal first downloads the firmware update file and then writes it to the SD memory. After writing the firmware update file completely, the mobile terminal writes the update start command to the command swap file in the SD memory to ensure that the firmware update file has been written to the SD memory completely when the communication device having the SD interface starts to perform firmware update, thereby avoiding update failure caused by incomplete update data in the file.
  • the first writing unit 13 is configured to write the firmware update file to the Flash memory.
  • the firmware update principle is to write program codes in a new firmware update file to the Flash memory to replace the program codes that are stored in the Flash memory and read when the communication device having the SD interface is started. Therefore, after the reading unit 12 obtains the firmware update file, the first writing unit further writes the firmware update file to the Flash memory, so as to change the program codes previously stored in the Flash memory to program codes that are currently written to the firmware update file in the Flash memory, and complete the firmware update for the communication device having the SD interface.
  • the mobile terminal can write different data to corresponding files by identifying file names, and the communication device having the SD interface can know, by identifying the file names, whether the data written by the mobile terminal is an update start command or update data.
  • the communication device having the SD interface obtains the update start command from the command swap file, it indicates that the communication device having the SD interface starts to perform firmware update. Therefore, the communication device having the SD interface further reads, from the secure data memory, the firmware update file storing the update data, and then writes the firmware update file to the Flash memory to complete the firmware update.
  • the embodiment of this application provides another apparatus for updating firmware, where a schematic structural diagram of the apparatus is shown in FIG. 6 .
  • the apparatus may include a first obtaining unit 11 , a reading unit 12 , a first writing unit 13 , a second writing unit 14 , and a third writing unit 15 .
  • the first obtaining unit 11 is configured to obtain an update start command from the command swap file, where the update start command is written by the mobile terminal to the command swap file.
  • the reading unit 12 is configured to, after the update start command is obtained, read, from the SD memory, a firmware update file storing update data.
  • the firmware update file is downloaded by the mobile terminal and written by the mobile terminal to the SD memory.
  • the update data includes program codes for updating the firmware of the communication device having the SD interface.
  • the first writing unit 13 is configured to write the firmware update file to the Flash memory.
  • the second writing unit 14 is configured to write update progress to the result swap file in the process of writing the firmware update file to the Flash memory.
  • the third writing unit 15 is configured to write the update result to the result swap file after the firmware update file is written to the Flash memory.
  • the update progress indicates current progress of writing the firmware update file to the Flash memory. For example, the percentage of the size of the file written in the Flash memory to the total size of the firmware update file is used to indicate the update progress.
  • the update result indicates the final result of the update, for example, update success or update failure.
  • the communication device having the SD interface may use different identifiers to indicate update success or update failure.
  • the second writing unit 14 writes the update progress to the result swap file by using an SCSI command.
  • the third writing unit 15 writes the update result to the result swap file by using an SCSI command.
  • the second writing unit 14 may write the update progress to the result swap file.
  • the third writing unit 15 may write the update result to the result swap file. Therefore, the mobile terminal can further obtain the result swap file by identifying a file name, read the update progress and update result from the result swap file, and display the update progress and status on the mobile terminal, thereby solving the problem that the communication device having the SD interface cannot display the firmware update progress and status.
  • FIG. 7 is another schematic structural diagram of an apparatus for updating firmware according to Embodiment 6 on the basis of FIG. 6 .
  • the apparatus may further include a second obtaining unit 16 and a sending unit 17 .
  • the second obtaining unit 16 is configured to obtain an update status query command from the command swap file.
  • the sending unit 17 is configured to send the result swap file to the mobile terminal after the update status query command is obtained, where the update progress and update result are written in the result swap file.
  • the update status query command is a command used for a user to query the firmware update process of the communication device having the SD interface.
  • the update status query command When the update status query command is obtained, it indicates that the mobile terminal needs to query the firmware update process, and therefore the second obtaining unit 16 triggers the sending unit 17 to send the result swap file to the mobile terminal.
  • the second obtaining unit 16 triggers the sending unit 17 to send the result swap file to the mobile terminal.
  • the embodiment of this application provides another apparatus for updating firmware, where a schematic structural diagram of the apparatus is shown in FIG. 8 .
  • the apparatus may include a first obtaining unit 11 , a reading unit 12 , a first writing unit 13 , and a deleting unit 18 .
  • the first obtaining unit 11 is configured to obtain an update start command from the command swap file, where the update start command is written by the mobile terminal to the command swap file.
  • the reading unit 12 is configured to, after the update start command is obtained, read, from the SD memory, a firmware update file storing update data.
  • the firmware update file is downloaded by the mobile terminal and written by the mobile terminal to the SD memory.
  • the update data includes program codes for updating the firmware of the communication device having the SD interface.
  • the first writing unit 13 is configured to write the firmware update file to the Flash memory.
  • the deleting unit 18 is configured to delete the update start command from the command update file after the firmware update file is written to the Flash memory completely.
  • the apparatus for updating firmware may further include the second writing unit 14 and the third writing unit 15 in FIG. 6 , and the second obtaining unit 16 and the sending unit 17 in FIG. 7 . Therefore, the apparatus for updating firmware can send the result swap file to the mobile terminal.
  • the mobile terminal further reads the update progress and update result from the result swap file, and displays the firmware update progress and status on the mobile terminal, so as to solve the problem that the communication device having the SD interface cannot display the firmware update progress and status.
  • FIG. 9 is a schematic structural diagram of another apparatus for updating firmware according to an embodiment of this application.
  • the apparatus may include a first obtaining unit 11 , a reading unit 12 , a first writing unit, and a starting unit 19 .
  • the first obtaining unit 11 is configured to obtain an update start command from the command swap file, where the update start command is written by the mobile terminal to the command swap file.
  • the starting unit 19 is configured to, after the update start command is obtained, restart the communication device having the secure data interface, and enter an update mode of the communication device having the secure data interface, and after the firmware update file is written to the Flash memory completely, restart the communication device having the secure data interface, and enter a common running mode of the communication device having the secure data interface.
  • the common running mode is a running mode in which an operating system that the communication device having the SD interface runs may provide various service functions for a user
  • the update mode is a running mode in which an operating system that the communication device having the SD interface runs may provide only an update service function for a user.
  • the starting unit 19 may also be applied to the apparatuses for updating firmware shown in FIG. 5 to FIG. 8 , so as to control the operation mode of the communication device having the SD interface, which is not further described in this embodiment one by one with reference to schematic diagrams.
  • the reading unit 12 is configured to read, in the update mode from the secure data memory, the firmware update file storing the update data.
  • the firmware update file is downloaded by the mobile terminal and written by the mobile terminal to the SD memory.
  • the update data includes program codes for updating the firmware of the communication device having the SD interface.
  • the first writing unit 13 is configured to write the firmware update file to the Flash memory.
  • the first writing unit 13 is configured to write mirroring data of the firmware update file to the Flash memory, that is, use new program codes in the firmware update file to replace program codes originally stored in the Flash memory.
  • the firmware update of the communication device having the SD interface is completed.
  • the communication device having the SD interface runs again, the new program codes in the Flash memory can be directly run.
  • the apparatus for updating firmware may further include a checking unit configured to check the firmware update file.
  • the reading unit 12 is configured to, after it is checked that the firmware update file is a valid file, read, from the SD memory, the firmware update file storing the update data.
  • the checking unit checks the firmware update file to determine whether the firmware update file is a valid file, so that running errors of the communication device having the SD interface, which are caused by writing an invalid file to the Flash memory, are avoided, where the valid file indicates that the firmware update file is a file that can be used and is not changed by other users than an operator.
  • the checking unit may use an existing checking method for checking, which is not further described in this embodiment.
  • the apparatus for updating firmware shown in any one of the schematic structural diagrams in FIG. 5 to FIG. 9 may be included in a communication device having an SD interface, where the communication device having the SD interface includes an SD memory and a Flash memory, the apparatus for updating firmware performs data communication with the SD memory and the Flash memory respectively, and the SD memory stores a command swap file, where the SD memory is a memory accessed by the mobile terminal through the SD interface, and the Flash memory is a memory storing the firmware in the communication device having the SD interface.
  • FIG. 10 is a schematic structural diagram of another apparatus for updating firmware according to an embodiment of this application.
  • the apparatus for updating firmware is applied to a mobile terminal that performs data communication through an SD interface with a communication device having an SD interface, where the communication device having the SD interface includes an SD memory and a Flash memory, and the SD memory stores a command swap file, where the SD memory is a memory accessed by the mobile terminal through the SD interface, and the Flash memory is a memory storing the firmware in the communication device having the SD interface.
  • the apparatus for updating firmware may include a downloading unit 21 , a fourth writing unit 22 , and a fifth writing unit 23 .
  • the downloading unit 21 is configured to download a firmware update file storing update data.
  • the mobile terminal detects whether a version number of the firmware program in the communication device having the SD interface is consistent with a version number of the firmware program of the communication device having the SD interface which is stored on a server, and when detecting that the version numbers are inconsistent, determines that the firmware program of the communication device having the SD interface needs to be updated, and therefore the downloading unit 21 downloads, from the server, the firmware update file storing the update data.
  • the firmware update file is a binary file, and may include a file information header, firmware data, and check information.
  • the format of the firmware update file is the same as the format of an existing binary file, and is not further described in this embodiment.
  • the fourth writing unit 22 is configured to write the firmware update file to the SD memory.
  • the fifth writing unit 23 is configured to, after the firmware update file is written to the SD memory completely, write an update start command in the mobile terminal to the command swap file, so that the communication device having the SD interface obtains the update start command to perform firmware update.
  • the fifth writing unit 23 further writes an update start command in the command swap file.
  • the communication device having the SD interface can know, by identifying a file name, that the command swap file stores an update start command. Therefore, the communication device having the SD interface polls the command update file to obtain the update start command after the update start command is written completely. Polling the command update file means periodically querying whether the complete update start command is written in the command update file.
  • the communication device having the SD interface After the communication device having the SD interface obtains the update start command, it indicates that the communication device having the SD interface starts to perform firmware update. Therefore, the communication device having the SD interface further obtains the firmware update file, and writes the firmware update file to the Flash memory to complete the firmware update.
  • the communication device having the SD interface After the communication device having the SD interface obtains the update start command, it indicates that the communication device having the SD interface starts to perform firmware update. Therefore, the communication device having the SD interface further obtains the firmware update file, and writes the firmware update file to the Flash memory to complete the firmware update.
  • FIG. 11 is a schematic structural diagram of another apparatus for updating firmware according to an embodiment of this application.
  • the apparatus may further include a sixth writing unit 24 configured to write an update status query command in the mobile terminal to the command swap file.
  • the update status query command is a command for querying the firmware update process of the communication device having the SD interface.
  • the communication device having the SD interface After obtaining the update status query command, the communication device having the SD interface sends, to the mobile terminal, a result swap file in which the update progress and update result are written, so that the update progress and update result are displayed on the mobile terminal, thereby solving the problem that the firmware update progress and status cannot be displayed because the communication device having the SD interface does not include a display.
  • the apparatus for updating firmware shown in FIG. 12 For details, reference may be made to the apparatus for updating firmware shown in FIG. 12 .
  • the apparatus for updating firmware shown in FIG. 12 may further include a receiving unit 25 and a displaying unit 26 .
  • the receiving unit 25 is configured to receive the result swap file sent by the communication device having the SD interface, where the result swap file is sent after the communication device having the SD interface obtains the update status query command, and the update progress and update result are written in the result swap file.
  • the displaying unit 26 is configured to display the update progress and update result on the mobile terminal.
  • the fifth writing unit 23 writes the update start command to the command swap file by using an SCSI command.
  • the sixth writing unit 24 writes the update status query command to the command swap file by using an SCSI command.
  • the embodiment of this application further provides a mobile terminal, where the mobile terminal includes an apparatus for updating firmware.
  • the mobile terminal includes an apparatus for updating firmware.
  • the apparatus for updating firmware is not further described in detail in this embodiment.
  • the embodiment of this application further provides a communication device having an SD interface, where the communication device having the SD interface is configured with only an SD interface 21 , and includes an SD memory 22 , a Flash memory 23 , a processor 24 , and an SD interface controller 25 .
  • the communication device having the SD interface is configured with only an SD interface 21 , and includes an SD memory 22 , a Flash memory 23 , a processor 24 , and an SD interface controller 25 .
  • FIG. 13 For the schematic structural diagram of the communication device, reference may be made to FIG. 13 .
  • the SD interface 21 connects the communication device having the SD interface and the mobile terminal through an SD bus, and the data communication between the communication device having the SD interface and the mobile terminal is transmitted on the SD bus under control of the SD interface controller 25 .
  • the SD bus is a hardware bus complying with an SD interface standard, between the communication device having the SD interface and the mobile terminal.
  • the processor 24 is configured to obtain an update start command from a command swap file in the SD memory 22 , read the firmware update file from the SD memory 22 after obtaining the update start command, and write the firmware update file to the Flash memory 23 to update firmware in the communication device having the SD interface.
  • the mobile terminal connected to the communication device having the SD interface is also configured with an SD interface.
  • the SD interface is connected, through the SD bus, to the SD interface on the communication device having the SD interface, and performs data communication under control of the SD interface controller in the mobile terminal.
  • FIG. 14 shows a part of the structure of the mobile terminal and the structure of the communication device having the SD interface.
  • the SD bus connecting the SD interface between the mobile terminal and the communication device having the SD interface establishes a connection under control of the SD interface controllers in the mobile terminal and the communication device having the SD interface.
  • the mobile terminal writes the firmware update file to the SD memory 22 through the SD bus connecting the SD interface.
  • the mobile terminal writes the update start command to the command swap file in the SD memory 22 .
  • the processor 24 can know, by identifying a file name, that the command swap file stores an update start command. Therefore, the processor 24 polls the command swap file to obtain the update start command after the update start command is written completely.
  • the processor 24 After obtaining the update start command, the processor 24 reads the firmware update file from the SD memory 22 , and writes the firmware update file to the Flash memory 23 to update the firmware in the communication device having the SD interface.
  • the processor 24 may further write the update progress and update result to the result swap file in the SD memory 22 .
  • the processor 24 reads the update progress and update result from the result swap file, and sends the update progress and update result to the mobile terminal, so that the mobile terminal can display the update progress and update result to implement man-machine interactions.
  • the update status query command is written by the mobile terminal to the command swap file in the SD memory 22 .
  • update start command, update status query command, update progress, and update result may be written by using different SCSI commands.
  • SCSI commands For details, reference may be made to the related description in the method embodiments, which is not further described in this embodiment.
  • the processor 24 is further configured to, after the firmware update file is written to the Flash memory completely, delete the update start command written in the command update file.
  • the communication device having the SD interface needs to perform an actual update process in the update mode, but the communication device having the SD interface runs in the common running mode after power-on. Therefore, the processor 24 is further configured to restart the communication device having the SD interface after obtaining the update start command, so that the communication device having the SD interface switches from the common running mode to the update mode, obtains the firmware update file from the SD memory 22 in the update mode, and writes the firmware update file to the Flash memory 23 . After the firmware update file is written to the Flash memory 23 completely, the processor 24 is further configured to restart the communication device having the SD interface, so that the communication device having the SD interface switches from the update mode to the common running mode, so as to ensure that the mobile terminal can normally use the communication device having the SD interface.
  • the processor 24 is configured to write mirroring data of the firmware update file to the Flash memory, that is, use the new firmware program in the firmware update file to replace the firmware program that is originally stored in the Flash memory.
  • the firmware update of the communication device having the SD interface is completed.
  • the new firmware program in the Flash memory can be directly run.
  • the processor 24 After the firmware update file is written to the SD memory 22 completely, the processor 24 further checks the firmware update file before obtaining the update start command, and obtains the update start command after checking that the firmware update file is a valid file, so that running errors of the communication device having the SD interface, which are caused by writing an invalid file to the Flash memory, are avoided, where the valid file indicates that the firmware update file is a file that can be used and is not changed by other users than an operator.
  • the mobile terminal writes the update start command to the command swap file, that is, writing of the firmware update file is better than writing of the update start command, so as to ensure that the firmware update file may be written to the SD memory 22 completely, ensure integrity of the firmware update file written in the SD memory 22 , and avoid update failure caused by an incomplete firmware update file in the SD memory 22 when the update start command is executed.
  • the software integrated in the communication device having the SD interface includes an update service program, a file system, an SD interface driver, and a Flash driver.
  • the SD interface driver is integrated in the SD interface controller 25
  • the update service program, file system, and Flash driver are integrated in the processor 24 .
  • the update service program reads the firmware update file, and accesses and updates the command swap file and result swap file.
  • the file system obtains file information from the SD memory 22 through the SD interface driver, and accesses data in the SD memory 22 through the SD interface driver.
  • the update service program writes the firmware update file to the Flash memory 23 through the Flash driver and completes the firmware update.
  • the software in the mobile terminal includes a firmware update program and an SD interface driver, where the firmware update program includes a firmware update file, which is written through the SD interface driver to the SD memory 22 in the communication device having the SD interface, where the SD interface driver is supported by the operating system in the mobile terminal.
  • the firmware update program in the mobile terminal creates a command swap file and a result swap file in the SD memory 22 by using an SCSI command, downloads a firmware update file, and writes the firmware update file, through the SD interface driver in the mobile terminal and the SD interface driver in the communication device having the SD interface, to the SD memory 22 in the communication device having the SD interface.
  • firmware update program After the firmware update file is written to the SD memory 22 completely, the firmware update process is started.
  • the firmware update program writes the update start command to the command swap file by using an SCSI command.
  • the update service program in the communication device having the SD interface finds the update start command in the command swap file, the communication device having the SD interface is restarted, and the communication device having the SD interface enters the update mode.
  • the update service program checks validity of the firmware update file stored in the SD memory 22 , and after detecting that the firmware update file is valid, starts to read the firmware update file through the file system and the SD interface driver, and writes the firmware update file to the Flash memory 23 through the Flash driver.
  • the firmware update program in the mobile terminal After starting the firmware update, the firmware update program in the mobile terminal periodically writes an update status query command to the command swap file by using an SCSI command.
  • the update service program in the communication device having the SD interface writes the update progress and update result to the result swap file by using an SCSI command.
  • the firmware update program in the mobile terminal can obtain the update progress and update result, and the firmware update program implements user interface (UI) displaying.
  • UI user interface
  • the apparatus is functionally divided into different units, which are described respectively.
  • functions of each unit may be implemented in a same piece or multiple pieces of software and/or hardware when this application is implemented.
  • the software product may be stored in a storage medium such as a read-only memory (ROM)/random-access memory (RAM), a magnetic disk, or an optical disc, and includes several instructions for instructing a computer device (which may be a personal computer, a server, or a network device or the like) to perform the methods in all the embodiments of this application or in some parts of the embodiments.
  • ROM read-only memory
  • RAM random-access memory
  • magnetic disk or an optical disc

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)
  • Telephone Function (AREA)
  • Telephonic Communication Services (AREA)
US14/896,492 2013-06-08 2014-06-09 Method, apparatus, and communication device for updating firmware Active US9804832B2 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN201310228240.2 2013-06-08
CN201310228240.2A CN103309709B (zh) 2013-06-08 2013-06-08 一种固件升级方法、装置及通信设备
CN201310228240 2013-06-08
PCT/CN2014/079440 WO2014194865A1 (zh) 2013-06-08 2014-06-09 一种固件升级方法、装置及通信设备

Publications (2)

Publication Number Publication Date
US20160132315A1 US20160132315A1 (en) 2016-05-12
US9804832B2 true US9804832B2 (en) 2017-10-31

Family

ID=49134969

Family Applications (1)

Application Number Title Priority Date Filing Date
US14/896,492 Active US9804832B2 (en) 2013-06-08 2014-06-09 Method, apparatus, and communication device for updating firmware

Country Status (5)

Country Link
US (1) US9804832B2 (ja)
EP (1) EP3007062A4 (ja)
JP (1) JP5838527B2 (ja)
CN (1) CN103309709B (ja)
WO (1) WO2014194865A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11409681B2 (en) * 2020-09-04 2022-08-09 Paypal, Inc. Computer system communication via sideband processor

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309709B (zh) 2013-06-08 2018-10-09 华为终端有限公司 一种固件升级方法、装置及通信设备
JP6305069B2 (ja) * 2014-01-10 2018-04-04 キヤノン株式会社 画像形成装置及びその制御方法、並びにプログラム
CN105700903A (zh) * 2014-11-28 2016-06-22 中兴通讯股份有限公司 一种用户终端的升级方法和用户终端
CN105988828A (zh) * 2015-01-30 2016-10-05 深圳市硅格半导体有限公司 固件更新系统及方法
CN105446772B (zh) * 2015-11-16 2019-01-04 青岛海信移动通信技术股份有限公司 一种系统升级的方法和装置
CN105488153A (zh) * 2015-11-27 2016-04-13 北京北信源软件股份有限公司 基于二进制流追加镜像的方法和装置
US20170286090A1 (en) * 2016-03-31 2017-10-05 Microsoft Technology Licensing, Llc High performance mobile device flashing
CN106130751B (zh) * 2016-05-27 2019-05-17 努比亚技术有限公司 一种升级状态数据管理装置、系统和方法
CN106168906A (zh) * 2016-06-23 2016-11-30 广州信位通讯科技有限公司 一种网络摄像机的固件升级方法
CN107783769A (zh) * 2016-08-24 2018-03-09 青岛歌尔声学科技有限公司 一种通过usb升级电子设备的方法、装置及电子设备
CN106647517A (zh) * 2016-12-29 2017-05-10 金卡高科技股份有限公司 一种物联网计量仪表远程固件升级方法及计量仪表系统
CN107861746B (zh) * 2017-12-06 2020-11-27 北京经纬恒润科技有限公司 一种车辆电子控制单元的刷新方法及系统
KR20190074857A (ko) * 2017-12-20 2019-06-28 삼성전자주식회사 펌웨어를 업데이트하는 인터페이스 장치, 모바일 장치 및 펌웨어 업데이트 방법
CN111309353B (zh) * 2020-01-20 2023-05-23 超越科技股份有限公司 一种基于服务器控制板更新运算板fpga固件的方法及设备
CN115729601A (zh) * 2022-11-25 2023-03-03 中机试验装备股份有限公司 一种固件更新方法、装置、设备及计算机可读存储介质

Citations (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030066062A1 (en) * 2001-09-28 2003-04-03 Brannock Kirk D. Method for atomically updating a plurality of files
US20030088868A1 (en) * 2001-11-06 2003-05-08 Chang Robert C. Implementation of in system programming to update firmware on memory cards
US20040199911A1 (en) 2003-04-04 2004-10-07 Incomm Technologies Co., Ltd. Apparatus and method for upgrading execution code of the portable memory device
US20040225875A1 (en) 2003-05-09 2004-11-11 Chung-Ching Huang System and method of device information management
US20060282653A1 (en) 2005-06-08 2006-12-14 Ping-Ying Chu Method for updating frimware of memory card
US20070038801A1 (en) * 2005-08-09 2007-02-15 Rohm Co., Ltd. Control circuit, electronic device using the same, and firmware update method
CN1991761A (zh) 2005-12-30 2007-07-04 北京华旗资讯数码科技有限公司 一种固件程序在线升级的方法及硬件设备
US20070234332A1 (en) * 2006-02-22 2007-10-04 Dell Products L.P. Firmware update in an information handling system employing redundant management modules
US20080301665A1 (en) * 2007-05-30 2008-12-04 Steven Charlton Architecture for field upgrade of a health monitoring system
CN101344854A (zh) 2008-08-22 2009-01-14 四川长虹电器股份有限公司 通过SD卡对嵌入式Linux设备进行升级的方法
CN101447035A (zh) 2008-12-29 2009-06-03 普天信息技术研究院有限公司 一种智能存储卡及提高智能存储卡传输速率的方法
US20100199078A1 (en) 2009-02-04 2010-08-05 Novatek Microelectronics Corp. Method of safe and recoverable firmware update and device using the same
CN101799881A (zh) 2008-10-24 2010-08-11 上海吉芯电子有限公司 一种sd卡接口的td-scdma通讯卡
US20100325622A1 (en) * 2007-12-13 2010-12-23 Derek Morton Updating Firmware of an Electronic Device
CN201781586U (zh) 2010-01-27 2011-03-30 福建新大陆通信科技股份有限公司 一种基于sd卡技术实现自动升级的机顶盒
CN102004657A (zh) 2010-12-15 2011-04-06 周佳 一种电子设备及其升级方法
US20110191499A1 (en) * 2010-02-01 2011-08-04 Jonathan Andersson USB to SD Bridge
US20130097655A1 (en) * 2011-10-17 2013-04-18 Karthikeyan Vaidyanathan Methods and apparatus for a safe and secure software update solution against attacks from malicious or unauthorized programs to update protected secondary storage
US20130179871A1 (en) * 2012-01-06 2013-07-11 Masafumi Nagao Information processing apparatus, information processing method, and information processing program
US20130179870A1 (en) * 2012-01-05 2013-07-11 Lenovo (Singapore) Pte. Ltd. Updating firmware in a hybrid computing environment
US20130185563A1 (en) * 2012-01-12 2013-07-18 Gueorgui Djabarov Multiple System Images for Over-The-Air Updates
CN103309709A (zh) 2013-06-08 2013-09-18 华为终端有限公司 一种固件升级方法、装置及通信设备

Patent Citations (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030066062A1 (en) * 2001-09-28 2003-04-03 Brannock Kirk D. Method for atomically updating a plurality of files
US20070234341A1 (en) * 2001-11-06 2007-10-04 Sandisk Corporation Implementation of In-System Programming to Update Firmware 0n Memory Cards
US20030088868A1 (en) * 2001-11-06 2003-05-08 Chang Robert C. Implementation of in system programming to update firmware on memory cards
JP2005508547A (ja) 2001-11-06 2005-03-31 サンディスク コーポレイション メモリカード上のファームウェアを更新するインシステムプログラムのインプリメンテーション
US20040199911A1 (en) 2003-04-04 2004-10-07 Incomm Technologies Co., Ltd. Apparatus and method for upgrading execution code of the portable memory device
US20040225875A1 (en) 2003-05-09 2004-11-11 Chung-Ching Huang System and method of device information management
US20060282653A1 (en) 2005-06-08 2006-12-14 Ping-Ying Chu Method for updating frimware of memory card
US20070038801A1 (en) * 2005-08-09 2007-02-15 Rohm Co., Ltd. Control circuit, electronic device using the same, and firmware update method
CN1991761A (zh) 2005-12-30 2007-07-04 北京华旗资讯数码科技有限公司 一种固件程序在线升级的方法及硬件设备
US20070234332A1 (en) * 2006-02-22 2007-10-04 Dell Products L.P. Firmware update in an information handling system employing redundant management modules
US20080301665A1 (en) * 2007-05-30 2008-12-04 Steven Charlton Architecture for field upgrade of a health monitoring system
US20100325622A1 (en) * 2007-12-13 2010-12-23 Derek Morton Updating Firmware of an Electronic Device
CN101344854A (zh) 2008-08-22 2009-01-14 四川长虹电器股份有限公司 通过SD卡对嵌入式Linux设备进行升级的方法
CN101799881A (zh) 2008-10-24 2010-08-11 上海吉芯电子有限公司 一种sd卡接口的td-scdma通讯卡
CN101447035A (zh) 2008-12-29 2009-06-03 普天信息技术研究院有限公司 一种智能存储卡及提高智能存储卡传输速率的方法
US20100199078A1 (en) 2009-02-04 2010-08-05 Novatek Microelectronics Corp. Method of safe and recoverable firmware update and device using the same
CN201781586U (zh) 2010-01-27 2011-03-30 福建新大陆通信科技股份有限公司 一种基于sd卡技术实现自动升级的机顶盒
US20110191499A1 (en) * 2010-02-01 2011-08-04 Jonathan Andersson USB to SD Bridge
CN102004657A (zh) 2010-12-15 2011-04-06 周佳 一种电子设备及其升级方法
US20130097655A1 (en) * 2011-10-17 2013-04-18 Karthikeyan Vaidyanathan Methods and apparatus for a safe and secure software update solution against attacks from malicious or unauthorized programs to update protected secondary storage
US20130179870A1 (en) * 2012-01-05 2013-07-11 Lenovo (Singapore) Pte. Ltd. Updating firmware in a hybrid computing environment
US20130179871A1 (en) * 2012-01-06 2013-07-11 Masafumi Nagao Information processing apparatus, information processing method, and information processing program
US20130185563A1 (en) * 2012-01-12 2013-07-18 Gueorgui Djabarov Multiple System Images for Over-The-Air Updates
CN103309709A (zh) 2013-06-08 2013-09-18 华为终端有限公司 一种固件升级方法、装置及通信设备

Non-Patent Citations (12)

* Cited by examiner, † Cited by third party
Title
Foreign Communication From a Counterpart Application, Chinese Application No. 201310228240.2, Chinese Office Action dated Sep. 25, 2015, 10 pages.
Foreign Communication From a Counterpart Application, Japanese Application No. 2014-115531, English Translation of Japanese Office Action dated Jun. 9, 2015, 2 pages.
Foreign Communication From a Counterpart Application, Japanese Application No. 2014-115531, Japanese Office Action dated Jun. 9, 2015, 2 pages.
Foreign Communication From a Counterpart Application, PCT Application No. PCT/CN2014/079440, English Translation of International Search Report dated Sep. 9, 2014, 3 pages.
Foreign Communication From a Counterpart Application, PCT Application No. PCT/CN2014/079440, English Translation of Written Opinion dated Sep. 9, 2014, 13 pages.
Partial English Translation and Abstract of Chinese Patent Application No. CN101344854, Mar. 14, 2016, 3 pages.
Partial English Translation and Abstract of Chinese Patent Application No. CN101447035, Dec. 9, 2015, 7 pages.
Partial English Translation and Abstract of Chinese Patent Application No. CN101799881, Mar. 14, 2016, 3 pages.
Partial English Translation and Abstract of Chinese Patent Application No. CN102004657, Dec. 9, 2015, 4 pages.
Partial English Translation and Abstract of Chinese Patent Application No. CN103309709, Dec. 8, 2015, 3 pages.
Partial English Translation and Abstract of Chinese Patent Application No. CN201781586, Mar. 14, 2016, 3 pages.
Partial English Translation and Abstract of Japanese Patent Application No. JPA2005508547, Mar. 24, 2016, 58 pages.

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11409681B2 (en) * 2020-09-04 2022-08-09 Paypal, Inc. Computer system communication via sideband processor

Also Published As

Publication number Publication date
EP3007062A4 (en) 2016-05-11
US20160132315A1 (en) 2016-05-12
CN103309709A (zh) 2013-09-18
JP2014238838A (ja) 2014-12-18
JP5838527B2 (ja) 2016-01-06
EP3007062A1 (en) 2016-04-13
WO2014194865A1 (zh) 2014-12-11
CN103309709B (zh) 2018-10-09

Similar Documents

Publication Publication Date Title
US9804832B2 (en) Method, apparatus, and communication device for updating firmware
CN108427705B (zh) 电子装置、分布式系统日志查询方法及存储介质
WO2019148722A1 (zh) 电子装置、数据迁移及调用方法及存储介质
JP7346606B2 (ja) 画面共有処理方法、装置、機器及び記憶媒体
JP5483116B2 (ja) メンテナンスシステム、メンテナンス方法、及びメンテナンス用プログラム
US20140067879A1 (en) Application management for a terminal
TW201416853A (zh) 用以雲端測試及遠端監視積體電路裝置於電腦化系統之驗證的方法及其系統
CN110825419B (zh) 一种固件刷新方法、装置及电子设备和存储介质
CN113835644B (zh) 整机迁移方法、装置、设备及存储介质
CN111813428A (zh) 终端固件的升级方法、装置、电子设备及存储介质
TWI707274B (zh) 用於更新系統之rom編碼之電腦實施方法、電腦系統以及電腦可讀取媒體
CN107291507B (zh) 一种虚拟机虚拟硬盘的升级方法及电子设备
CN114780019A (zh) 电子设备的管理方法、装置、电子设备及存储介质
CN112148337A (zh) 一种固件升级方法及装置
CN111694585A (zh) 替换系统分区文件的方法、系统、终端和存储介质
CN113900693A (zh) 一种固件升级方法、装置、系统、电子设备及存储介质
CN116450184B (zh) 一种系统升级方法、装置、电子设备及存储介质
CN110134423B (zh) 固件的更新方法、装置及计算机可读存储介质
CN109446159B (zh) 多版本文件管理方法、服务器及计算机可读存储介质
CN109739857B (zh) 高并发下的数据分布式写入方法、装置、终端及存储介质
CN114296764A (zh) 系统升级方法、装置、存储介质和电子设备
CN110908818B (zh) 一种验证方法、装置、设备和存储介质
CN113094367A (zh) 数据处理方法、装置和服务器
KR100748206B1 (ko) 임베디드장치의 펌웨어 업그레이드 방법
US9418071B2 (en) Method and system for automatically initiating a file aggregation process between communicatively coupled devices

Legal Events

Date Code Title Description
AS Assignment

Owner name: HUAWEI DEVICE CO., LTD., CHINA

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:YU, JINGJING;REEL/FRAME:037864/0557

Effective date: 20151208

STCF Information on status: patent grant

Free format text: PATENTED CASE

AS Assignment

Owner name: HUAWEI DEVICE (SHENZHEN) CO., LTD., CHINA

Free format text: CHANGE OF NAME;ASSIGNOR:HUAWEI DEVICE CO.,LTD.;REEL/FRAME:046340/0590

Effective date: 20180518

AS Assignment

Owner name: HUAWEI DEVICE CO., LTD., CHINA

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:HUAWEI DEVICE (SHENZHEN) CO., LTD.;REEL/FRAME:047603/0039

Effective date: 20181119

MAFP Maintenance fee payment

Free format text: PAYMENT OF MAINTENANCE FEE, 4TH YEAR, LARGE ENTITY (ORIGINAL EVENT CODE: M1551); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY

Year of fee payment: 4