Download port control method, download port setting method, maintenance tool and electronic equipment
By dynamically controlling the flag value of the firmware maintenance download port, the problem that the disabling instruction of the firmware maintenance download port cannot be modified after being solidified is solved, making firmware maintenance convenient and efficient, and improving the security and efficiency of firmware maintenance.
Patent Information
- Application Number
- CN202410130922.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-29
- Publication Date
- 2024-09-20
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing technology, the disabling instruction of the firmware maintenance download port cannot be modified after it is solidified, which makes firmware maintenance difficult, especially in the research and development and after-sales stages, where there is a mismatch, which affects efficiency.
By obtaining the flag value of the firmware maintenance download port and determining its enabling or disabling conditions, dynamic control of the firmware maintenance download port can be achieved to avoid the problem that the cured firmware maintenance download port disabling instructions cannot be modified, and an authentication mechanism can be used to improve security. and efficiency.
It realizes the convenience and efficiency of firmware maintenance, avoids the inability to enable the firmware maintenance download port after the disabling instruction is solidified, and improves the security and efficiency of firmware maintenance.
Smart Images

Figure CN118673482A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electronic equipment counting, and in particular to a method for controlling a firmware maintenance download port, a method for setting a state of a firmware maintenance download port, a firmware maintenance tool, an electronic equipment and a storage medium. Background Art
[0002] For the firmware maintenance of electronic devices, the firmware is usually upgraded or repaired through a firmware maintenance download port, which includes a Preloader (preloader) download port and a Brom (boot program) download port.
[0003] In the related art, the Preloader download port of the user version is disabled for security reasons during the development phase, and the user version is burned through the Brom download port. In addition, the closing procedure of the Preloader download port is fixed in the code, and the firmware can only be flashed through the Brom download port when burning the software. This method requires a specific flashing tool, and the flashing tool needs to install the corresponding driver. In most cases, there is a mismatch, which makes firmware maintenance difficult and inconvenient for after-sales. Summary of the invention
[0004] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the first purpose of the present invention is to propose a control method for a firmware maintenance download port, by which the firmware maintenance download port can be more conveniently used to implement firmware maintenance, making the firmware maintenance more convenient and efficient.
[0005] A second objective of the present invention is to provide an electronic device.
[0006] A third object of the present invention is to provide a method for setting the status of a firmware maintenance download port.
[0007] A fourth objective of the present invention is to provide a firmware maintenance tool.
[0008] A fifth objective of the present invention is to provide a computer-readable storage medium.
[0009] In order to solve the above problems, an embodiment of the first aspect of the present invention provides a control method for a firmware maintenance download port, characterized in that, for an electronic device, the firmware maintenance download port control method includes: obtaining a flag value of the firmware maintenance download port; determining that the flag value satisfies a condition for enabling the firmware maintenance download port, and enabling the firmware maintenance download port; determining that the flag value satisfies a condition for disabling the firmware maintenance download port, and disabling the firmware maintenance download port.
[0010] According to the firmware maintenance download port control method of the embodiment of the present invention, by setting the flag bit of the firmware maintenance download port, the flag bit value is judged to identify its current available status, and when the flag bit value matches the firmware maintenance download port enabling condition, the firmware maintenance download port is enabled, thereby avoiding the situation where the firmware maintenance download port disable instruction cannot be modified after being solidified and the download port cannot be enabled. The firmware maintenance download port can be used more conveniently to implement firmware maintenance, which makes firmware maintenance more convenient and improves firmware maintenance efficiency.
[0011] In some embodiments, the flag value satisfies the condition for enabling the firmware maintenance download port, including that the flag value of the firmware maintenance download port is consistent with the flag value for enabling the firmware maintenance download port; the flag value satisfies the condition for disabling the firmware maintenance download port, including that the flag value of the firmware maintenance download port is consistent with the flag value for disabling the firmware maintenance download port.
[0012] In some embodiments, the firmware maintenance download port control method also includes: authenticating the firmware maintenance tool end; if the authentication passes, setting the flag value according to the setting instruction of the firmware maintenance tool end; if the authentication fails, not responding to the setting instruction of the firmware maintenance tool end.
[0013] In some embodiments, authenticating the firmware maintenance tool side includes: sending encrypted data in response to an authentication start instruction that sets the flag value; receiving encrypted signature information fed back by the firmware maintenance tool side for the encrypted data; decrypting the encrypted signature information to obtain a tool side signature value; if the tool side signature value matches the device side signature value, the authentication is passed; if the tool side signature value does not match the device side signature value, the authentication fails.
[0014] In some embodiments, the flag value is set according to the setting instruction of the firmware maintenance tool end, including: according to the first setting instruction of the firmware maintenance tool end, the flag value is set to an enable value corresponding to enabling the firmware maintenance download port; or, according to the second setting instruction of the firmware maintenance tool end, the flag value is set to a disable value corresponding to disabling the firmware maintenance download port.
[0015] In some embodiments, before authenticating the firmware maintenance tool end, the firmware maintenance download port control method further includes: detecting a current operating mode of the electronic device; and determining that the current operating mode is a fast boot mode.
[0016] In some embodiments, the firmware maintenance download port includes a Preloader download port.
[0017] In some embodiments, the firmware maintenance download port further includes a Brom download port, and the firmware maintenance download port control method further includes: setting the Brom download port to a disabled state.
[0018] A second aspect of the present invention provides an electronic device, comprising: a first processor; a first memory communicatively connected to the first processor; a computer program executable by the first processor is stored in the first memory, and when the first processor executes the computer program, the firmware maintenance download port control method described in the above embodiment is implemented.
[0019] According to the electronic device of the embodiment of the present invention, the flag value is judged through the internal program of the electronic device, and the firmware maintenance download port is enabled or disabled during firmware maintenance. When the flag value matches the firmware maintenance download port, the firmware maintenance download port is enabled. The firmware maintenance can be more conveniently implemented using the firmware maintenance download port, and firmware maintenance is more convenient.
[0020] The third aspect of the present invention provides a method for setting the status of a firmware maintenance download port, which is characterized in that, for a firmware maintenance tool end, the method for setting the firmware maintenance download port includes: sending an authentication start instruction for setting a flag value of the firmware maintenance download port; receiving encrypted data in response to the authentication start instruction; decrypting the encrypted data to obtain a random number and generate a signature value, and forming a message based on the random number and the signature value; encrypting the message to obtain encrypted signature information; and sending the encrypted signature information.
[0021] According to the method for setting the status of the firmware maintenance download port in an embodiment of the present invention, the firmware maintenance tool sends an authentication start instruction to the electronic device. When setting the status of the firmware maintenance download port, authentication is performed first, which can improve the security of firmware maintenance, avoid delays due to incorrect flashing methods, and improve the efficiency of firmware maintenance.
[0022] In some embodiments, the method for setting the status of the firmware maintenance download port further includes: in response to an authentication pass instruction, sending a first setting instruction for the flag value of the firmware maintenance download port to set the flag value to an enable value corresponding to enabling the firmware maintenance download port; or, in response to an authentication pass instruction, sending a second setting instruction for the flag value of the firmware maintenance download port to set the flag value to a disable value corresponding to disabling the firmware maintenance download port.
[0023] The fourth aspect of the present invention provides a firmware maintenance tool, including: a second processor; a second memory connected to the second processor; the second memory stores a computer program that can be executed by the second processor, and when the second processor executes the computer program, it implements the firmware maintenance download port status setting method described in the above embodiment.
[0024] The firmware maintenance tool according to the embodiment of the present invention realizes authentication after accessing the electronic device through the internal program of the firmware maintenance tool. When setting the status of the firmware maintenance download port, authentication is performed first, which can improve the security of firmware maintenance, avoid delays due to incorrect flashing methods, and improve the efficiency of firmware maintenance.
[0025] A fifth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed, the method for controlling the firmware maintenance download port or the method for setting the state of the firmware maintenance download port of the above-mentioned embodiment is implemented.
[0026] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0028] Figure 1 is a flowchart of a firmware maintenance download port control method according to an embodiment of the present invention;
[0029] Figure 2 is a flowchart of downloading a software package according to an embodiment of the present invention;
[0030] Figure 3 is an authentication flow chart according to an embodiment of the present invention;
[0031] Figure 4 is a structural block diagram of an electronic device according to an embodiment of the present invention;
[0032] Figure 5 is a flowchart of a method for setting a firmware maintenance download port status according to an embodiment of the present invention;
[0033] Figure 6 is a structural block diagram of a firmware maintenance tool according to an embodiment of the present invention.
[0034] Reference numerals:
[0035] Electronic device 10; firmware maintenance tool 20;
[0036] First processor 1; first memory 2; second processor 3; second memory 4. DETAILED DESCRIPTION
[0037] Embodiments of the present invention are described in detail below. The embodiments described with reference to the accompanying drawings are exemplary. Embodiments of the present invention are described in detail below.
[0038] The method of the embodiment of the present invention can be based on the architecture of the electronic device and the firmware maintenance tool. During firmware maintenance, the firmware maintenance tool is connected to the firmware maintenance download port of the electronic device. When the firmware maintenance download port is enabled, the firmware maintenance tool can perform software upgrade or recovery through the firmware maintenance download port. The firmware maintenance tool can be a tool for firmware upgrade or recovery dedicated to after-sales service.
[0039] In the embodiment of the present invention, the user version refers to a mass production user version and a research and development user version. The user version is used to debug the electronic device during the research and development stage and the front laboratory test stage, and the mass production user version is used by the user after the electronic device is sold.
[0040] A first aspect of the present invention provides a method for controlling a firmware maintenance download port for use in electronic equipment. The method can improve the convenience of firmware maintenance and improve the efficiency of firmware maintenance.
[0041] Reference below Figure 1 The firmware maintenance download port control method according to an embodiment of the present invention is described as follows: Figure 1 As shown, the method includes: step S1 to step S3.
[0042] Step S1, obtaining the flag value of the firmware maintenance download port.
[0043] The flag value of the firmware maintenance download port may indicate the current state of the firmware maintenance download port, for example, whether it is a startable state or a disabled state.
[0044] Specifically, after the flag value is set, it can be saved simultaneously with the corresponding program. The processor of the electronic device can obtain the flag value of the firmware maintenance download port when starting the corresponding program, for example, when preloading the program or booting the loader.
[0045] Step S2: Determine if the flag value satisfies the condition for enabling the firmware maintenance download port, and then enable the firmware maintenance download port.
[0046] Step S3: Determine if the flag value satisfies the condition for disabling the firmware maintenance download port, and then disable the firmware maintenance download port.
[0047] Among them, the flag value satisfies the condition for enabling the firmware maintenance download port, including that the flag value of the firmware maintenance download port is consistent with the flag value for enabling the firmware maintenance download port; the flag value satisfies the condition for disabling the firmware maintenance download port, including that the flag value of the firmware maintenance download port is consistent with the flag value for disabling the firmware maintenance download port.
[0048] That is, after obtaining the flag bit of the firmware maintenance download port, determine whether the flag bit value corresponds to the flag bit value for enabling the firmware maintenance download port or the flag bit value for disabling the firmware maintenance download port. If the flag bit value satisfies the condition for enabling the firmware maintenance download port, the flag bit value is consistent with the value for enabling the firmware maintenance download port. Otherwise, if the flag bit value satisfies the condition for disabling the firmware maintenance download port, the flag bit value is consistent with the value for disabling the firmware maintenance download port.
[0049] For example, when the firmware maintenance tool is connected to the firmware maintenance download port, it checks the value of the zeroflag flag in the product info partition OFFEST=976 to determine whether the USB is allowed to establish a handshake. If the zeroflag value is 0x55, the USB download software handshake is successful, and the flag value meets the conditions for enabling the firmware maintenance download port. Figure 2 As shown, the firmware maintenance download port downloads software through the usbdl_handler() function to upgrade or repair the firmware.
[0050] like Figure 2 As shown, the specific process includes: executing the USB handshake program, namely usb_handshake(handler), inputting the USB handshake program, namely executing usb_handshakehandler(), monitoring the USB device, namely executing usb_listen(), judging whether the USB program is loaded, namely executing CFG_USB_DOWNLOAD, if so, the handshake is successful, namely usbdl_handdler(), and downloading is allowed; otherwise, if not, downloading is prohibited.
[0051] Specifically, if the flag bit value is consistent with the value of enabling the firmware maintenance download port, the firmware maintenance download port is enabled, that is, data interaction with the firmware maintenance tool can be performed through the firmware maintenance download port. Conversely, if the flag bit is consistent with the value of disabling the firmware maintenance download port, the firmware maintenance download port is disabled, that is, the firmware maintenance tool cannot download data through the firmware maintenance download port.
[0052] For example, when performing firmware maintenance, the firmware maintenance tool accesses the firmware maintenance download port, and the flag value meets the conditions for enabling the firmware maintenance download port. At this time, the firmware maintenance download port is enabled, and the firmware maintenance tool can transmit information with the firmware through the firmware maintenance download port.
[0053] According to the firmware maintenance download port control method of the embodiment of the present invention, a flag bit of the firmware maintenance download port is set, and the flag bit value is judged to identify its available status. When the flag bit value matches the firmware maintenance download port enabling condition, the firmware maintenance download port is enabled, thereby preventing the firmware maintenance download port from being enabled due to the inability to modify the disable instruction of the firmware maintenance download port after it is solidified. The firmware maintenance download port can be used more conveniently to implement firmware maintenance, which is more convenient and efficient.
[0054] In some embodiments, the flag value of the firmware maintenance download port can be modified and set through a firmware maintenance tool. It can be set to an enabled state or a disabled state. For example, when performing firmware maintenance, the firmware maintenance download port is set to an enabled state. After the firmware maintenance is completed, the flag value can be rewritten to disable the firmware maintenance download port, thereby improving the security of firmware maintenance.
[0055] Specifically, the firmware maintenance download port control method also includes: authenticating the firmware maintenance tool end; if the authentication passes, setting the flag value according to the setting instruction of the firmware maintenance tool end; if the authentication fails, not responding to the setting instruction of the firmware maintenance tool end.
[0056] Specifically, after the firmware maintenance tool accesses the firmware maintenance download port, it needs to be authenticated to improve security; if the authentication is successful, it means that the firmware maintenance tool is legal, and the flag value can be set according to the setting instructions of the firmware maintenance tool. After authentication, the authority is increased to factory mode, and the fastboot oem zeroflag set / clr / get instructions can be executed.
[0057] In some embodiments, the firmware maintenance tool side is authenticated, including: sending encrypted data in response to an authentication start instruction that sets a flag value; receiving encrypted signature information fed back by the firmware maintenance tool side for the encrypted data; decrypting the encrypted signature information to obtain a tool side signature value; if the tool side signature value matches the device side signature value, the authentication is passed; if the tool side signature value does not match the device side signature value, the authentication fails.
[0058] Specifically, Figure 3As shown, when the firmware maintenance tool side is authenticated, the device side responds to the authentication start instruction of setting the flag value, generates a string of random numbers, encrypts the random numbers, and sends the encrypted random numbers to the tool side; after receiving the random numbers, the tool side decrypts the data, decrypts it using the negotiated key, first obtains the serial number, then composes the message, and uses the key of the corresponding authority to sign the message to obtain the signature value; the tool side sends the obtained signature value to the device side, and the device side parses the signature value with the secret key. If the tool side signature value matches the device side signature value, the authentication is passed, and the tool side can communicate with the device side; if the tool side signature value does not match the device side signature value, the authentication fails, and the tool side and the standby side cannot communicate.
[0059] In some embodiments, the setting instruction of the firmware maintenance tool end sets the flag value, including: according to the first setting instruction of the firmware maintenance tool end, setting the flag value to an enable value corresponding to enabling the firmware maintenance download port; or, according to the second setting instruction of the firmware maintenance tool end, setting the flag value to a disable value corresponding to disabling the firmware maintenance download port.
[0060] Specifically, after the firmware maintenance tool end passes the authentication, the firmware maintenance download port can be controlled to be enabled or disabled by setting the flag value; the firmware maintenance tool end sets the flag value to the enable value corresponding to the enabled firmware maintenance download port through the first setting instruction, for example, when the flag value is set to 0x55, the firmware maintenance download port is enabled, and 0x55 is the enable value at this time; the first setting instruction can be understood as a setting instruction that sets the flag value to the enable value; the firmware maintenance tool end sets the flag value to the disable value corresponding to the disabled firmware maintenance download port through the second setting instruction, for example, when the flag value is set to 0x22 / 0x00, the firmware maintenance download port is disabled, and 0x22 / 0x00 is the disable value; the second setting instruction can be understood as a setting instruction that sets the flag value to the disable value.
[0061] In some embodiments, before authenticating the firmware maintenance tool end, the firmware maintenance download port control method further includes: detecting the current operating mode of the electronic device; and determining that the current operating mode is a fast boot mode.
[0062] Specifically, the firmware maintenance tool accesses the firmware maintenance download port. Before authenticating the firmware maintenance tool, the current operating mode of the electronic device must be detected. If the electronic device is executing other programs, the firmware maintenance tool cannot be authenticated. Therefore, it is necessary to determine that the current operating mode of the electronic device is the fast boot mode, and the firmware maintenance tool can be authenticated through this mode.
[0063] In some embodiments, the firmware maintenance download port includes a Preloader download port.
[0064] The Preloader download port refers to the preloader program located at the beginning of the device memory and is responsible for booting the device. During the download process of the Preloader download port, you need to put the device into download mode first and connect it to the computer through a serial port or other means, and then use the preloader download tool to write the firmware file to the device memory.
[0065] Specifically, during firmware maintenance, the flag value of the Preloader download port is set to an enabled value, and the firmware maintenance tool is connected to the device through the Preloader download port to perform efficient and secure information transmission to achieve the purpose of firmware maintenance.
[0066] In some embodiments, the electronic device further includes a Brom download port, and the firmware maintenance download port control method further includes: setting the Brom download port to a disabled state.
[0067] Specifically, the Brom download port refers to the Boot ROM (Boot Read-Only Memory) on the chip, which is a read-only memory that contains the boot code for device initialization. During the download process of the Brom download port, it is necessary to use a "flash cable" or "press the volume down key" to connect the device to the computer, and a special flash tool is required to write the firmware file into the device memory, which is inefficient and difficult to maintain the firmware. Therefore, in an embodiment of the present invention, the Brom download port is set to a disabled state, that is, the download method of the Brom download port can be shielded by software.
[0068] In summary, in the embodiment of the present invention, by setting the flag value of the Preloader download port, the Preloader download port can be enabled by rewriting the flag value when performing firmware maintenance. Compared with using the Brom download port, firmware maintenance is performed through the Preloader download port. There is no need to install the corresponding driver, the implementation is simple, the firmware maintenance efficiency can be improved, and it is convenient for after-sales.
[0069] Furthermore, during the R&D stage and the front-end laboratory testing stage, when debugging the user version, it is often impossible to burn the software into the device due to various reasons such as the driver or project file between the device and the Brom download port does not correspond, the flashing method is incorrect, the flashing tool is incorrect, etc., which seriously affects the development efficiency and increases the R&D analysis time.
[0070] Regarding the above problem, in an embodiment of the present invention, as described above, the firmware maintenance tool end is authenticated, and only after the authentication is passed can the flag value of the Preloader download port be rewritten to enable the download port, thereby improving the security of firmware maintenance and disabling the Brom download port, avoiding other incorrect means and improving R&D efficiency.
[0071] In short, the present invention changes the value of zeroflag and implements the instruction to modify the zeroflag value through authentication, so that only authorized users can modify the value of zeroflag. Because the encryption method is complex and difficult to crack, some security loopholes are avoided.
[0072] A second aspect of the present invention provides an electronic device, such as Figure 4 As shown, the electronic device 10 includes: a first processor 1 and a first memory 2 .
[0073] The first processor is communicatively connected to the first memory, the first memory stores a computer program executable by the first processor, and the first processor is used to implement the firmware maintenance download port control method when executing the computer program.
[0074] According to the electronic device of the embodiment of the present invention, the flag value is judged through the internal program of the electronic device, and the firmware maintenance download port is enabled or disabled during firmware maintenance. When the flag value matches the firmware maintenance download port, the firmware maintenance download port is enabled, thereby improving the security of firmware maintenance and increasing the efficiency of firmware maintenance.
[0075] A third aspect of the present invention provides a method for setting the status of a firmware maintenance download port, which is used on a firmware maintenance tool side.
[0076] Reference below Figure 5 The method for setting the firmware maintenance download port status according to an embodiment of the present invention is described as follows: Figure 5 As shown, the method includes: steps S4 to S8.
[0077] Step S4, sending an authentication start instruction for setting the flag value of the firmware maintenance download port.
[0078] Specifically, after the firmware maintenance tool is connected to the device, authentication is performed and the firmware maintenance tool sends an authentication start instruction for setting a flag value of the firmware maintenance download port to the device.
[0079] Step S5, receiving encrypted data in response to the authentication start instruction.
[0080] Specifically, after receiving the authentication start instruction, the device generates encrypted data and sends the encrypted data to the firmware maintenance tool, and the firmware maintenance tool receives the encrypted data sent by the device.
[0081] Step S6, decrypt the encrypted data to obtain a random number and generate a signature value, and compose a message based on the random number and the signature value.
[0082] Specifically, after receiving the encrypted data sent by the standby end, the firmware maintenance tool end uses the key to decrypt to obtain a random number and generate a signature value, and composes a message according to the random number and the signature value.
[0083] Step S7: encrypt the message to obtain encrypted signature information.
[0084] Specifically, the firmware maintenance tool encrypts the message consisting of the random number and the signature value to obtain encrypted signature information.
[0085] Step S8, sending encrypted signature information.
[0086] Specifically, the firmware maintenance tool sends the encrypted signature information to the device, and the device parses and compares the encrypted signature information sent by the firmware maintenance tool. If the signature value on the tool side matches the signature value on the device side, the authentication is successful and the tool side can communicate with the device side. If the signature value on the tool side does not match the signature value on the device side, the authentication fails and the tool side and the backup side cannot communicate.
[0087] According to the firmware maintenance download port status setting method of an embodiment of the present invention, the firmware maintenance tool sends an authentication start instruction to the electronic device. When setting the status of the firmware maintenance download port, authentication is performed first, which can improve the security of firmware maintenance, avoid delays due to incorrect flashing methods, and improve the efficiency of firmware maintenance.
[0088] In some embodiments, the firmware maintenance download port status setting method also includes: in response to an authentication pass instruction, sending a first setting instruction for the flag value of the firmware maintenance download port to set the flag value to an enable value corresponding to enabling the firmware maintenance download port; or, in response to an authentication pass instruction, sending a second setting instruction for the flag value of the firmware maintenance download port to set the flag value to a disable value corresponding to disabling the firmware maintenance download port.
[0089] Specifically, after the firmware maintenance tool end passes the authentication, the firmware maintenance download port can be controlled to be enabled or disabled by setting the flag value; the firmware maintenance tool end sets the flag value to the enable value corresponding to the enabled firmware maintenance download port through the first setting instruction, for example, when the flag value is set to 0x55, the firmware maintenance download port is enabled, and 0x55 is the enable value at this time; the first setting instruction can be understood as a setting instruction that sets the flag value to the enable value; the firmware maintenance tool end sets the flag value to the disable value corresponding to the disabled firmware maintenance download port through the second setting instruction, for example, when the flag value is set to 0x22 / 0x00, the firmware maintenance download port is disabled, and 0x22 / 0x00 is the disable value; the second setting instruction can be understood as a setting instruction that sets the flag value to the disable value.
[0090] In general, in the embodiment of the present invention, the Preloader download port of the mass production user version is opened by judging the zeroflag flag value at the specified position of the proinfo partition, that is, the Preloader download port of the R&D user version is no longer closed, because the value of the zeroflag flag can be modified by the command in the fastboot mode, and also because the command can improve the execution authority through authentication, the security of flashing is improved and it is not easy to be stolen. The development efficiency of production line, R&D, front laboratory and after-sales is improved.
[0091] A fourth aspect of the present invention provides a firmware maintenance tool, such as Figure 6 As shown, the firmware maintenance tool 20 includes: a second processor 3 and a second memory 4.
[0092] The second processor is communicatively connected to the second memory, the second memory stores a computer program executable by the second processor, and the second processor is used to implement the firmware maintenance download port status setting method when executing the computer program.
[0093] The firmware maintenance tool according to the embodiment of the present invention realizes authentication after accessing the electronic device through the internal program of the firmware maintenance tool. When setting the status of the firmware maintenance download port, authentication is performed first, which can improve the security of firmware maintenance, avoid delays due to incorrect flashing methods, and improve the efficiency of firmware maintenance.
[0094] A fifth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed, the firmware maintenance download port control method or the firmware maintenance download port status setting method of the above-mentioned embodiment is implemented.
[0095] In the description of this specification, any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code including one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present invention belong.
[0096] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0097] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0098] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0099] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0100] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
[0101] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, substrates, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example.
[0102] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A method for controlling a firmware maintenance download port, characterized in that: For electronic equipment, the control method of the firmware maintenance download port includes: Get the flag value of the firmware maintenance download port; Determining that the flag bit value satisfies a condition for enabling the firmware maintenance download port, then enabling the firmware maintenance download port; If it is determined that the flag value satisfies a condition for disabling the firmware maintenance download port, the firmware maintenance download port is disabled.
2. The method for controlling the firmware maintenance download port according to claim 1, characterized in that: The condition that the flag value satisfies the enabling of the firmware maintenance download port includes that the flag value of the firmware maintenance download port is consistent with the flag value of enabling the firmware maintenance download port; The flag value satisfies the condition for disabling the firmware maintenance download port, which includes that the flag value of the firmware maintenance download port is consistent with the flag value for disabling the firmware maintenance download port.
3. The method for controlling the firmware maintenance download port according to claim 1, characterized in that: The firmware maintenance download port control method also includes: Authenticate the firmware maintenance tool. If the authentication is successful, setting the flag value according to the setting instruction of the firmware maintenance tool end; If the authentication fails, the setting instruction of the firmware maintenance tool will not be responded.
4. The method for controlling the firmware maintenance download port according to claim 3, characterized in that: Authenticate the firmware maintenance tool, including: In response to an authentication start instruction for setting the flag value, sending encrypted data; Receiving encrypted signature information fed back by the firmware maintenance tool for the encrypted data; Decrypting the encrypted signature information to obtain a tool-side signature value; If the tool-side signature value matches the device-side signature value, the authentication is successful; If the tool-side signature value does not match the device-side signature value, the authentication fails.
5. The method for controlling the firmware maintenance download port according to claim 3, characterized in that: Setting the flag value according to the setting instruction of the firmware maintenance tool includes: According to the first setting instruction of the firmware maintenance tool end, the flag value is set to an enabling value corresponding to enabling the firmware maintenance download port; Alternatively, according to the second setting instruction of the firmware maintenance tool end, the flag bit value is set to a disabling value corresponding to disabling the firmware maintenance download port.
6. The method for controlling the firmware maintenance download port according to claim 3, characterized in that: Before authenticating the firmware maintenance tool end, the firmware maintenance download port control method further includes: detecting a current operating mode of the electronic device; Determine that the current operating mode is a fast boot mode.
7. The method for controlling the firmware maintenance download port according to any one of claims 1 to 6, characterized in that: The firmware maintenance download port includes a Preloader download port.
8. The method for controlling the firmware maintenance download port according to claim 7, characterized in that: The electronic device further includes a Brom download port, and the firmware maintenance download port control method further includes: setting the Brom download port to a disabled state.
9. An electronic device, characterized in that: include: a first processor; a first memory communicatively connected to the first processor; The first memory stores a computer program that can be executed by the first processor, and the first processor implements the firmware maintenance download port control method according to any one of claims 1 to 8 when executing the computer program.
10. A method for setting the status of a firmware maintenance download port, characterized in that: For the firmware maintenance tool end, the method for setting the firmware maintenance download port includes: Send an authentication start instruction to set the flag value of the firmware maintenance download port; receiving encrypted data in response to the authentication start instruction; Decrypting the encrypted data to obtain a random number and generate a signature value, and forming a message according to the random number and the signature value; Encrypting the message to obtain encrypted signature information; The encrypted signature information is sent.
11. The method for setting the status of the firmware maintenance download port according to claim 10, characterized in that: The method for setting the state of the firmware maintenance download port also includes: In response to the authentication pass instruction, sending a first setting instruction of the flag value of the firmware maintenance download port to set the flag value to an enabling value corresponding to enabling the firmware maintenance download port; Alternatively, in response to the authentication pass instruction, a second setting instruction for the flag value of the firmware maintenance download port is sent to set the flag value to a disabling value corresponding to disabling the firmware maintenance download port.
12. A firmware maintenance tool, characterized in that: include: A second processor; a second memory communicatively connected to the second processor; The second memory stores a computer program that can be executed by the second processor, and the second processor implements the state setting method of the firmware maintenance download port according to claim 10 or 11 when executing the computer program.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed, the firmware maintenance download port control method described in any one of claims 1 to 8 or the firmware maintenance download port status setting method described in claim 10 or 11 is implemented.
Citation Information
Patent Citations
Software downloading method and system based on mobile terminal
CN105975850A
Port authentication method and device, electronic equipment and storable medium
CN116321173A
