CN-121979539-A - Method for realizing chip multiple programming function by using efuse
Abstract
The application provides a method for realizing a chip multiple programming function by using an efuse, which comprises the steps of reading the current programming times written in a first storage area, determining the programming times, reading data to be programmed in a second storage area, calculating a first check code through the data to be programmed in the second storage area, writing the first check code into a third storage area, programming the programming times of the first storage area, the data to be programmed in the second storage area and the first check code in the third storage area into the efuse array at one time, and reading the data to be programmed in a nonvolatile register after the chip is powered down and powered up, wherein the data to be programmed is acquired through the programming times to be programmed in the first storage area and the data to be programmed in the second storage area. The chip multiple programming function is implemented by the present application using the efuse.
Inventors
- LI JIANGKUN
- ZHANG LINGHAO
- WU JIA
- ZHANG MIN
Assignees
- 芯合电子(上海)有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260124
Claims (5)
- 1. A method of implementing a chip multiple programming function using an efuse, the efuse comprising an efuse register and an efuse array, the efuse register comprising a first memory region, a second memory region, and a third memory region, the method comprising: Reading the current burning times written into the first storage area, wherein the first storage area records the burning times by adopting a thermometer code, and writing the current burning times into the first storage area after adding 1 on the basis of the current burning times to obtain the times to be burnt; Reading data to be burnt written in the second storage area, calculating a first check code through the data to be burnt written in the second storage area, and writing the first check code into the third storage area; The number of times to be burnt in the first storage area, the data to be burnt in the second storage area and the first check code in the third storage area are burnt into the efuse array at one time; And when the chip is powered down and powered up, reading the data to be burnt in the nonvolatile register, wherein the data to be burnt is obtained through the data to be burnt in the second storage area for the times of being burnt in the first storage area.
- 2. The method for implementing a multiple programming function using an efuse of claim 1, wherein after reading the data to be burned in the nonvolatile register, the method comprises: and checking the data to be burnt according to the first check code, and if the check is passed, reading the data to be burnt in the nonvolatile register.
- 3. The method of implementing a multiple programming function using an efuse of claim 1, wherein the reading the current number of burns written to the first storage area includes: reading the primary burning times stored in the first storage area; Determining the preliminary burning times, and reading burning data of the preliminary burning times in the second storage area; and checking the burning data of the preliminary burning times, and if the checking is passed, determining that the preliminary burning times are the current burning times.
- 4. The method of using an efuse to implement a multiple programming function of claim 3, wherein verifying the initial number of burns of the burn data includes: determining a second check code of the burning data of the preliminary burning times in the third storage area; judging whether the burning data of the primary burning times are correct or not according to the second check code; if it is correct, the verification passes.
- 5. The method of implementing a multiple programming function using an efuse of claim 1, wherein the reading and writing to the current number of burns in the first storage area is preceded by: Writing the data to be burned into a nonvolatile register; And reading the data to be burnt in the nonvolatile register, and writing the data to be burnt into the second storage area.
Description
Method for realizing chip multiple programming function by using efuse Technical Field The embodiments of the application belong to the technical field of chip programming, and particularly relate to a method for realizing a chip multiple programming function by using an efuse. Background The system basic chip SBC has a plurality of programmable nonvolatile registers MTPNV (Multiple Time Programmable Non-Volatile, which is abbreviated as MTPNV) and the functions are mainly used for storing default configuration information of the chip and supporting specific mode setting, and the specific functions are as follows: The default configuration is stored, wherein the address range is 0x73-0x74, and the default configuration parameters of the device, such as the forced normal mode control bit FNMC (Fail-Safe Normal Mode Control, i.e. Fail-safe normal mode control) and other information, can be used for determining the initial working state of the chip when the chip is started. Mode setting and switching is supported by programming registers in MTPNV to configure the operating mode of the chip, such as switching from forced normal mode to software development mode, etc. Under the forced normal mode, part of the registers of the chip are inaccessible, and specific MTPNV register values are written in, so that a software development mode can be enabled, a user can access and read and write any register of the chip, and a developer can conveniently and comprehensively debug and set functions of the chip. And in the operation of recovering the factory preset value of the SBC chip, MTPNV plays a key role. When restoring factory setting, the RSTN pin needs to be set at low level, CAN_H is connected with the input voltage VBAT and CAN_L to be grounded, and the battery power-on time of at least MTPNV is maintained, the MTPNV time parameter is set by MTPNV related time, and the operation chip is reset to an initial forced normal mode. None of the usual BCD processes have multiple programmable MTPs, and developing MTPs alone requires additional process verification cycles or IP authorization. In contrast, one-time programmable OTP (one time program) circuits are very common and process stable. At present, a technical scheme for realizing the MTP function through OTP is not available. Disclosure of Invention In order to solve or alleviate the technical problems in the prior art, the present application is mainly how to use efuse to implement MTP functions. The embodiment of the application provides a method for realizing a chip multiple programming function by using an efuse, wherein the efuse comprises an efuse register and an efuse array, the efuse register comprises a first storage area, a second storage area and a third storage area, and the method comprises the following steps: Reading the current burning times written into the first storage area, wherein the first storage area records the burning times by adopting a thermometer code, and writing the current burning times into the first storage area after adding 1 on the basis of the current burning times to obtain the times to be burnt; Reading data to be burnt written in the second storage area, calculating a first check code through the data to be burnt written in the second storage area, and writing the first check code into the third storage area; The number of times to be burnt in the first storage area, the data to be burnt in the second storage area and the first check code in the third storage area are burnt into the efuse array at one time; And when the chip is powered down and powered up, reading the data to be burnt in the nonvolatile register, wherein the data to be burnt is obtained through the data to be burnt in the second storage area for the times of being burnt in the first storage area. As a preferred embodiment of the present application, after reading the data to be burned in the nonvolatile register, the method includes: and checking the data to be burnt according to the first check code, and if the check is passed, reading the data to be burnt in the nonvolatile register. As a preferred embodiment of the present application, the reading and writing of the current number of burns in the first storage area includes the following steps: reading the primary burning times stored in the first storage area; Determining the primary burning times, and reading the data burnt by the primary burning times in the second storage area; and checking the data recorded by the primary recording times, and if the data passes the checking, determining that the primary recording times are the current recording times. As a preferred embodiment of the present application, the verifying the data recorded by the primary recording times includes: determining a second check code of the burning data of the preliminary burning times in the third storage area; judging whether the burning data of the primary burning times are correct or not according to the second check code; i