Function configuration method, main control chip and mobile storage device

By introducing dynamic storage and parsing flag bits and configuration bit mechanisms in Efuse memory, combined with the configuration function comparison table, the problems of insufficient flexibility in the function configuration of the main control chip and low utilization of storage space are solved, and efficient functional configuration and storage efficiency are achieved.

CN119883762APending Publication Date: 2025-04-25SHENZHEN CITY TECHWIN SEMICONDUCTOR COMPANY LIMITED
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411954675.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

The existing technology lacks flexibility in the functional configuration of the main control chip, and the Efuse storage space utilization rate is low, so it cannot efficiently support complex and diverse configuration requirements.

Method used

By introducing dynamic storage and parsing flag bits and configuration bit mechanisms in Efuse memory, combined with the mapping of functions and operations by the configuration function comparison table, the efficient identification of the main control chip function data, dynamic adjustment and flexible execution of configuration operations can be achieved.

Benefits of technology

It improves the functional configuration flexibility and storage efficiency of the main control chip, meets complex and diverse functional needs, and improves functional configuration efficiency, storage space utilization and adaptability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119883762A_ABST
    Figure CN119883762A_ABST
Patent Text Reader

Abstract

The invention provides a function configuration method, a main control chip and a mobile storage device, and the method comprises the steps: recognizing whether an Efuse memory stores function data or not after the Efuse memory is powered on; if it is identified that the function data is stored in the Efuse memory, reading the function data, and judging whether the function data comprises a function to be configured or not; the function to be configured is composed of a flag bit with a preset flag bit length and a configuration bit; if the function data comprises the to-be-configured function, judging whether the to-be-configured function is in an enabled state or not; if the to-be-configured function is in the enabled state, executing a configuration operation corresponding to the to-be-configured function based on the configuration function comparison table until the configuration of the to-be-configured function is completed; wherein the configuration function comparison table is used for representing the corresponding relation between the configuration function and the configuration operation. In the mode, the function data can be flexibly stored and analyzed, so that the configuration flexibility and the storage efficiency of the main control chip are improved, and complex and diversified function requirements are met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of chip technology, and in particular to a function configuration method, a main control chip and a mobile storage device. Background Art

[0002] With the widespread use of master chips in mobile storage devices, the functional configuration requirements of chips are becoming increasingly complex. In order to meet the diverse application scenarios of the device, it is usually necessary to pre-configure the functions of the chip through the Efuse memory to automatically initialize related hardware features or enable specific functions when powered on. The functional data in the Efuse memory usually consists of flag bits and configuration bits, which are used to identify the function type and the corresponding configuration parameters.

[0003] Existing methods usually use fixed-format flag bits and configuration bits to store functional data, and the main control chip directly reads these data during the startup process and completes chip initialization. However, this method has the following problems: on the one hand, the functional configuration is not flexible enough, and it is impossible to dynamically adjust the functional status or add new functions; on the other hand, the Efuse storage space utilization rate is low, and it cannot efficiently support complex and diverse configuration requirements. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a function configuration method, a main control chip and a mobile storage device, which can flexibly store and parse functional data, thereby improving the configuration flexibility and storage efficiency of the main control chip and meeting complex and diverse functional requirements.

[0005] In a first aspect, an embodiment of the present invention provides a function configuration method, which is applied to a main control chip, wherein an Efuse memory is provided in the main control chip, and the Efuse memory is used to store function data; the method comprises: after power-on, identifying whether function data is stored in the Efuse memory; if it is identified that function data is stored in the Efuse memory, reading the function data, and determining whether the function data includes a function to be configured; the function to be configured consists of a flag bit and a configuration bit with a preset flag bit length; if the function data includes the function to be configured, determining whether the function to be configured is in an enabled state; if the function to be configured is in an enabled state, executing a configuration operation corresponding to the function to be configured based on a configuration function comparison table until the configuration of the function to be configured is completed; wherein the configuration function comparison table is used to characterize the correspondence between the configuration function and the configuration operation.

[0006] Furthermore, after power-on, the step of identifying whether functional data is stored in the Efuse memory includes: after power-on, sequentially reading the 0th byte data in the Efuse memory; determining whether the 0th byte data is a preset startup flag; if it is a preset startup flag, determining that functional data is stored in the Efuse memory; if it is not a preset startup flag, determining that no functional data is stored in the Efuse memory, and ending the configuration.

[0007] Furthermore, if it is recognized that function data is stored in the Efuse memory, the function data is read, and the step of determining whether the function data includes the function to be configured includes: using the function data of a preset flag bit length after the 0th byte data read sequentially as the first flag bit; determining whether the first flag bit is a preset stop flag bit; if it is the preset stop flag bit, determining that the function data does not include the function to be configured, and terminating the configuration; if it is not the preset stop flag bit, determining that the function data includes the function to be configured.

[0008] Furthermore, the flag bit includes a function bit and a status bit; the function bit is used to represent the function name of the function to be configured; the status bit is used to represent the function status of the function to be configured; if the function data includes the function to be configured, the step of judging whether the function to be configured is in an enabled state comprises: based on the first flag bit and the configuration function comparison table, determining that the first flag is the corresponding first configuration bit length; taking the function data of the first configuration bit length after the first flag bit read sequentially as the first configuration bit; identifying the first status bit corresponding to the first flag bit; if the first status bit is a preset enable flag, determining that the function to be configured is in an enabled state; if the first status bit is a preset disable flag, determining that the function to be configured is in a disabled state.

[0009] Furthermore, if the function to be configured is in an enabled state, based on the configuration function comparison table, the configuration operation corresponding to the function to be configured is executed until the configuration step of the function to be configured is completed, including: obtaining the configuration format corresponding to the function to be configured from the configuration function comparison table; determining the configuration operation corresponding to the function to be configured based on the first configuration bit and the configuration format, and executing the configuration operation; continuing to read the next function to be configured until a preset stop flag is read, and completing the configuration of all functions to be configured.

[0010] Furthermore, after power-on, before the step of identifying whether function data is stored in the Efuse memory, the method also includes: obtaining a burning instruction sent by an external device; the burning instruction includes a function name, and its corresponding configuration operation and function status; sequentially reading the 0th byte data in the Efuse memory, and determining whether the 0th byte data is a preset startup flag; if the 0th byte data is not the preset startup flag, determining that the current burning operation is the first burning operation, and writing the preset startup flag into the 0th byte data; based on the configuration function comparison table, converting the function name into a function bit, converting the function status into a status bit, and converting the configuration operation into a configuration bit; generating a flag bit based on the function bit and the status bit; saving the flag bit and the configuration as a configuration function, and generating function data by combining each configuration function; and burning the function data into the Efuse memory.

[0011] Furthermore, after the step of determining whether the 0th byte data is a preset start flag, the method also includes: if the 0th byte data is a preset start flag, determining that the current burning operation is not the first burning operation; based on the configuration function comparison table, converting the burning instruction into the current configuration function; traversing the function data, identifying whether the function data includes the function bit corresponding to the current configuration function; if the function bit is not identified, after the last configuration function in the function data, sequentially burning the current configuration function; if the function bit is identified, burning the status bit corresponding to the function bit as a preset disable flag, and sequentially burning the current configuration function after the last configuration function in the function data.

[0012] Furthermore, the burning instruction also includes an Efuse memory disabling instruction; after the step of obtaining the burning instruction sent by the external device, the method also includes: responding to the Efuse memory disabling instruction, burning the 0th byte data so that it is not a preset startup flag.

[0013] In a second aspect, an embodiment of the present invention provides a main control chip, which includes: a power-on module, which is used to identify whether functional data is stored in the Efuse memory after power-on; a configuration module, which is used to read the functional data if it is identified that the functional data is stored in the Efuse memory, and determine whether the functional data includes a function to be configured; the function to be configured consists of a flag bit and a configuration bit with a preset flag bit length; the configuration module is also used to determine whether the function to be configured is in an enabled state if the functional data includes the function to be configured; the configuration module is also used to execute the configuration operation corresponding to the function to be configured based on the configuration function comparison table if the function to be configured is in an enabled state until the configuration of the function to be configured is completed; wherein the configuration function comparison table is used to characterize the correspondence between the configuration function and the configuration operation.

[0014] In a third aspect, an embodiment of the present invention provides a mobile storage device, comprising a mobile storage device body and a Nand flash memory arranged in the mobile storage device body; and also comprising the above-mentioned main control chip; the main control chip is arranged in the mobile storage device body and connected to the Nand flash memory.

[0015] The embodiment of the present invention provides a function configuration method, a main control chip and a mobile storage device, the method comprising: after power-on, identifying whether function data is stored in the Efuse memory; if it is identified that function data is stored in the Efuse memory, reading the function data, and judging whether the function data includes a function to be configured; the function to be configured is composed of a flag bit and a configuration bit with a preset flag bit length; if the function data includes the function to be configured, judging whether the function to be configured is in an enabled state; if the function to be configured is in an enabled state, executing the configuration operation corresponding to the function to be configured based on a configuration function comparison table until the configuration of the function to be configured is completed; wherein the configuration function comparison table is used to characterize the correspondence between the configuration function and the configuration operation. In this method, by introducing a dynamic storage and parsing mechanism of flag bits and configuration bits in the Efuse memory, combined with the mapping of functions and operations by the configuration function comparison table, efficient identification, dynamic adjustment and flexible execution of configuration operations of the function data of the main control chip can be achieved, thereby meeting complex and diverse functional requirements within a limited storage space, thereby improving the function configuration efficiency, storage space utilization and adaptability of the main control chip and the mobile storage device.

[0016] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.

[0017] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 A flow chart of a function configuration method provided by an embodiment of the present invention;

[0020] Figure 2A flow chart of a method for determining functional data provided by an embodiment of the present invention;

[0021] Figure 3 A flow chart of a method for determining a function to be configured provided by an embodiment of the present invention;

[0022] Figure 4 A flow chart of an activation status determination method provided by an embodiment of the present invention;

[0023] Figure 5 A flow chart of a configuration method for a function to be configured provided by an embodiment of the present invention;

[0024] Figure 6 A flow chart of a method for burning functional data provided by an embodiment of the present invention;

[0025] Figure 7 A flow chart of a non-first-time programming method provided by an embodiment of the present invention;

[0026] Figure 8 A schematic diagram showing the configuration functions provided by the embodiment of the present invention;

[0027] Fig. 9 A schematic diagram of a main control chip provided in an embodiment of the present invention;

[0028] Fig.10 A schematic diagram of another main control chip provided by an embodiment of the present invention;

[0029] Fig.11 A schematic diagram of a mobile storage device provided by an embodiment of the present invention.

[0030] Icons: 1-power-on module; 2-configuration module; 3-EFUSE memory burning module; 11-mobile storage device body; 12-Nand flash memory; 13-main control chip. DETAILED DESCRIPTION

[0031] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0032] For the main control chip of mobile storage devices that use Nand flash memory (NAND Flash Memory, NAND flash memory) as a storage chip, such as USB flash drive main control, SD card main control, the code is generally stored in the Nand flash memory, eliminating the SPI Nor Flash (Serial Peripheral Interface NOR Flash) used to store the code, in order to save costs. Compared with SPI Nor Flash, Nand flash memory has more types and worse stability, so the main control chip needs to design relatively complex Boot code (boot program) to support reading and running code from Nand flash memories of various models and qualities. This part of the Boot algorithm code is generally solidified in the chip Maskrom (Masked Read-Only Memory) and cannot be modified, so at the beginning of chip design, it is necessary to consider covering as many types of Nand flash memories as possible. However, since Nand flash memories are updated every one or two years, the relevant support requirements may change, and the solidified code may not be able to support the new Nand flash memories well, which will shorten the life cycle of the chip. Therefore, some chips will also add Efuse memory (Electronic Fuse) at the beginning of design. Efuse memory is a programmable component based on electrical principles, designed inside the chip, with a capacity ranging from dozens to hundreds of bits. Each bit can only be burned once, and can only be burned from 0 to 1. After adding Efuse memory inside the chip, some configuration items or process branches that can be modified later can be added during the design of the Boot code, and the corresponding selection configuration can be performed by burning the Efuse memory later.

[0033] Due to the capacity limitation of the Efuse memory itself, the existing Boot code generally designs the data structure of the Efuse memory to be relatively simple. A common practice is that one or several bits at each fixed position in the Efuse represent the switch or configuration value of a certain function.

[0034] In this application, the Efuse memory consists of a flag bit and a configuration bit with a preset flag bit length, supports dynamic storage and parsing of configuration data of different functions, quickly identifies the function type and status through the flag bit, and avoids reading invalid data. It supports dynamic addition of functions and status adjustment to meet diverse functional requirements.

[0035] To facilitate understanding of this embodiment, the embodiment of the present invention is described in detail below.

[0036] Embodiment 1:

[0037] Figure 1A flow chart of a function configuration method provided by an embodiment of the present invention.

[0038] The function configuration method is applied to a main control chip, in which an Efuse memory is provided, and the Efuse memory is used to store function data.

[0039] Reference Figure 1 , function configuration method, including:

[0040] Step S101, after power-on, identifying whether there is function data stored in the Efuse memory.

[0041] Here, after the main control chip is powered on, the Boot program is run, and the Boot program determines whether the function data is stored in the Efuse memory.

[0042] In one embodiment, referring to Figure 2 , the steps of step S101 include:

[0043] Step S201, after power-on, sequentially read the 0th byte data in the Efuse memory.

[0044] Here, the Boot program accesses the location of the 0th byte in the Efuse memory and reads the contents of the byte. This is done by reading bit by bit or reading the whole byte, depending on the implementation of the hardware interface. The 0th byte is usually designed as a boot flag.

[0045] Step S202, determining whether the 0th byte data is a preset start flag.

[0046] Here, the preset boot flag is used to ensure that the configuration process is entered only after the Efuse memory is correctly burned, avoiding misconfiguration caused by uninitialized or abnormal writing in the Efuse memory. The preset boot flag is pre-set according to the actual situation, such as 0xAA or 0x55, to ensure uniqueness and identification.

[0047] When programming Efuse for the first time, write the preset boot flag to byte 0.

[0048] The read 0th byte data is compared with the preset startup flag value. If they match, it is confirmed that the function data is stored in the Efuse memory. If they do not match, it is determined that the Efuse memory is not initialized.

[0049] Step S203: If it is a preset startup flag, determine whether there is storage function data in the Efuse memory.

[0050] Here, if the 0th byte data matches the preset boot flag, it is determined that the rest of the Efuse memory may store valid functional data. The Boot program switches to the functional data reading state and gradually parses the flag bit and configuration bit starting from the 1st byte.

[0051] Step S204: If it is not a preset startup flag, it is determined that no functional data is stored in the Efuse memory, and the configuration is terminated.

[0052] Here, if the 0th byte data does not match the preset startup flag, the configuration process is terminated directly, and the main control chip enters the default operation mode or other backup process. For example: when Efuse is not initialized, the main control chip can run with default hardware parameters to ensure basic functions. Alternatively, through clear termination conditions, incorrect configuration caused by random or abnormal data in the Efuse memory can be prevented.

[0053] Step S102: if it is identified that function data is stored in the Efuse memory, the function data is read to determine whether the function data includes a function to be configured; the function to be configured is composed of a flag bit with a preset flag bit length and a configuration bit.

[0054] Here, by gradually reading the function data in the Efuse memory, it is determined whether there is a function to be configured.

[0055] The preset flag bit length is fixed to n bits, where n is preset according to the actual situation. The flag bit includes n-1 bits of function bits and 1 bit of status bits. The function bit is used to represent the function name of the function to be configured; the status bit is used to represent the function status of the function to be configured.

[0056] The traditional Efuse memory structure can only support the configuration of a few to a dozen functions, but in this embodiment, through the design of the flag header, the configuration types that can be supported are almost unlimited in theory. Assuming that the flag bit is defined as n bits, it can support up to 2 n-1 Function configuration.

[0057] If the flag bit is a preset stop flag bit (all 0s), it is determined that the function data does not include the function to be configured.

[0058] In one embodiment, referring to Figure 3 , the steps of step S102 include:

[0059] Step S301, taking the function data of a preset flag length after the 0th byte data read sequentially as the first flag.

[0060] Here, the flag bits of the current function configuration are extracted from the Efuse memory to identify the function type and state.

[0061] After completing the reading of the 0th byte (start flag), n bits of data (flag bit length) are read sequentially, and the read n bits of data are parsed as the first flag bit of the first function.

[0062] The first n-1 bits are function bits, identifying the type of function (eg, voltage configuration, interface enable).

[0063] The last bit is the status bit, indicating whether the function is enabled or disabled.

[0064] Step S302, determining whether the first flag is a preset stop flag.

[0065] Here, the value of the first flag bit is compared with a preset stop flag value.

[0066] If the first flag is a stop flag, it means that the current function data has been read and there is no more valid function configuration. If the first flag is not a stop flag, it means that there is a valid function configuration and it needs to be parsed.

[0067] The stop flag is a termination signal for the function configuration, which is used to prevent the Boot program from misreading uninitialized or invalid storage areas. The stop flag is usually designed to be all zero (for example, 00000) for easy identification.

[0068] Step S303: If it is the preset stop flag, it is determined that the function data does not include the function to be configured, and the configuration is terminated.

[0069] Here, if the first flag bit is consistent with the stop flag bit, it is determined that the function data in the Efuse memory no longer contains the function to be configured, the current configuration process is exited, the configuration operation is ended, and the subsequent storage data is no longer read.

[0070] Step S304: If the stop flag is not preset, it is determined that the function data includes the function to be configured.

[0071] Here, if the first flag bit is not a stop flag bit, the first flag bit is parsed as a corresponding function type, and it is determined that the function data contains a valid function to be configured. The configuration bit data is read, the function state (enabled or disabled) is determined, and the function configuration operation is performed.

[0072] Step S103: If the function data includes the function to be configured, it is determined whether the function to be configured is in an enabled state.

[0073] Here, the function status (the last bit of the flag bit) is extracted from the flag bit. When the status bit is 0, it indicates the enabled state. When the status bit is 1, it indicates the disabled state. If the function is enabled, read the configuration bit data corresponding to the function.

[0074] In one embodiment, referring to Figure 4 The steps of step S103 include:

[0075] Step S401: Determine the first flag as the corresponding first configuration bit length based on the first flag bit and the configuration function comparison table.

[0076] Here, the configuration function comparison table is as follows Figure 8 shown. Figure 8 The configuration function comparison table defines the mapping relationship between the flag bit and the configuration bit for each function type. The dynamic length is to flexibly adjust the configuration data length according to the function requirements to improve storage efficiency.

[0077] According to the configuration function comparison table, parse the specific data length of the function configuration corresponding to the flag bit.

[0078] Use the function bit to find the corresponding function type in the configuration function comparison table. Get the configuration bit length of the function. For example: voltage configuration (00010): the configuration bit length is 3 bits, IO driver function configuration (00011): the configuration bit length is 24 bits.

[0079] Step S402, taking the function data of the first configuration bit length after the first flag bit read sequentially as the first configuration bit.

[0080] Here, according to the configuration bit length parsed in the previous step, the corresponding number of bits are read sequentially from the flag bit. These bits are used as the configuration bits of the function. For example: if the current function is voltage configuration, read 3 bits of configuration bits to represent the voltage value (such as 101 represents 1.8V).

[0081] Step S403, identifying a first status bit corresponding to the first flag bit.

[0082] Here, the last bit (status bit) is extracted from the flag bit to determine the value of the status bit. 0 indicates an enabled state, and 1 indicates a disabled state.

[0083] Step S404: if the first status bit is a preset enabling flag, it is determined that the function to be configured is in an enabling state.

[0084] Here, if the status bit is 0, it is determined that the function is in an enabled state and is ready to enter the function configuration phase.

[0085] Step S405: If the first status bit is a preset disable flag, it is determined that the function to be configured is in a disabled state.

[0086] Here, if the status bit is 1, it is determined that the function is in a disabled state, and the parsing and execution of the current configuration function is skipped, and the next flag bit is directly read.

[0087] Step S104, if the function to be configured is in an enabled state, based on the configuration function comparison table, the configuration operation corresponding to the function to be configured is executed until the configuration of the function to be configured is completed; wherein the configuration function comparison table is used to represent the correspondence between the configuration function and the configuration operation.

[0088] Here, the configuration function comparison table is searched according to the flag bit to determine the configuration format and operation rules corresponding to the function. The configuration bit data following the flag bit is read, and the configuration bit data is converted into specific configuration parameters according to the definition of the comparison table. The corresponding function configuration logic is called to perform the operation. Among them, the configuration function comparison table is used to provide a mapping relationship between the flag bit, function type, configuration format, and configuration operation.

[0089] Continue to read the next flag bit and repeatedly determine whether the function status is enabled. If enabled, read the configuration bit and perform the corresponding operation. If the stop flag bit or unprogrammed area is read, end the configuration process.

[0090] Through step-by-step reading and configuration, it supports flexible combination and dynamic adjustment of multiple functions in the Efuse memory.

[0091] In one embodiment, referring to Figure 5 , the steps of step S104 include:

[0092] Step S501: Obtain the configuration format corresponding to the function to be configured from the configuration function comparison table.

[0093] Here, the specific configuration format and parameter requirements of the function to be configured are determined through the mapping relationship between the function bit and the configuration function comparison table.

[0094] According to the function bit in the current flag bit, look up the configuration function comparison table to determine the configuration format corresponding to the function.

[0095] Reference Figure 8 For example, voltage configuration (flag bit 00010): The configuration bit length is 3 bits, and the format is: bit0: LD01 voltage selection, 0=1.2V, 1=1.8V. bit1: LD02 voltage selection, 0=2.5V, 1=3.3V. bit2: Whether to power on before switching voltage, 0=not required, 1=required.

[0096] IO drive function configuration (flag bit 00011): The configuration bit length is 24 bits, and the format is: bit0-bit7: P0 drive current selection. bit8-bit15: P1 drive current selection. bit16-bit23: P2 drive current selection.

[0097] Step S502: Determine a configuration operation corresponding to the function to be configured based on the first configuration bit and the configuration format, and execute the configuration operation.

[0098] Here, the configuration function comparison table and the read configuration bits are used to parse specific parameters and perform corresponding hardware configuration operations, ensuring that the main control chip completes the hardware configuration according to the preset functional requirements.

[0099] For example, for voltage configuration (flag bit 00010): bit0=1 is parsed from configuration bit 101, indicating that the voltage selection for LD01 is 1.8V. bit1=0 indicates that the voltage selection for LD02 is 2.5V. bit2=1 indicates that power supply is required before switching voltage. Apply the parsed parameters to the hardware module of the main control chip or device. For example, set the working voltage of the voltage regulation module and adjust the output current of the I / O driver module.

[0100] Step S503, continue reading the next function to be configured until a preset stop flag is read, and the configuration of all functions to be configured is completed.

[0101] Here, read the next flag bit and repeat the following steps:

[0102] Determine whether the flag is the preset stop flag. If it is the stop flag, end the configuration process; if it is not the stop flag, continue to parse the flag and configuration bits and perform corresponding configuration operations.

[0103] Reading and configuration are terminated when a stop flag is encountered or the valid data area of ​​the Efuse memory ends.

[0104] In one embodiment, referring to Figure 6 Before step S101, the method further includes:

[0105] Step S601, obtaining a burning instruction sent by an external device; the burning instruction includes a function name, and its corresponding configuration operation and function status.

[0106] Here, the command of the external device is received to set the function configuration of the Efuse memory. The external device can be a host computer, etc. The external device sends the burning command to the main control chip through the interface.

[0107] The contents of the programming instructions include:

[0108] Function name: such as voltage configuration, I / O driver configuration, corresponding function bit.

[0109] Function status: Enabled or disabled, corresponding to the status bit.

[0110] Configuration operation: Specific configuration parameters, such as target voltage value, I / O drive strength, etc., correspond to configuration bits.

[0111] Step S602, sequentially read the 0th byte data in the Efuse memory to determine whether the 0th byte data is a preset startup flag.

[0112] Here, the main control chip reads the 0th byte data of the Efuse memory to determine whether the Efuse memory has been initialized.

[0113] If the 0th byte data is a preset startup flag, it means that the Efuse memory has been initialized. If the 0th byte data is not a preset startup flag, it means that the Efuse memory has not been initialized.

[0114] Step S603: if the 0th byte data is not a preset start flag, it is determined that the current programming operation is the first programming operation, and the preset start flag is written into the 0th byte data.

[0115] Here, if the 0th byte data is not a preset startup flag, it is determined that the current is the first programming operation, and the preset startup flag value (eg, 0xAA) is written into the 0th byte to mark the Efuse memory as initialized.

[0116] Mark the Efuse memory status as enabled, enable the configuration function of the Efuse memory, and ensure that subsequent functional data can be burned and read normally.

[0117] Step S604: based on the configuration function comparison table, convert the function name into a function bit, convert the function status into a status bit, and convert the configuration operation into a configuration bit.

[0118] Here, according to the function comparison table, the function name, state and operation in the programming instruction are converted into the data format of the Efuse memory.

[0119] Look up the configuration function comparison table and obtain the function bit corresponding to the function name (for example, voltage configuration corresponds to 00010). Set the status bit according to the function status (enabled or disabled). According to the configuration function comparison table, parse the specific parameters of the configuration operation and generate the corresponding configuration bit.

[0120] Step S605: Generate a flag bit based on the function bit and the status bit.

[0121] Here, the function bit and the status bit are concatenated to generate a complete flag bit. For example, the function bit 00010 + the status bit 0 generates the flag bit 00010. The flag bit occupies a fixed length (eg, 5 bits).

[0122] Step S606: associate the flag bit with the configuration and save it as a configuration function, and gather each configuration function to generate function data.

[0123] Here, the flag bits and configuration bits correspond one to one, forming a complete configuration function. All configuration functions are arranged in sequence to generate function data.

[0124] The data structure of the configuration function is: flag bit (5 bits) + configuration bit (dynamic length).

[0125] Step S607, burning the function data into the Efuse memory.

[0126] Here, find the end position of the last written function configuration in the Efuse memory, and start from the end position to burn new function data in sequence. Write the generated function data into the Efuse memory for the Boot program to read.

[0127] In one embodiment, referring to Figure 7 In step S602, after determining whether the 0th byte data is a preset start flag, the method further includes:

[0128] Step S701: If the 0th byte data is a preset start flag, it is determined that the current programming operation is not the first programming operation.

[0129] Here, read the 0th byte data of the Efuse memory to check whether it is the preset startup flag. If it is, it is determined that the Efuse memory has been initialized and the current burning operation is not the first operation. If not, it indicates that the Efuse memory is not initialized and the initialization operation needs to be performed.

[0130] By presetting the boot flag, the Efuse memory is ensured to write the boot flag only during the first programming, preventing invalid repeated writing. Efuse already has functional data, and can be directly incrementally programmed or modified later.

[0131] Step S702: based on the configuration function comparison table, convert the programming instruction into the current configuration function.

[0132] Here, according to the function comparison table, the programming instruction sent by the external device is parsed into a function data format recognizable by the Efuse memory.

[0133] Step S703, traverse the function data to identify whether the function data includes the function bit corresponding to the currently configured function.

[0134] Here, the existing function data in the Efuse memory is traversed, and the function bit of each flag bit is compared with the function bit of the currently configured function. If a matching function bit is found, it indicates that the current function already exists. If no matching function bit is found, it indicates that the current function has not been burned.

[0135] By checking whether the current function already exists in the Efuse memory, it is decided whether to overwrite or add.

[0136] Step S704: if the function bit is not identified, the current configuration function is sequentially burned after the last configuration function in the function data.

[0137] Here, the position of the last configuration function in the function data is found, and the current configuration function is burned in sequence thereafter, including writing the flag bit (function bit + status bit) and writing the configuration bit, so as to add the current configuration function in the Efuse memory.

[0138] This embodiment supports dynamic expansion of functional data in the Efuse memory to meet diverse needs.

[0139] Step S705: if the function bit is identified, the status bit corresponding to the function bit is burned as a preset disable flag, and the current configuration function is burned in sequence after the last configuration function in the function data.

[0140] Here, the old configuration functions are disabled and the updated configuration functions are added at the same time, so that the function data in the Efuse memory is updated incrementally without overwriting the entire storage area.

[0141] When traversing the function data, if a function bit matching the current configuration function is found, the status bit of the function bit is located and the status bit is burned as a disable flag (e.g. 1). At the end of the function data, the current configuration function is added and the new flag bit and configuration bit are written.

[0142] Specifically, refer to Figure 8 , simple function switches only need a flag header, no configuration value is required, such as the Boot SPI switch, which is turned off by default. As long as the flag header is read and the disable flag bit (bit 5 of the flag header) is 0, the function is enabled. Configurations with multiple options require reading several configuration bits, such as NF IO voltage configuration, which has 3 options of 1.2V, 1.8V, and 3.3V, which requires 2 configuration bits to represent, 00 represents 1.2V, 01 represents 1.8V, 10 represents 3.3V, and 11 is reserved. To directly assign a configuration to a variable, the number of configuration bits needs to be determined according to the data type of the variable. For example, in the above chart, the number of traversal addresses is a Word variable, which requires 16 bits of configuration.

[0143] In addition to the configuration of the above basic functions, in order to support more flexible and diverse configurations, this embodiment also includes two dynamic configuration functions: 1. The function of configuring any value for any register of the master control; 2. The function of pre-sending any command sequence to Nand Flash.

[0144] The first function, for 8-bit CPU, requires 24-bit configuration values, which are 8-bit register address, 8-bit target register operation bit, and 8-bit target operation bit setting value. The specific operation examples are as follows:

[0145] bit0~bit7:sfraddr: target register address.

[0146] bit8~bit15: mask: operation bits of the target register.

[0147] bit16~bit23: value: the setting value of the target operation bit.

[0148] For example: register address 0x95 sets bit2 and clears bit0.

[0149] sfraddr=0x95,mask=0x05,va lue=0x04

[0150] Binary data structure: 10010101-00000101-00000100.

[0151] The second function has a variable configuration length depending on the specific Nand Flash command operation to be sent. Each 1-byte command, 1-byte address, or 1-byte data sent is counted as one operation. Each operation requires 10 bits of configuration. If there are n operations in total, a total of 10n+2 configuration bits need to be burned. The specific burning configuration example is as follows:

[0152] Each NF operation has 10 bits, and bit0 to bit1 are the operation types:

[0153] 00: send 1byte command.

[0154] 01: send 1byte address.

[0155] 10: send 1 byte data.

[0156] 11: end.

[0157] Bit2 to bit9 are operands.

[0158] When the operation is finished, write 2 bits of 11 as the end mark.

[0159] Example: set feature: EFh (command), 00h (address), 01h (data)

[0160] Binary data structure: 00-11101111-01-00000000-10-00000001-11.

[0161] In one embodiment, the programming instruction further includes an Efuse memory disabling instruction. After step S601, the method further includes:

[0162] In response to the Efuse memory disable instruction, the 0th byte data is burned so as not to be a preset startup flag.

[0163] Here, this embodiment supports disabling the functional configuration of the Efuse memory through an external device to ensure system security or adapt to specific scenario requirements.

[0164] Add an Efuse memory disable command to the programming command to indicate that the Efuse function needs to be disabled as a whole. The disable command includes a command type and a target object. The command type indicates that the current operation is a disable operation. The target object is used to specify the Efuse memory that needs to be disabled.

[0165] The overall disabling of the Efuse memory is achieved through special instructions, providing flexible function management capabilities.

[0166] After receiving the disable command sent by the external device, the programming command is parsed to confirm whether it contains the disable command. If it contains the disable command, the Efuse function configuration is disabled as a whole by modifying the startup flag of the Efuse memory.

[0167] Specific disabling methods include:

[0168] Determine the 0th byte as the location of the Efuse startup flag, and modify the 0th byte data from the preset startup flag (such as 0xAA) to an invalid value (such as 0x00). After the programming is completed, the functional configuration of the Efuse memory will no longer be recognized and executed.

[0169] The embodiment of the present invention provides a function configuration method, which includes: after power-on, identifying whether function data is stored in the Efuse memory; if it is identified that function data is stored in the Efuse memory, reading the function data, and judging whether the function data includes the function to be configured; the function to be configured is composed of a flag bit and a configuration bit with a preset flag bit length; if the function data includes the function to be configured, judging whether the function to be configured is in an enabled state; if the function to be configured is in an enabled state, executing the configuration operation corresponding to the function to be configured based on a configuration function comparison table until the configuration of the function to be configured is completed; wherein the configuration function comparison table is used to characterize the correspondence between the configuration function and the configuration operation. In this method, by introducing a dynamic storage and parsing mechanism of flag bits and configuration bits in the Efuse memory, combined with the mapping of functions and operations by the configuration function comparison table, efficient identification, dynamic adjustment and flexible execution of configuration operations of the function data of the main control chip can be achieved, thereby meeting complex and diverse functional requirements within a limited storage space, thereby improving the function configuration efficiency, storage space utilization and adaptability of the main control chip and the mobile storage device.

[0170] Embodiment 2:

[0171] Fig. 9 A schematic diagram of a main control chip provided in an embodiment of the present invention.

[0172] Reference Fig. 9 , the main control chip includes:

[0173] The power-on module 1 is used to identify whether there is function data stored in the Efuse memory after power-on.

[0174] Configuration module 2 is used to read the function data if it is recognized that the Efuse memory stores function data, and determine whether the function data includes the function to be configured; the function to be configured consists of a flag bit with a preset flag bit length and a configuration bit.

[0175] The configuration module 2 is further configured to determine whether the function to be configured is in an enabled state if the function data includes the function to be configured.

[0176] The configuration module 2 is also used to execute the configuration operation corresponding to the function to be configured based on the configuration function comparison table if the function to be configured is in an enabled state until the configuration of the function to be configured is completed; wherein the configuration function comparison table is used to characterize the correspondence between the configuration function and the configuration operation.

[0177] In one embodiment, the power-on module 1 is further used for:

[0178] After power-on, read the 0th byte data in the Efuse memory sequentially.

[0179] Determine whether the 0th byte data is a preset start flag.

[0180] If it is a preset startup flag, make sure there is storage function data in the Efuse memory.

[0181] If it is not the preset startup flag, it is determined that no functional data is stored in the Efuse memory, and the configuration is terminated.

[0182] In one embodiment, the configuration module 2 is further used for:

[0183] The function data of the preset flag bit length after the 0th byte data read sequentially is used as the first flag bit.

[0184] Determine whether the first flag is a preset stop flag.

[0185] If it is a preset stop flag, it is determined that the function data does not include the function to be configured, and the configuration is terminated.

[0186] If the stop flag is not preset, it is determined that the function data includes the function to be configured.

[0187] In one embodiment, the flag bit includes a function bit and a status bit; the function bit is used to represent the function name of the function to be configured; the status bit is used to represent the function status of the function to be configured. Configuration module 2 is also used to:

[0188] Based on the first flag bit and the configuration function comparison table, determine the first flag to correspond to the first configuration bit length.

[0189] The function data of the first configuration bit length after the first flag bit read sequentially is used as the first configuration bit.

[0190] A first status bit corresponding to the first flag bit is identified.

[0191] If the first state bit is a preset enable flag, it is determined that the function to be configured is in an enabled state.

[0192] If the first status bit is a preset disable flag, it is determined that the function to be configured is in a disabled state.

[0193] In one embodiment, the configuration module 2 is further used for:

[0194] Obtain the configuration format corresponding to the function to be configured from the configuration function comparison table.

[0195] Based on the first configuration bit and the configuration format, a configuration operation corresponding to the function to be configured is determined, and the configuration operation is performed.

[0196] Continue to read the next function to be configured until the preset stop flag is read, completing the configuration of all functions to be configured.

[0197] In one embodiment, referring to Fig.10 The main control chip also includes: an Efuse memory burning module 3, the Efuse memory burning module 3 is connected to the power-on module 1; the Efuse memory burning module 3 is used to:

[0198] Obtain the programming instruction sent by the external device; the programming instruction includes the function name, its corresponding configuration operation and function status.

[0199] Sequentially read the 0th byte data in the Efuse memory to determine whether the 0th byte data is a preset startup flag.

[0200] If the 0th byte data is not the preset start flag, it is determined that the current programming operation is the first programming operation, and the preset start flag is written into the 0th byte data.

[0201] Based on the configuration function comparison table, the function name is converted into the function bit, the function status is converted into the status bit, and the configuration operation is converted into the configuration bit.

[0202] Generate flag bits based on function bits and status bits.

[0203] The flag bit and the configuration are associated and saved as a configuration function, and each configuration function is assembled to generate function data.

[0204] Burn the function data into the Efuse memory.

[0205] In one embodiment, the Efuse memory burning module 3 is further used for:

[0206] If the 0th byte data is a preset start flag, it is determined that the current programming operation is not the first programming operation.

[0207] Based on the configuration function comparison table, the programming instruction is converted into the current configuration function.

[0208] Traverse the function data and identify whether the function data includes the function bit corresponding to the currently configured function.

[0209] If the function bit is not recognized, the current configuration function is programmed sequentially after the last configuration function in the function data.

[0210] If a function bit is identified, the status bit corresponding to the function bit is burned as a preset disable flag, and the current configuration function is burned sequentially after the last configuration function in the function data.

[0211] In one embodiment, the programming instruction further includes an Efuse memory disabling instruction. The Efuse memory programming module 3 is further used for:

[0212] In response to the Efuse memory disable instruction, the 0th byte data is burned so as not to be a preset startup flag.

[0213] An embodiment of the present invention provides a main control chip. In this method, by introducing a dynamic storage and parsing mechanism of flag bits and configuration bits in the Efuse memory, combined with the mapping of functions and operations by a configuration function comparison table, efficient identification, dynamic adjustment and flexible execution of configuration operations of the function data of the main control chip can be achieved, thereby meeting complex and diverse functional requirements within a limited storage space, thereby improving the functional configuration efficiency, storage space utilization and adaptability of the main control chip and the mobile storage device.

[0214] Embodiment three:

[0215] Fig.11 A schematic diagram of a mobile storage device provided by an embodiment of the present invention.

[0216] Reference Fig.11 The mobile storage device includes a mobile storage device body 11 and a Nand flash memory 12 arranged in the mobile storage device body 11; it also includes the above-mentioned main control chip 13; the main control chip 13 is arranged in the mobile storage device body 11 and connected to the Nand flash memory 12.

[0217] An embodiment of the present invention provides a mobile storage device. In this method, by introducing the flag bit and configuration bit management mechanism of the Efuse memory in the main control chip, combined with the Boot algorithm to dynamically identify and parse functional data, efficient management and dynamic adjustment of the functional configuration of the mobile storage device can be achieved, thereby enhancing the adaptability and flexibility of the mobile storage device to different application scenarios, thereby improving the reliability, scalability and functional upgrade capability of the device, and meeting complex and diverse storage needs.

[0218] The computer program product provided in the embodiment of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method described in the previous method embodiment. The specific implementation can be found in the method embodiment and will not be repeated here.

[0219] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0220] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0221] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0222] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0223] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A function configuration method, characterized in that: Applied to a main control chip, the main control chip is provided with an Efuse memory, and the Efuse memory is used to store functional data; the method comprises: After power-on, identifying whether the function data is stored in the Efuse memory; If it is identified that the function data is stored in the Efuse memory, the function data is read to determine whether the function data includes a function to be configured; the function to be configured is composed of a flag bit with a preset flag bit length and a configuration bit; If the function data includes the function to be configured, determining whether the function to be configured is in an enabled state; If the function to be configured is in the enabled state, the configuration operation corresponding to the function to be configured is executed based on the configuration function comparison table until the configuration of the function to be configured is completed; wherein the configuration function comparison table is used to characterize the correspondence between the configuration function and the configuration operation.

2. The function configuration method according to claim 1, characterized in that: After powering on, the step of identifying whether the function data is stored in the Efuse memory comprises: After power-on, sequentially read the 0th byte data in the Efuse memory; Determine whether the 0th byte data is a preset start flag; If it is the preset startup flag, determining whether the function data is stored in the Efuse memory; If it is not the preset startup flag, it is determined that the function data is not stored in the Efuse memory, and the configuration is terminated.

3. The function configuration method according to claim 2, characterized in that: If it is recognized that the function data is stored in the Efuse memory, the step of reading the function data and determining whether the function data includes the function to be configured includes: The function data of the preset flag bit length after the 0th byte data read sequentially is used as the first flag bit; Determining whether the first flag is a preset stop flag; If it is the preset stop flag, determining that the function data does not include the function to be configured, and ending the configuration; If it is not the preset stop flag, it is determined that the function data includes the function to be configured.

4. The function configuration method according to claim 3, characterized in that: The flag bit includes a function bit and a status bit; the function bit is used to represent the function name of the function to be configured; the status bit is used to represent the function status of the function to be configured; If the function data includes the function to be configured, the step of determining whether the function to be configured is in an enabled state comprises: Based on the first flag bit and the configuration function comparison table, determining that the first flag is a corresponding first configuration bit length; Using the function data of the first configuration bit length sequentially read after the first flag bit as the first configuration bit; Identifying a first status bit corresponding to the first flag bit; If the first state bit is a preset enable flag, determining that the function to be configured is in the enable state; If the first status bit is a preset disable flag, it is determined that the function to be configured is in a disabled state.

5. The function configuration method according to claim 4, characterized in that: The step of executing, if the function to be configured is in the enabled state, a configuration operation corresponding to the function to be configured based on a configuration function comparison table until the configuration of the function to be configured is completed includes: Obtaining the configuration format corresponding to the function to be configured from the configuration function comparison table; Determine the configuration operation corresponding to the function to be configured based on the first configuration bit and the configuration format, and perform the configuration operation; Continue to read the next function to be configured until a preset stop flag is read, completing the configuration of all the functions to be configured.

6. The function configuration method according to claim 1, characterized in that: After powering on, before the step of identifying whether the function data is stored in the Efuse memory, the method further includes: Obtaining a burning instruction sent by an external device; the burning instruction includes a function name, a corresponding configuration operation and a function status; Sequentially read the 0th byte data in the Efuse memory to determine whether the 0th byte data is a preset startup flag; If the 0th byte data is not the preset start flag, determining that the current programming operation is the first programming operation, and writing the preset start flag into the 0th byte data; Based on the configuration function comparison table, convert the function name into a function bit, convert the function status into a status bit, and convert the configuration operation into the configuration bit; generating the flag bit based on the function bit and the status bit; The flag bit and the configuration are associated and saved as a configuration function, and each of the configuration functions is assembled to generate the function data; Burn the function data into the Efuse memory.

7. The function configuration method according to claim 6, characterized in that: After the step of determining whether the 0th byte data is a preset start flag, the method further includes: If the 0th byte data is the preset start flag, determining that the current programming operation is not the first programming operation; Based on the configuration function comparison table, converting the programming instruction into the current configuration function; Traversing the function data, and identifying whether the function data includes the function bit corresponding to the currently configured function; If the function bit is not identified, the current configuration function is sequentially burned after the last configuration function in the function data; If the function bit is identified, the status bit corresponding to the function bit is burned as a preset disable flag, and the current configuration functions are burned in sequence after the last configuration function in the function data.

8. The function configuration method according to claim 7, characterized in that: The burn-in instruction also includes an Efuse memory disabling instruction; After the step of obtaining the programming instruction sent by the external device, the method further includes: In response to the Efuse memory disable instruction, the 0th byte data is burned so as not to be the preset startup flag.

9. A main control chip, characterized in that: The main control chip includes: A power-on module is used to identify whether there is functional data stored in the Efuse memory after power-on; A configuration module, for reading the function data if it is recognized that the function data is stored in the Efuse memory, and determining whether the function data includes a function to be configured; the function to be configured is composed of a flag bit with a preset flag bit length and a configuration bit; The configuration module is further configured to determine whether the function to be configured is in an enabled state if the function data includes the function to be configured; The configuration module is also used to, if the function to be configured is in the enabled state, execute the configuration operation corresponding to the function to be configured based on the configuration function comparison table until the configuration of the function to be configured is completed; wherein the configuration function comparison table is used to characterize the correspondence between the configuration function and the configuration operation.

10. A mobile storage device, characterized in that: It comprises a mobile storage device body and a Nand flash memory arranged in the mobile storage device body; it also comprises the main control chip as claimed in claim 9; the main control chip is arranged in the mobile storage device body and connected to the Nand flash memory.