Movatterモバイル変換


[0]ホーム

URL:


CN113448610A - Method for downloading program firmware of chip, electronic device and storage medium - Google Patents

Method for downloading program firmware of chip, electronic device and storage medium
Download PDF

Info

Publication number
CN113448610A
CN113448610ACN202110837799.XACN202110837799ACN113448610ACN 113448610 ACN113448610 ACN 113448610ACN 202110837799 ACN202110837799 ACN 202110837799ACN 113448610 ACN113448610 ACN 113448610A
Authority
CN
China
Prior art keywords
chip
storage medium
program
downloading
program firmware
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.)
Pending
Application number
CN202110837799.XA
Other languages
Chinese (zh)
Inventor
王超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xi'an Liancheng Intelligent Technology Co ltd
Original Assignee
Xi'an Liancheng Intelligent Technology 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 Xi'an Liancheng Intelligent Technology Co ltdfiledCriticalXi'an Liancheng Intelligent Technology Co ltd
Priority to CN202110837799.XApriorityCriticalpatent/CN113448610A/en
Publication of CN113448610ApublicationCriticalpatent/CN113448610A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本发明提供了一种芯片的程序固件的下载方法、芯片、电子设备及存储介质。该方法包括接收程序固件的下载指令;根据下载指令使芯片进入下载模式;下载代理程序;通过代理程序擦除芯片中的存储介质中存储的引导器程序固件;通过代理程序下载引导器程序固件至芯片中的存储介质中,无论是在哪个步骤出现下载中断的情况,都可以重新进入下载模式,避免芯片变砖的问题,这种设计思路非常巧妙,避免了芯片被损坏,也大大降低了人力成本,也不会给产品中的用户数据带来安全隐患。

Figure 202110837799

The present invention provides a method for downloading program firmware of a chip, a chip, an electronic device and a storage medium. The method includes receiving a download instruction of program firmware; making the chip enter a download mode according to the download instruction; downloading an agent program; erasing the bootloader program firmware stored in a storage medium in the chip through the agent program; downloading the bootloader program firmware through the agent program to In the storage medium in the chip, no matter at which step the download is interrupted, you can re-enter the download mode to avoid the problem of the chip becoming bricked. This design idea is very clever, which avoids the chip being damaged and greatly reduces the manpower. Cost, and will not bring security risks to user data in the product.

Figure 202110837799

Description

Method for downloading program firmware of chip, electronic device and storage medium
Technical Field
The present invention relates to the field of chip technologies, and in particular, to a method for downloading a program firmware of a chip, an electronic device, and a storage medium.
Background
In some cases, the chip is packaged into a product and then needs to be subjected to secondary upgrading of the program firmware in the chip. In the process of upgrading the program firmware in the chip, if the chip is powered off or disconnected, boot of the chip may be suspended, and the system kernel cannot be booted normally to load, that is, the chip becomes a brick. In the face of the problem of chip brick changing, the chip can be disassembled at present, so that the disassembled chip is subjected to short circuit to enter an upgrading mode again, but the mode not only easily causes the chip to be damaged, but also greatly increases the labor cost; or, a design mode that the chip is shorted to enable the chip to enter an emergency download mode is considered during chip design, but the design mode may cause a product structure to need redesign, and may also bring potential safety hazards to user data in the product.
Disclosure of Invention
In view of the above, a method for downloading program firmware of a chip, an electronic device, and a storage medium are provided.
One object of the present invention is to prevent the chip from being bricked during the downloading of the program firmware.
It is another object of the invention to maintain consistency of the firmware versions of the programs in the chip.
According to an aspect of the present invention, the present invention provides a method for downloading program firmware of a chip, including:
receiving a downloading instruction of the program firmware;
enabling the chip to enter a downloading mode according to the downloading instruction;
downloading the agent program;
erasing, by the agent, a boot program firmware stored in a storage medium in the chip;
and downloading the boot program firmware to a storage medium in the chip through the agent program.
Optionally, after erasing, by the agent program, the boot program firmware stored in the storage medium in the chip, the method further includes:
erasing, by the agent, non-boot program firmware stored in a storage medium in the chip;
before downloading the boot program firmware to the storage medium in the chip through the agent program, the method further comprises the following steps:
downloading, by the agent, non-boot program firmware to the storage medium.
Optionally, the non-boot program firmware comprises at least one of:
application processor program firmware, baseband chip plus coprocessor program firmware, trusted area program firmware, non-volatile data program firmware, user data program firmware.
Optionally, before erasing, by the agent program, the boot program firmware stored in the storage medium in the chip, the method includes:
and backing up the program firmware stored in the storage medium in the chip.
Optionally, after downloading the boot program firmware to the storage medium in the chip through the agent, the method includes:
and restarting the chip.
Optionally, the storage medium is a flash memory.
According to another aspect of the present invention, the present invention also provides a chip comprising:
the chip comprises a memory and a processor, wherein a control program is stored in the memory, and the control program is used for realizing the downloading method of the program firmware of the chip according to any one of the above items when being executed by the processor.
According to still another aspect of the present invention, there is also provided an electronic device including:
the chip described above.
According to a further aspect of the invention, the invention also provides a machine-readable storage medium having stored thereon a machine-executable program which, when executed by a processor, implements a method of downloading program firmware for a chip according to any one of the preceding claims.
In the downloading method of the program firmware of the chip, the downloading instruction of the program firmware is received, the chip enters a downloading mode according to the downloading instruction, the agent program is downloaded, the bootstrap program firmware stored in the storage medium in the chip is erased through the agent program, the bootstrap program firmware is downloaded into the storage medium in the chip through the agent program, the downloading mode can be re-entered no matter which step the downloading is interrupted, and the problem of the brick change of the chip is avoided.
Further, after the boot program firmware stored in the storage medium is erased, the non-boot program firmware stored in the storage medium is also erased, which may be understood as a full erase, and the full erase may ensure that the non-boot program firmware may be updated each time downloading is performed, which is beneficial to maintaining the consistency of the versions of the non-boot program firmware and the boot program firmware, compared with a partial erase.
The above and other objects, advantages and features of the present invention will become more apparent to those skilled in the art from the following detailed description of specific embodiments thereof, taken in conjunction with the accompanying drawings.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a flowchart of a method for downloading program firmware of a chip according to one embodiment of the present invention;
fig. 2 is a flowchart of a downloading method of program firmware of a chip according to another embodiment of the present invention;
fig. 3 is a schematic structural diagram of a chip according to an embodiment of the invention.
Detailed Description
At present, in the process of upgrading program firmware in a chip, if the chip is powered off or disconnected, boot of the chip may be suspended, and a system kernel cannot be booted normally to load, that is, the chip becomes a brick. In the face of the problem of chip brick changing, the chip can be disassembled at present, so that the disassembled chip is subjected to short circuit to enter an upgrading mode again, but the mode not only easily causes the chip to be damaged, but also greatly increases the labor cost; or, a design mode that the chip is shorted to enable the chip to enter an emergency download mode is considered during chip design, but the design mode may cause a product structure to need redesign, and may also bring potential safety hazards to user data in the product.
In view of the foregoing problems, an embodiment of the present invention provides a method for downloading a program firmware of a chip.
Fig. 1 is a flowchart of a method for downloading program firmware of a chip according to an embodiment of the present invention. Referring to fig. 1, the method for downloading the program firmware of the chip may include the following steps S102 to S110.
Step S102: and receiving a downloading instruction of the program firmware.
Step S104: and enabling the chip to enter a downloading mode according to the downloading instruction.
Step S106: download the agent (programmer).
Step S108: the boot loader firmware (bootloader) stored in the storage medium in the chip is erased by the agent program. In this step, the storage medium may be a flash memory (flash), but of course, the storage medium may also be other types of storage media.
Step S110: the boot program firmware is downloaded to the storage medium in the chip through the agent program.
In this embodiment, it is predetermined that if the storage medium of the chip is empty, the download mode can be directly entered. The manner of determining that the storage medium is empty may include: if the storage medium is not detected to have the boot program firmware, determining that the storage medium is empty; or, performing integrity check on the boot program firmware in the storage medium, and if the check fails, determining that the storage medium is empty. Specifically, the above-mentioned manner of determining that the storage medium is empty may be implemented by a boot loader (Bootrom Provider). The method comprises the steps of receiving a downloading instruction of program firmware, enabling a chip to enter a downloading mode according to the downloading instruction, downloading an agent program, erasing the boot program firmware stored in a storage medium in the chip through the agent program, downloading the boot program firmware to the storage medium in the chip through the agent program, and reentering the downloading mode no matter which step the downloading is interrupted, so that the problem that the chip is changed into bricks is avoided.
In an embodiment of the present invention, after erasing the boot program firmware stored in the storage medium in the chip by the agent program, the method may further include: the non-boot program firmware stored in the storage medium in the chip is erased by the agent program.
Before downloading the boot program firmware to the storage medium in the chip through the agent program, the method may further include: the non-boot program firmware is downloaded to the storage medium via the agent program.
In this embodiment, the sequence of erasing the boot loader program firmware, erasing the non-boot loader program firmware, downloading the non-boot loader program firmware, and downloading the boot loader program firmware is adopted, so that the downloading mode can be re-entered no matter which step is interrupted, and the phenomenon that the chip is changed into a brick is avoided. Erasing only the boot program firmware stored in the storage medium can be understood as partial erasing, which is more efficient. After the boot program firmware stored in the storage medium is erased, the non-boot program firmware stored in the storage medium is also erased, which can be understood as total erasure, and compared with partial erasure, the total erasure can ensure that the non-boot program firmware can be updated every time of downloading, which is beneficial to maintaining the consistency of the versions of the non-boot program firmware and the boot program firmware.
In one embodiment of the invention, the non-boot program firmware may include, and is not limited to, the following:
application processor program firmware (ap), baseband chip plus coprocessor program firmware (cp), trusted zone program firmware (tz), non-volatile data program firmware (nv), and user data program firmware (userdata).
In one embodiment of the present invention, before erasing the boot program firmware stored in the storage medium in the chip by the agent, the method may include:
and backing up the program firmware stored in the storage medium in the chip.
In this embodiment, before erasing the boot program firmware stored in the storage medium in the chip by the agent program, the program firmware stored in the storage medium in the chip is backed up, so that the original program firmware can be prevented from being lost, thereby being beneficial to restoring the original program firmware.
In one embodiment of the present invention, after downloading the boot program firmware to the storage medium in the chip through the agent, the method may include: and restarting the chip. By restarting the chip, the downloaded program firmware can be validated.
Fig. 2 is a flowchart of a downloading method of program firmware of a chip according to another embodiment of the present invention, including steps S202 to S218.
Step S202: and receiving a downloading instruction of the program firmware.
Step S204: and enabling the chip to enter a downloading mode according to the downloading instruction.
Step S206: and downloading the agent program.
Step S208: and backing up the program firmware stored in the storage medium in the chip. In this step, the program firmware stored in the storage medium in the chip may be backed up by the agent program.
Step S210: the boot program firmware stored in the storage medium in the chip is erased by the agent program.
Step S212: the non-boot program firmware stored in the storage medium in the chip is erased by the agent program.
Step S214: the non-boot program firmware is downloaded to the storage medium via the agent program.
Step S216: the boot program firmware is downloaded to the storage medium in the chip through the agent program.
Step S218: and restarting the chip.
Referring to fig. 3, the present invention also provides a chip 300 based on the same concept. Chip 300 may include memory 301 and processor 302. The memory 301 stores a control program, which when executed by the processor 302, is used to implement the method for downloading the program firmware of the chip 300 according to any of the above-described embodiments.
Based on the same conception, the invention also provides the electronic equipment. The electronic device comprises the chip 300 of the above embodiment. In this embodiment, the electronic device may be a mobile phone, a tablet computer, a wearable device, a car machine, or the like.
Based on the same concept, the present invention also provides a machine-readable storage medium on which a machine-executable program is stored, which when executed by a processor implements a method for downloading program firmware of a chip according to any of the above embodiments.
The above embodiments can be combined arbitrarily, and according to any one of the above preferred embodiments or a combination of multiple preferred embodiments, the embodiments of the present invention can achieve the following beneficial effects:
the method comprises the steps of receiving a downloading instruction of program firmware, enabling a chip to enter a downloading mode according to the downloading instruction, downloading an agent program, erasing the boot program firmware stored in a storage medium in the chip through the agent program, downloading the boot program firmware to the storage medium in the chip through the agent program, and reentering the downloading mode no matter which step the downloading is interrupted, so that the problem that the chip is changed into bricks is avoided.
Thus, it should be appreciated by those skilled in the art that while a number of exemplary embodiments of the invention have been illustrated and described in detail herein, many other variations or modifications consistent with the principles of the invention may be directly determined or derived from the disclosure of the present invention without departing from the spirit and scope of the invention. Accordingly, the scope of the invention should be understood and interpreted to cover all such other variations or modifications.

Claims (9)

1. A method for downloading program firmware of a chip is characterized by comprising the following steps:
receiving a downloading instruction of the program firmware;
enabling the chip to enter a downloading mode according to the downloading instruction;
downloading the agent program;
erasing, by the agent, a boot program firmware stored in a storage medium in the chip;
and downloading the boot program firmware to a storage medium in the chip through the agent program.
2. The download method according to claim 1,
after erasing the boot program firmware stored in the storage medium in the chip by the agent program, the method further comprises:
erasing, by the agent, non-boot program firmware stored in a storage medium in the chip;
before downloading the boot program firmware to the storage medium in the chip through the agent program, the method further comprises the following steps:
downloading, by the agent, non-boot program firmware to the storage medium.
3. The download method according to claim 2,
the non-boot program firmware includes at least one of:
application processor program firmware, baseband chip plus coprocessor program firmware, trusted area program firmware, non-volatile data program firmware, user data program firmware.
4. The download method according to claim 1,
before erasing, by the agent program, a boot program firmware stored in a storage medium in the chip, the method includes:
and backing up the program firmware stored in the storage medium in the chip.
5. The download method according to claim 1,
after downloading boot program firmware to a storage medium in the chip by the agent, comprising:
and restarting the chip.
6. The download method according to claim 1,
the storage medium is a flash memory.
7. A chip, comprising:
a memory and a processor, the memory having stored therein a control program for implementing a method of downloading program firmware for a chip according to any one of claims 1-6 when executed by the processor.
8. An electronic device, comprising:
the chip of claim 7.
9. A machine readable storage medium having stored thereon a machine executable program which when executed by a processor implements a method of downloading program firmware for a chip according to any one of claims 1 to 6.
CN202110837799.XA2021-07-232021-07-23Method for downloading program firmware of chip, electronic device and storage mediumPendingCN113448610A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202110837799.XACN113448610A (en)2021-07-232021-07-23Method for downloading program firmware of chip, electronic device and storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202110837799.XACN113448610A (en)2021-07-232021-07-23Method for downloading program firmware of chip, electronic device and storage medium

Publications (1)

Publication NumberPublication Date
CN113448610Atrue CN113448610A (en)2021-09-28

Family

ID=77817163

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202110837799.XAPendingCN113448610A (en)2021-07-232021-07-23Method for downloading program firmware of chip, electronic device and storage medium

Country Status (1)

CountryLink
CN (1)CN113448610A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN116185527A (en)*2023-03-082023-05-30广州万协通信息技术有限公司Downloading method, device, equipment and storage medium of chip loading program

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2004070571A2 (en)*2003-02-032004-08-19Bitfone CorporationUpdate system for facilitating firmware/software update in a mobile handset
CN101206703A (en)*2006-12-222008-06-25中国科学院计算技术研究所 A chip with external security function of program content and program downloading method
CN105975850A (en)*2016-07-012016-09-28惠州Tcl移动通信有限公司Software downloading method and system based on mobile terminal
US20160306977A1 (en)*2014-12-222016-10-20Capital One Services, LLC.System and methods for secure firmware validation

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2004070571A2 (en)*2003-02-032004-08-19Bitfone CorporationUpdate system for facilitating firmware/software update in a mobile handset
CN101206703A (en)*2006-12-222008-06-25中国科学院计算技术研究所 A chip with external security function of program content and program downloading method
US20160306977A1 (en)*2014-12-222016-10-20Capital One Services, LLC.System and methods for secure firmware validation
CN105975850A (en)*2016-07-012016-09-28惠州Tcl移动通信有限公司Software downloading method and system based on mobile terminal

Cited By (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN116185527A (en)*2023-03-082023-05-30广州万协通信息技术有限公司Downloading method, device, equipment and storage medium of chip loading program

Similar Documents

PublicationPublication DateTitle
CN109634645B (en)Firmware upgrading method and terminal
US11222118B2 (en)Method for updating selinux security policy and terminal
KR101427755B1 (en)Device and method for firmware upgrade using usb
TW446864B (en)Automatic BIOS backup method
JP5889933B2 (en) Method for preventing malfunction of computer, computer program, and computer
CN102945176B (en) Method and device for starting and upgrading terminal equipment
CN109032846A (en)Equipment remote backup upgrade method, device, computer storage medium and equipment
US8539213B2 (en)Manageability extension mechanism for system firmware
WO2019062703A1 (en)Update method, and embedded system
CN103430147B (en)The control method of signal conditioning package and signal conditioning package
KR20070035164A (en) How to boot, automatically update software and recover from errors, and the system and computer-readable recording media recording the method
CN105068834B (en)Method for upgrading system and device
US9286468B2 (en)Option read-only memory use
KR20130142073A (en)Method and terminal for using mobile memory card to boot up mobile phone operating system
CN104951328A (en)Embedded equipment and starting method thereof
CN108897564A (en)A kind of method for upgrading software and embedded system of embedded system
CN104951330B (en)Method for operating multiple operating systems and electronic device thereof
CN104731622A (en)Application program loading method and device and mobile terminal
CN102880478B (en) Software update method
CN113448610A (en)Method for downloading program firmware of chip, electronic device and storage medium
CN114115958A (en)Program starting method and terminal equipment
US20160041782A1 (en)Storage Device Copying of a larger system to a smaller system
CN104809021B (en)Management system and management method for multiple operation environment service
CN110908722B (en)Method and device applied to starting of operating system, electronic equipment and storage medium
CN116009969A (en) Application program control method, device, electronic device, chip and storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication
RJ01Rejection of invention patent application after publication

Application publication date:20210928


[8]ページ先頭

©2009-2025 Movatter.jp