A secure access control method for FLASH space based on UCB
By setting the PAGE level protection type and independent KEY management in the UCB of the smart car ECU chip, the problem of lack of detailed protection and reconfiguration support in the existing technology is solved, and powerful and flexible security access control of the smart car FLASH space is realized. .
Patent Information
- Application Number
- CN202310627980.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2043-05-31
AI Technical Summary
The existing technology lacks detailed read protection, programming protection and erase protection in the FLASH space of the smart car ECU chip, and the protection configuration does not support refinement to each sector. The BackdoorKey used does not support reconfiguration, and the meaning of the protection types is different. Small, repetitive mechanism.
By setting the protection setting information of each PAGE in UCB, it is divided into programming protection, read protection and erase protection. Use independent KEY to realize protection configuration management, temporarily lift or restore access protection, and the hardware loads configuration data during reset or reload. , the CPU accesses the register setting protection through the bus, and it only takes effect after verification.
It achieves detailed read protection, programming protection and erase protection for programming FLASH and data FLASH space, enhances the independent protection of UCB, establishes a more powerful and reliable security protection mechanism, and improves flexibility through independent KEY management.
Smart Images

Figure CN116702233B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of chip security, and in particular to a UCB-based FLASH space security access control method. Background Art
[0002] The security of smart cars is based on chip security, which covers both security and information security. The FLASH of the ECU chip of smart cars usually stores program running codes, running data, and user information. Therefore, how to achieve secure access of the CPU to the Flash data is an important factor related to chip security.
[0003] In the prior art, the protection settings of n sectors are placed in UCB, and after reset, they are read out by hardware and configured in the protection register. There are three types of protection, which are divided into programming protection, WOP protection (WriteOnce Program, which allows programming once) and OTP protection (OneTimeProgram, which does not allow programming once, and has a function similar to Rom). The scope of these three types of protection is programming FLASH. This solution has the following disadvantages: for programming and erasing operations; there is no protection for data FLASH; read protection is not configured with UCB; read protection is not refined to each sector; UCB does not have a separate password; WOP protection and OTP protection have little difference in meaning, and the mechanism is repeated
[0004] In another prior art, there are two types of protection, namely, programming protection and erasing protection. The protection range includes programming Flash and data Flash, but the solution has the following disadvantages: no read protection; access protection configuration is not refined to sectors; all protections share one BackdoorKey; BackdoorKey does not support reconfiguration. Summary of the invention
[0005] In view of the shortcomings of the prior art, the purpose of the present invention is to provide a secure access control method for FLASH space based on UCB to solve the problems raised in the above background technology. The present invention realizes more detailed read protection, programming protection and erase protection; realizes safe and real-time operation of protection configuration; uses independent KEY to realize configuration management of different protections; and uses independent KEY to realize protection of UCB space.
[0006] In order to achieve the above-mentioned purpose, the present invention is implemented through the following technical scheme: a security access control method for FLASH space based on UCB, comprising the following steps: placing the protection setting information of each PAGE in UCB; setting three types of protection, which are divided into programming protection, read protection and erase protection; temporarily releasing the protection of FLASHpage by DprotREG and PprotREG; setting global read, write and erase protection in the access register of the FLASH module; placing the above-mentioned Page protection configuration information P_PROT and D_PROT in UCB, and saving the above-mentioned KEY in UCB at the same time.
[0007] Furthermore, the protection setting information of the PAGE includes P_PROT and D_PROT, and is read out by hardware after reset and configured in a protection register, and the protection register includes DprotREG and Pprot REG.
[0008] Furthermore, after the UCBKey verification is passed, the read, write, and erase access protection of the part of the UCB space can be temporarily released or restored.
[0009] Furthermore, the FLASHMemory space is composed of several Pages. A Page is allocated in DFLASH and used as UCB. When Reset or Reload command is executed, the hardware will load the configuration data saved in UCB into DprotREG and PprotREG.
[0010] Furthermore, the hardware logic performs access control on the DFLASH space and the PFLASH space according to the configuration of DprotREG and PprotREG.
[0011] Furthermore, the protection type protects Page0 to PageN of DFLASH and PFLASH. The change of the protection configuration takes effect after the next reset or immediately takes effect using the Reload command.
[0012] Furthermore, within the protection scope of FLASHpage, after passing ProgKey verification, the programming protection can be set to be temporarily released or restored; after passing RDKey verification, the read protection can be set to be temporarily released or restored; after passing EraseKey verification, the erase protection can be set to be temporarily released or restored.
[0013] Furthermore, the global read, write and erase protection objects are set in the access register of the FLASH module to be the entire PFlash and the entire DFlash.
[0014] Furthermore, the CPU can directly access the register through the bus, and the setting changes take effect immediately.
[0015] Furthermore, the CPU can read, write and erase the content of the Page protection configuration information only after it passes the UCBKEY verification, and can read, write and erase the KEY stored in the UCB only after it passes the UCBSuperKey verification.
[0016] Beneficial effects of the present invention:
[0017] 1. In the UCB-based FLASH space security access control method, comprehensive and detailed read protection, programming protection and erase protection for programming FLASH and data FLASH space are realized, the protection of UCB is strengthened, and it is independent of the protection of FLASH space, thus establishing a more powerful and reliable security protection mechanism for FLASH space.
[0018] 2. The secure access control method of the UCB-based FLASH space uses independent KEYs to implement configuration management of different protections, and uses independent KEYs to implement protection of the UCB space, thus establishing a more secure and flexible KEY management mechanism. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 A chip structure diagram of a secure access control method for FLASH space based on UCB of the present invention;
[0020] Figure 2 It is a UCB space diagram in a UCB-based FLASH space security access control method of the present invention. DETAILED DESCRIPTION
[0021] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the present invention is further explained below in conjunction with specific implementation methods.
[0022] See also Figure 1 to Figure 2 The present invention provides a technical solution: a secure access control method for FLASH space based on UCB includes the following solutions:
[0023] 1. Place the protection setting information (P_PROT and D_PROT) of each PAGE in UCB, and after reset, the hardware reads out the configuration in the protection register (DprotREG and PprotREG shown in the figure below).
[0024] 2. After passing the UCBKey verification, the read, write, and erase access protection of this part of the UCB space can be temporarily lifted or restored.
[0025] In this embodiment, Figure 1As shown in the figure: FLASHMemory space consists of several Pages. A Page is allocated in DFLASH and used as UCB. When Reset or Reload command is executed, the hardware will load the configuration data saved in UCB into DprotREG and PprotREG.
[0026] The hardware logic performs access control on the DFLASH space and PFLASH space according to the configuration of DprotREG and PprotREG, that is, controls whether the corresponding Page of FLASH can be read, written and erased.
[0027] 3. There are three types of protection, including programming protection, read protection and erase protection. The objects of these three protections are Page0~PageN of DFLASH and PFLASH. After changing the above protection configuration, it will take effect after the next reset, or you can use the Reload command to make it take effect immediately.
[0028] 4. The protection of FLASHpage by DprotREG and PprotREG can be temporarily released.
[0029] After passing the ProgKey verification, you can set to temporarily release or restore programming protection.
[0030] After passing RDKey verification, you can set to temporarily release or restore read protection.
[0031] After passing the EraseKey verification, you can set to temporarily release or restore the erase protection.
[0032] 5. Set global read, write, and erase protection in the access register of the FLASH module (ACCCTRLREG in the figure above). The protection object is the entire PFlash and the entire DFlash. The CPU can directly access this register through the bus, and the setting changes will take effect immediately.
[0033] 6. If Figure 2 The above page protection configuration information P_PROT and D_PROT are placed in UCB. Only after passing the UCBKEY verification, the CPU can read, write and erase the content of the segment.
[0034] like Figure 2 The above keys are stored in UCB. Only after passing the UCBSuperKey verification can the CPU read, write and erase the content.
[0035] Through the above process, comprehensive and detailed read protection, programming protection and erase protection of programming FLASH and data FLASH space are achieved, the protection of UCB is strengthened, and it is independent of the protection of FLASH space, establishing a more powerful and reliable security protection mechanism for FLASH space.
[0036] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and the present invention can be implemented in other specific forms without departing from the spirit or basic features of the present invention. Therefore, no matter from which point of view, the embodiments should be regarded as exemplary and non-restrictive. The scope of the present invention is defined by the attached claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any figure mark in the claims should not be regarded as limiting the claims involved.
[0037] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. A secure access control method for FLASH space based on UCB, characterized in that: The following steps are involved: Place the protection setting information for each PAGE in the UCB; Set three types of protection, including programming protection, reading protection, and erasing protection; Support temporarily releasing the protection of Dprot REG and Pprot REG for FLASH page; set global read, write and erase protection in the access register of FLASH module; place the above-mentioned Page protection configuration information P_PROT and D_PROT in UCB, and save all KEY in UCB at the same time. The protection setting information of PAGE includes P_PROT and D_PROT, and is read out and configured in the protection register by hardware after reset. The protection register includes Dprot REG and Pprot REG. After verification by UCB Key, the read, write and erase access protection of UCB space storing configuration information can be temporarily released or restored. FLASH Memory space is composed of several Pages; a Page is divided in DFLASH and used as UCB; when Reset or Reload command is executed, the hardware will load the configuration data saved in UCB into Dprot REG and Pprot REG. In REG, the protection type protects Page0~PageN of DFLASH and PFLASH. After changing the above protection configuration, it will take effect after the next reset or use the Reload command to make it effective immediately. Within the protection scope of FLASH page, after passing the Prog Key verification, the programming protection can be set to be temporarily released or restored; after passing the RD Key verification, the read protection can be set to be temporarily released or restored; after passing the Erase Key verification, the erase protection can be set to be temporarily released or restored; the CPU can directly access the register through the bus, and the setting will take effect immediately after the change. The Page protection configuration information can only be verified by UCB KEY before the CPU can read, write and erase the content of this section, and only after passing the UCB SuperKey verification can the CPU read, write and erase the KEY stored in the UCB.
2. The method for secure access control of FLASH space based on UCB according to claim 1, characterized in that: The hardware logic performs access control on the DFLASH space and PFLASH space according to the configuration of Dprot REG and Pprot REG.
