Search

CN-121996272-A - Firmware updating method and firmware updating device

CN121996272ACN 121996272 ACN121996272 ACN 121996272ACN-121996272-A

Abstract

The application provides a firmware updating method and a firmware updating device, wherein the method comprises the steps of obtaining hardware identification information and a current firmware version number of a storage device by sending a standard command; the method comprises the steps of comparing a current firmware version number with a target firmware version number to judge whether firmware updating is needed for a storage device, acquiring a corresponding firmware updating file according to a determined change mode if the firmware updating is needed, triggering the storage device to enter the firmware updating mode by sending a specific manufacturer command sequence to the storage device, and writing firmware data in the firmware updating file into a firmware storage area of the storage device. The method for updating the firmware of the storage device can save the cost and avoid the problem of wrong brushing and missing brushing.

Inventors

  • Cheng Mengshuang
  • CHEN JIANYOU
  • MA YUNYANG
  • ZHANG JINTING
  • CHEN JINLIN
  • CHEN YUNSONG

Assignees

  • 深圳星火半导体科技有限公司

Dates

Publication Date
20260508
Application Date
20260126

Claims (17)

  1. 1. A firmware update method for updating firmware in a storage device, the method comprising: Obtaining basic identity information of the storage device by sending a standard command, wherein the basic identity information at least comprises hardware identification information and a current firmware version number; comparing the current firmware version number with the target firmware version number to judge whether the storage device needs to be updated with firmware; If the updating is required, acquiring a corresponding firmware updating file according to the determined changing mode; And triggering the storage device to enter a firmware updating mode by sending a specific manufacturer command sequence to the storage device, and writing the firmware data in the firmware updating file into a firmware storage area of the storage device.
  2. 2. The method of claim 1, wherein the obtaining basic identity information of the storage device by sending a standard command comprises: Transmitting a first command to read CID register contents of the memory device and a second command to read CSD register contents of the memory device to obtain the hardware identification information, and A third command is sent to read a firmware version register of the storage device or to obtain the current firmware version number by parsing the contents of a particular register.
  3. 3. The method of claim 1, wherein comparing the current firmware version number with a target firmware version number to determine whether a firmware update to the storage device is required comprises: before the comparison operation, verifying a digital signature of a version manifest file or a firmware update file containing target firmware version information, wherein the version manifest file at least contains a download address and a hash check value of the target firmware file; only when the signature verification is passed and the update operation is judged to be required to be executed according to a predefined version update strategy, judging that the update is required; wherein the predefined version update policy includes that the current version number is lower than the target firmware version number.
  4. 4. A method according to claim 3, wherein the change mode comprises an automatic upgrade mode; In the automatic upgrade mode, the obtaining the corresponding firmware update file according to the determined change mode includes: Downloading a version manifest file from a remote server according to a preset upgrading strategy and verifying a digital signature of the version manifest file; and downloading target firmware according to the verified version list file.
  5. 5. The method of claim 4, wherein the updating according to the preset updating policy comprises: supporting a one-time timed task or a periodically repeated task, and The clock of the firmware update means is synchronized by a network time protocol before the download task is performed.
  6. 6. The method of claim 1, wherein the change mode comprises a manual upgrade mode; in the manual upgrade mode, the obtaining the corresponding firmware update file includes receiving a firmware file uploaded by a user; And performing an integrity check on the firmware file, the integrity check including verifying a file header magic number and calculating and comparing cryptographic hash values of the file.
  7. 7. The method according to claim 1, wherein the method further comprises: maintaining a local cache region storing authenticated firmware files; And when the system is in an offline environment, selecting a firmware update file from the local cache area.
  8. 8. The method of claim 1, wherein triggering the storage device to enter a firmware update mode by sending a specific vendor command sequence to the storage device comprises: sending one or more vendor defined update trigger commands to the storage device, and After each update trigger command is sent, checking the response of the storage device, and if the response indicates an error, stopping the subsequent flow.
  9. 9. The method of claim 8, wherein writing the firmware data in the firmware update file to the firmware storage area of the storage device comprises: After the storage device enters the firmware update mode, transmitting a firmware data transmission start command defined by a manufacturer to instruct to start transmitting the firmware data, and And transmitting firmware data by adopting a partitioning writing and real-time checking mechanism, after each data block is written, sending a writing state inquiring command defined by a manufacturer to inquire the writing state, and if the state indicates failure, retrying writing the data block.
  10. 10. The method according to claim 1, wherein the method further comprises: setting a rollback control flag, wherein the default state of the rollback control flag indicates forbidding forced rollback; In response to receiving an instruction to activate rollback, modifying a state of the rollback control flag to allow forced rollback; when a firmware writing operation is executed, if the state of the rollback control mark is the allowable forced rollback, the version number comparison check is skipped, and the integrity or security verification of the firmware update file is still required to be executed.
  11. 11. The method according to claim 10, wherein the method further comprises: Starting a timer after activating rollback; and if the firmware update instruction is not received before the timer is overtime, restoring the state of the rollback control mark to be forbidden to forcedly rollback.
  12. 12. The method according to claim 1, wherein the method further comprises: after the firmware data is successfully written, the firmware data is backed up to an independent storage area.
  13. 13. The method according to claim 1, wherein the method further comprises: the firmware update file is encrypted and integrity protected; After obtaining the firmware update file, decrypting and verifying the integrity of the firmware update file by using a key derived based on user input; wherein the integrity verification includes checking an authentication tag packaged with the file data.
  14. 14. The method of claim 13, wherein writing the firmware data in the firmware update file to the firmware storage area of the storage device comprises: Transmitting the firmware data after decryption verification is passed through a connection interface of the storage device; After the transmission is completed, the buffer area of the host system for temporarily storing the plaintext firmware data is cleared.
  15. 15. The method according to claim 1, wherein the method further comprises: Reading monitoring information reported by the storage device; analyzing the monitoring information according to a predefined rule, and evaluating the health degree of the storage device; And if the health evaluation result is lower than the safety threshold, preventing the firmware updating operation.
  16. 16. The method according to claim 1, wherein the method further comprises: Responding to successful writing of the firmware data, and waiting for resetting of the storage device; And in the resetting process, continuously sending a preset state detection command to the storage device for detection until a normal response is received so as to confirm that the updating is successful.
  17. 17. A firmware updating apparatus comprising a processing unit configured to perform the firmware updating method of any of claims 1 to 16.

Description

Firmware updating method and firmware updating device Technical Field The present application relates to the field of memory control, and in particular, to a firmware update method and a firmware update apparatus. Background NAND FLASH is widely used as a nonvolatile storage medium for storage devices such as SD, eMMC, UFS, SSD. Current SD card upgrades and maintenance have the problem of relying on manual labor. For mass firmware upgrade, the manual upgrade efficiency is low, the operation and maintenance cost is high, and the risk of manual misoperation exists. Therefore, how to upgrade and maintain an SD card automatically and normalized is a problem to be solved. Disclosure of Invention In view of the above, the present application provides a firmware updating method and a firmware updating apparatus to solve or partially solve the above-mentioned problems. The application provides a firmware updating method for updating firmware in a storage device, which comprises the steps of obtaining basic identity information of the storage device by sending a standard command, comparing the current firmware version number with a target firmware version number to judge whether the firmware of the storage device needs to be updated or not, obtaining a corresponding firmware updating file according to a determined change mode if the firmware needs to be updated, triggering the storage device to enter the firmware updating mode by sending a specific manufacturer command sequence to the storage device, and writing firmware data in the firmware updating file into a firmware storage area of the storage device. In a second aspect of the present application, a firmware updating apparatus is provided, comprising a processing unit configured to perform the firmware updating method according to the second aspect. The application provides a firmware updating method and a firmware updating device, wherein the method comprises the steps of obtaining basic identity information of a storage device by sending a standard command, comparing the current firmware version number with a target firmware version number to judge whether firmware updating is needed for the storage device, obtaining a corresponding firmware updating file according to a determined change mode if the firmware updating is judged to be needed, triggering the storage device to enter the firmware updating mode by sending a specific manufacturer command sequence to the storage device, and writing firmware data in the firmware updating file into a firmware storage area of the storage device. The automatic and standardized storage device firmware updating method provided by the application can replace manual operation, saves cost, and can avoid the problems of wrong brushing and missing brushing of an updated version in a standardized process. Drawings In order to more clearly illustrate the technical solution of the embodiments of the present application, the drawings required to be used in the embodiments of the present application will be briefly described, and it is within the scope of the present application to obtain other drawings according to these drawings without inventive effort for a person skilled in the art. FIG. 1 illustrates a schematic diagram of an exemplary memory storage system according to an embodiment of the application. FIG. 2 shows a schematic diagram of an exemplary memory controller according to an embodiment of the application. FIG. 3 illustrates a schematic diagram of an exemplary managed memory module, according to an embodiment of the application. FIG. 4 illustrates an exemplary firmware update apparatus and storage apparatus interaction framework diagram in accordance with an embodiment of the present application. Fig. 5 shows a flow diagram of an exemplary firmware update method according to an embodiment of the application. FIG. 6 illustrates a schematic diagram of an exemplary version change flow according to an embodiment of the present application. Detailed Description The technical solutions of the present application will be clearly and completely described in conjunction with the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application. It is particularly pointed out that similar substitutions and modifications to the application will be apparent to those skilled in the art, which are all deemed to be included in the application. It will be apparent to those skilled in the relevant art that variations and modifications can be made in the methods and applications described herein, or in the appropriate variations and combinations, without departing from the spirit and scope of the application. It will be apparent that the